Last minute fixes

This commit is contained in:
Jordan Harband 2016-02-19 11:27:31 -08:00
parent 6f05b008dc
commit a6fad62d7c
2 changed files with 3 additions and 2 deletions

View File

@ -3,7 +3,7 @@ function allowProxyTraps(overrides) {
return function () { throw new Test262Error(msg); }; return function () { throw new Test262Error(msg); };
} }
if (!overrides) { overrides = {}; } if (!overrides) { overrides = {}; }
var traps = { return {
getPrototypeOf: overrides.getPrototypeOf || throwTest262Error('[[GetPrototypeOf]] trap called'), getPrototypeOf: overrides.getPrototypeOf || throwTest262Error('[[GetPrototypeOf]] trap called'),
setPrototypeOf: overrides.setPrototypeOf || throwTest262Error('[[SetPrototypeOf]] trap called'), setPrototypeOf: overrides.setPrototypeOf || throwTest262Error('[[SetPrototypeOf]] trap called'),
isExtensible: overrides.isExtensible || throwTest262Error('[[IsExtensible]] trap called'), isExtensible: overrides.isExtensible || throwTest262Error('[[IsExtensible]] trap called'),

View File

@ -35,8 +35,9 @@ function assertTrapSucceeds(trap) {
var threw = false; var threw = false;
try { try {
traps[trap](); traps[trap]();
} catch (e) {
threw = true; threw = true;
} catch (e) {} }
if (threw) { if (threw) {
throw new Test262Error('trap ' + trap + ' threw an error'); throw new Test262Error('trap ' + trap + ' threw an error');
} }