diff --git a/test/unit/strict-template-policy.html b/test/unit/strict-template-policy.html index bfb697dc32..5720829f7f 100644 --- a/test/unit/strict-template-policy.html +++ b/test/unit/strict-template-policy.html @@ -94,24 +94,22 @@ // Safari errors are thrown on the top window, sometimes not, so // catch in both places let uncaughtError = null; - const onerror = window.onerror; - const topOnerror = window.top.topOnerror; window.onerror = window.top.onerror = function(err) { if (!uncaughtError) { uncaughtError = new Error(err); } - } + }; assert.throws(function() { fn(); // Re-throw any uncaughtErrors let err; - if (err = (uncaughtError || window.uncaughtError)) { + if ((err = (uncaughtError || window.uncaughtError))) { throw new Error(err.message); } // Force polyfill reactions and/or async template stamping Polymer.flush(); // Re-throw any uncaughtErrors - if (err = (uncaughtError || window.uncaughtError)) { + if ((err = (uncaughtError || window.uncaughtError))) { throw new Error(err.message); } }, re);