diff options
Diffstat (limited to 'test/built-ins/Object/defineProperties/15.2.3.7-6-a-285.js')
-rw-r--r-- | test/built-ins/Object/defineProperties/15.2.3.7-6-a-285.js | 56 |
1 files changed, 31 insertions, 25 deletions
diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-285.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-285.js index 9b00b79ee..b386f92e0 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-285.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-285.js @@ -12,36 +12,42 @@ description: > 'O', test TypeError is thrown when updating the [[Configurable]] attribute value of 'P' which is defined as non-configurable (10.6 [[DefineOwnProperty]] step 4) -includes: - - runTestCase.js - - dataPropertyAttributesAreCorrect.js +includes: [propertyHelper.js] ---*/ -function testcase() { - var arg; +var arg; - (function fun(a, b, c) { - arg = arguments; - }(0, 1, 2)); +(function fun(a, b, c) { + arg = arguments; +}(0, 1, 2)); - Object.defineProperty(arg, "0", { - value: 0, - writable: false, - enumerable: false, - configurable: false - }); +Object.defineProperty(arg, "0", { + value: 0, + writable: false, + enumerable: false, + configurable: false +}); - try { - Object.defineProperties(arg, { - "0": { - configurable: true - } - }); - - return false; - } catch (e) { - return (e instanceof TypeError) && dataPropertyAttributesAreCorrect(arg, "0", 0, false, false, false); +try { + Object.defineProperties(arg, { + "0": { + configurable: true } + }); + + $ERROR("Expected an exception."); +} catch (e) { + verifyEqualTo(arg, "0", 0); + + verifyNotWritable(arg, "0"); + + verifyNotEnumerable(arg, "0"); + + verifyNotConfigurable(arg, "0"); + + if (!(e instanceof TypeError)) { + $ERROR("Expected TypeError, got " + e); } -runTestCase(testcase); + +} |