From 59dad9172bd130e560662fbd0bed5551afa4bfbb Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Wed, 17 Feb 2016 12:50:26 -0800 Subject: [PATCH] Make proxy traps helper test a bit more robust. Per https://github.com/tc39/test262/pull/484#discussion_r53228232 --- test/harness/proxytrapshelper-overrides.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/harness/proxytrapshelper-overrides.js b/test/harness/proxytrapshelper-overrides.js index 4d10d2a66f..4f902bb2e6 100644 --- a/test/harness/proxytrapshelper-overrides.js +++ b/test/harness/proxytrapshelper-overrides.js @@ -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]();