diff options
Diffstat (limited to 'test/built-ins/Object/defineProperties/15.2.3.7-6-a-13.js')
-rw-r--r-- | test/built-ins/Object/defineProperties/15.2.3.7-6-a-13.js | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-13.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-13.js index 0310a6ef9..7025f2fdb 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-13.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-13.js @@ -9,29 +9,35 @@ es5id: 15.2.3.7-6-a-13 description: > Object.defineProperties - 'O' is an Array object which implements its own [[GetOwnProperty]] method to get 'P' (8.12.9 step 1 ) -includes: - - runTestCase.js - - dataPropertyAttributesAreCorrect.js +includes: [propertyHelper.js] ---*/ -function testcase() { - var arr = []; - - Object.defineProperty(arr, "prop", { - value: 11, - configurable: false - }); - - try { - Object.defineProperties(arr, { - prop: { - value: 12, - configurable: true - } - }); - return false; - } catch (e) { - return e instanceof TypeError && dataPropertyAttributesAreCorrect(arr, "prop", 11, false, false, false); +var arr = []; + +Object.defineProperty(arr, "prop", { + value: 11, + configurable: false +}); + +try { + Object.defineProperties(arr, { + prop: { + value: 12, + configurable: true } + }); + $ERROR("Expected an exception."); +} catch (e) { + verifyEqualTo(arr, "prop", 11); + + verifyNotWritable(arr, "prop"); + + verifyNotEnumerable(arr, "prop"); + + verifyNotConfigurable(arr, "prop"); + + if (!(e instanceof TypeError)) { + $ERROR("Expected TypeError, got " + e); } -runTestCase(testcase); + +} |