mirror of
https://github.com/tc39/test262.git
synced 2025-09-24 02:28:05 +02:00
Replace assertThrowsInstanceOf with assert.throws in sm/destructuring
This commit is contained in:
parent
2cf3004bab
commit
660d854ccf
@ -107,9 +107,9 @@ function test() {
|
||||
}
|
||||
};
|
||||
};
|
||||
assertThrowsInstanceOf(function() {
|
||||
assert.throws(TypeError, function() {
|
||||
var [] = iterable;
|
||||
}, TypeError);
|
||||
});
|
||||
assert.sameValue(returnCalled, ++returnCalledExpected);
|
||||
}
|
||||
|
||||
|
@ -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() {
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user