Bug 1450981 [wpt PR 10280] - Throw IdlHarnessError outside try, a=testonly
authorLuke Bjerring <lukebjerring@google.com>
Mon, 09 Apr 2018 22:01:28 +0000
changeset 467263 63bb1c3272ab427351432d732c0204cbbea542ce
parent 467262 5267a58d7b2533d3b516ebb31202aada7edd222d
child 467264 c81f9db533919f79d44d3b50f5d0f75a512b5ea9
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1450981, 10280
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1450981 [wpt PR 10280] - Throw IdlHarnessError outside try, a=testonly Automatic update from web-platform-testsThrow IdlHarnessError outside try wpt-commits: 81e900a6b04e9ba9bd07a478e2b0d349c02646c6 wpt-pr: 10280 wpt-commits: 81e900a6b04e9ba9bd07a478e2b0d349c02646c6 wpt-pr: 10280
testing/web-platform/tests/resources/idlharness.js
--- a/testing/web-platform/tests/resources/idlharness.js
+++ b/testing/web-platform/tests/resources/idlharness.js
@@ -598,29 +598,30 @@ function exposed_in(globals) {
  * @param {string|IdlHarnessError} error Expected Error message.
  * @param {Function} idlArrayFunc Function operating on an IdlArray that should throw.
  */
 IdlArray.prototype.assert_throws = function(error, idlArrayFunc)
 //@{
 {
     try {
         idlArrayFunc.call(this, this);
-        throw new IdlHarnessError(`${idlArrayFunc} did not throw the expected IdlHarnessError`);
     } catch (e) {
         if (e instanceof AssertionError) {
             throw e;
         }
         // Assertions for behaviour of the idlharness.js engine.
         if (error instanceof IdlHarnessError) {
             error = error.message;
         }
         if (e.message !== error) {
-            throw new IdlHarnessError(`${idlArrayFunc} threw ${e}, not the expected IdlHarnessError`);
+            throw new IdlHarnessError(`${idlArrayFunc} threw "${e}", not the expected IdlHarnessError "${error}"`);
         }
+        return;
     }
+    throw new IdlHarnessError(`${idlArrayFunc} did not throw the expected IdlHarnessError`);
 }
 
 //@}
 IdlArray.prototype.test = function()
 //@{
 {
     /** Entry point.  See documentation at beginning of file. */