mirror of https://github.com/tc39/test262.git
Make proxy traps helper test a bit more robust.
Per https://github.com/tc39/test262/pull/484#discussion_r53228232
This commit is contained in:
parent
d530c87b41
commit
59dad9172b
|
@ -7,8 +7,7 @@ id: pending
|
|||
author: Jordan Harband
|
||||
includes: [proxyTrapsHelper.js]
|
||||
---*/
|
||||
|
||||
var traps = allowProxyTraps({
|
||||
var overrides = {
|
||||
getPrototypeOf: function () {},
|
||||
setPrototypeOf: function () {},
|
||||
isExtensible: function () {},
|
||||
|
@ -23,12 +22,16 @@ var traps = allowProxyTraps({
|
|||
ownKeys: function () {},
|
||||
apply: function () {},
|
||||
construct: function () {},
|
||||
});
|
||||
};
|
||||
var traps = allowProxyTraps(overrides);
|
||||
|
||||
function assertTrapSucceeds(trap) {
|
||||
if (typeof traps[trap] !== 'function') {
|
||||
throw new Test262Error('trap ' + trap + ' is not a function');
|
||||
}
|
||||
if (traps[trap] !== overrides[trap]) {
|
||||
throw new Test262Error('trap ' + trap + ' was not overriden in allowProxyTraps');
|
||||
}
|
||||
var threw = false;
|
||||
try {
|
||||
traps[trap]();
|
||||
|
|
Loading…
Reference in New Issue