Skip to content
Snippets Groups Projects
Commit 59dad917 authored by Jordan Harband's avatar Jordan Harband
Browse files

Make proxy traps helper test a bit more robust.

parent d530c87b
No related branches found
No related tags found
No related merge requests found
......@@ -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]();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment