mirror of
https://github.com/tc39/test262.git
synced 2025-09-24 10:38:30 +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;
|
var [] = iterable;
|
||||||
}, TypeError);
|
});
|
||||||
assert.sameValue(returnCalled, ++returnCalledExpected);
|
assert.sameValue(returnCalled, ++returnCalledExpected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,10 +30,10 @@ esid: pending
|
|||||||
({...[0].x} = {});
|
({...[0].x} = {});
|
||||||
|
|
||||||
// Object literal with initializer shorthand in destructuring context.
|
// Object literal with initializer shorthand in destructuring context.
|
||||||
assertThrowsInstanceOf(() => Function(`[{a = 0}.x] = [];`), SyntaxError);
|
assert.throws(SyntaxError, () => Function(`[{a = 0}.x] = [];`));
|
||||||
assertThrowsInstanceOf(() => Function(`[...{a = 0}.x] = [];`), SyntaxError);
|
assert.throws(SyntaxError, () => Function(`[...{a = 0}.x] = [];`));
|
||||||
assertThrowsInstanceOf(() => Function(`({a: {b = 0}.x} = {});`), SyntaxError);
|
assert.throws(SyntaxError, () => Function(`({a: {b = 0}.x} = {});`));
|
||||||
assertThrowsInstanceOf(() => Function(`({...{b = 0}.x} = {});`), SyntaxError);
|
assert.throws(SyntaxError, () => Function(`({...{b = 0}.x} = {});`));
|
||||||
|
|
||||||
// Object destructuring with "eval" or "arguments" shorthand in strict mode.
|
// Object destructuring with "eval" or "arguments" shorthand in strict mode.
|
||||||
(function() {
|
(function() {
|
||||||
|
@ -10,10 +10,10 @@ description: |
|
|||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
function assertSyntaxError(code) {
|
function assertSyntaxError(code) {
|
||||||
assertThrowsInstanceOf(function () { Function(code); }, SyntaxError, "Function:" + code);
|
assert.throws(SyntaxError, function () { Function(code); }, "Function:" + code);
|
||||||
assertThrowsInstanceOf(function () { eval(code); }, SyntaxError, "eval:" + code);
|
assert.throws(SyntaxError, function () { eval(code); }, "eval:" + code);
|
||||||
var ieval = eval;
|
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
|
// |true && a| is constant-folded to |a|, ensure the destructuring assignment
|
||||||
|
@ -32,14 +32,14 @@ for (let primitive of primitives) {
|
|||||||
return primitive;
|
return primitive;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
assertThrowsInstanceOf(() => {
|
assert.throws(TypeError, () => {
|
||||||
let [] = obj;
|
let [] = obj;
|
||||||
}, TypeError);
|
});
|
||||||
assertThrowsInstanceOf(() => {
|
assert.throws(TypeError, () => {
|
||||||
[] = obj;
|
[] = obj;
|
||||||
}, TypeError);
|
});
|
||||||
assertThrowsInstanceOf(() => {
|
assert.throws(TypeError, () => {
|
||||||
f(obj);
|
f(obj);
|
||||||
}, TypeError);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user