diff options
Diffstat (limited to 'test/built-ins/Object/defineProperties/15.2.3.7-6-a-170.js')
-rw-r--r-- | test/built-ins/Object/defineProperties/15.2.3.7-6-a-170.js | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-170.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-170.js index 78ed126d7..bb5450464 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-170.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-170.js @@ -9,14 +9,10 @@ description: > of the length property, test the [[Configurable]] attribute of own accessor property with large index named in 'O' can stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 1]; - - try { +assert.throws(TypeError, function() { Object.defineProperty(arr, "1", { get: function () { return 1; @@ -29,11 +25,8 @@ function testcase() { value: 1 } }); - - return false; - } catch (e) { - return (e instanceof TypeError) && arr.length === 2 && - arr.hasOwnProperty("1") && arr[0] === 0 && arr[1] === 1; - } - } -runTestCase(testcase); +}); +assert.sameValue(arr.length, 2, 'arr.length'); +assert(arr.hasOwnProperty("1"), 'arr.hasOwnProperty("1") !== true'); +assert.sameValue(arr[0], 0, 'arr[0]'); +assert.sameValue(arr[1], 1, 'arr[1]'); |