diff options
Diffstat (limited to 'test/built-ins/Object/defineProperty/15.2.3.6-4-297-1.js')
-rw-r--r-- | test/built-ins/Object/defineProperty/15.2.3.6-4-297-1.js | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-297-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-297-1.js index f5236683f..184c9a58c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-297-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-297-1.js @@ -13,37 +13,38 @@ description: > includes: [propertyHelper.js] ---*/ -(function (a, b, c) { - function getFunc1() { - return 10; - } +(function(a, b, c) { + function getFunc1() { + return 10; + } + Object.defineProperty(arguments, "0", { + get: getFunc1, + enumerable: false, + configurable: false + }); + + function getFunc2() { + return 20; + } + try { Object.defineProperty(arguments, "0", { - get: getFunc1, - enumerable: false, - configurable: false + get: getFunc2 }); - function getFunc2() { - return 20; + $ERROR("Expected an exception."); + } catch (e) { + if (a !== 0) { + $ERROR('Expected a === 0, actually ' + a); } - try { - Object.defineProperty(arguments, "0", { - get: getFunc2 - }); - $ERROR("Expected an exception."); - } catch (e) { - if (a !== 0) { - $ERROR('Expected a === 0, actually ' + a); - } - verifyEqualTo(arguments, "0", getFunc1()); + verifyEqualTo(arguments, "0", getFunc1()); - verifyNotEnumerable(arguments, "0"); + verifyNotEnumerable(arguments, "0"); - verifyNotConfigurable(arguments, "0"); - - if (!(e instanceof TypeError)) { - $ERROR("Expected TypeError, got " + e); - } + verifyNotConfigurable(arguments, "0"); + if (!(e instanceof TypeError)) { + $ERROR("Expected TypeError, got " + e); } + + } }(0, 1, 2)); |