diff --git a/test/staging/sm/destructuring/array-iterator-close.js b/test/staging/sm/destructuring/array-iterator-close.js index 168c601d19..f1183f40b9 100644 --- a/test/staging/sm/destructuring/array-iterator-close.js +++ b/test/staging/sm/destructuring/array-iterator-close.js @@ -107,9 +107,9 @@ function test() { } }; }; - assertThrowsInstanceOf(function() { + assert.throws(TypeError, function() { var [] = iterable; - }, TypeError); + }); assert.sameValue(returnCalled, ++returnCalledExpected); } diff --git a/test/staging/sm/destructuring/bug1396261.js b/test/staging/sm/destructuring/bug1396261.js index 12fdfa9056..8947051a37 100644 --- a/test/staging/sm/destructuring/bug1396261.js +++ b/test/staging/sm/destructuring/bug1396261.js @@ -30,10 +30,10 @@ esid: pending ({...[0].x} = {}); // Object literal with initializer shorthand in destructuring context. -assertThrowsInstanceOf(() => Function(`[{a = 0}.x] = [];`), SyntaxError); -assertThrowsInstanceOf(() => Function(`[...{a = 0}.x] = [];`), SyntaxError); -assertThrowsInstanceOf(() => Function(`({a: {b = 0}.x} = {});`), SyntaxError); -assertThrowsInstanceOf(() => Function(`({...{b = 0}.x} = {});`), SyntaxError); +assert.throws(SyntaxError, () => Function(`[{a = 0}.x] = [];`)); +assert.throws(SyntaxError, () => Function(`[...{a = 0}.x] = [];`)); +assert.throws(SyntaxError, () => Function(`({a: {b = 0}.x} = {});`)); +assert.throws(SyntaxError, () => Function(`({...{b = 0}.x} = {});`)); // Object destructuring with "eval" or "arguments" shorthand in strict mode. (function() { diff --git a/test/staging/sm/destructuring/constant-folding.js b/test/staging/sm/destructuring/constant-folding.js index 7ae9a2cc61..b19bca54b8 100644 --- a/test/staging/sm/destructuring/constant-folding.js +++ b/test/staging/sm/destructuring/constant-folding.js @@ -10,10 +10,10 @@ description: | esid: pending ---*/ function assertSyntaxError(code) { - assertThrowsInstanceOf(function () { Function(code); }, SyntaxError, "Function:" + code); - assertThrowsInstanceOf(function () { eval(code); }, SyntaxError, "eval:" + code); + assert.throws(SyntaxError, function () { Function(code); }, "Function:" + code); + assert.throws(SyntaxError, function () { eval(code); }, "eval:" + code); var ieval = eval; - assertThrowsInstanceOf(function () { ieval(code); }, SyntaxError, "indirect eval:" + code); + assert.throws(SyntaxError, function () { ieval(code); }, "indirect eval:" + code); } // |true && a| is constant-folded to |a|, ensure the destructuring assignment diff --git a/test/staging/sm/destructuring/iterator-primitive.js b/test/staging/sm/destructuring/iterator-primitive.js index 4e874cb02a..8cd696a15f 100644 --- a/test/staging/sm/destructuring/iterator-primitive.js +++ b/test/staging/sm/destructuring/iterator-primitive.js @@ -32,14 +32,14 @@ for (let primitive of primitives) { return primitive; } }; - assertThrowsInstanceOf(() => { + assert.throws(TypeError, () => { let [] = obj; - }, TypeError); - assertThrowsInstanceOf(() => { + }); + assert.throws(TypeError, () => { [] = obj; - }, TypeError); - assertThrowsInstanceOf(() => { + }); + assert.throws(TypeError, () => { f(obj); - }, TypeError); + }); }