diff options
author | Rick Waldron <waldron.rick@gmail.com> | 2015-09-04 15:20:26 -0400 |
---|---|---|
committer | Rick Waldron <waldron.rick@gmail.com> | 2015-09-04 15:20:26 -0400 |
commit | 9ccc6639360ea28161d9eb97b40a99ef846ee2bc (patch) | |
tree | de119d7c5ff1be969514de26178166a389f50e6e /test/built-ins/Object | |
parent | 2bfe4a47166ef9bb32d65d12e5115965a9378b16 (diff) | |
parent | bd603294cb6d09905a51dc398271f985665d83ca (diff) | |
download | qtdeclarative-testsuites-9ccc6639360ea28161d9eb97b40a99ef846ee2bc.tar.gz |
Merge pull request #415 from anba/remove-runTestCase-finally
Replace runTestCase when used with try-finally
Diffstat (limited to 'test/built-ins/Object')
215 files changed, 599 insertions, 2153 deletions
diff --git a/test/built-ins/Object/create/15.2.3.5-4-10.js b/test/built-ins/Object/create/15.2.3.5-4-10.js index 144db6c9b..b62c3b3c4 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-10.js +++ b/test/built-ins/Object/create/15.2.3.5-4-10.js @@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-10 description: > Object.create - argument 'Properties' is the Math object (15.2.3.7 step 2) -includes: [runTestCase.js] ---*/ -function testcase() { - var result = false; Object.defineProperty(Math, "prop", { get: function () { @@ -21,11 +18,7 @@ function testcase() { configurable: true }); - try { var newObj = Object.create({}, Math); - return result && newObj.hasOwnProperty("prop"); - } finally { - delete Math.prop; - } - } -runTestCase(testcase); + +assert(result, 'result !== true'); +assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-117.js b/test/built-ins/Object/create/15.2.3.5-4-117.js index 346af06db..0def02aaa 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-117.js +++ b/test/built-ins/Object/create/15.2.3.5-4-117.js @@ -7,12 +7,8 @@ description: > Object.create - one property in 'Properties' is the Math object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Math.configurable = true; var newObj = Object.create({}, { @@ -23,9 +19,5 @@ function testcase() { delete newObj.prop; var result2 = newObj.hasOwnProperty("prop"); - return result1 === true && result2 === false; - } finally { - delete Math.configurable; - } - } -runTestCase(testcase); +assert.sameValue(result1, true, 'result1'); +assert.sameValue(result2, false, 'result2'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-120.js b/test/built-ins/Object/create/15.2.3.5-4-120.js index d561bb5d0..0ca99d135 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-120.js +++ b/test/built-ins/Object/create/15.2.3.5-4-120.js @@ -7,12 +7,8 @@ description: > Object.create - one property in 'Properties' is the JSON object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { JSON.configurable = true; var newObj = Object.create({}, { @@ -23,9 +19,5 @@ function testcase() { delete newObj.prop; var result2 = newObj.hasOwnProperty("prop"); - return result1 === true && result2 === false; - } finally { - delete JSON.configurable; - } - } -runTestCase(testcase); +assert.sameValue(result1, true, 'result1'); +assert.sameValue(result2, false, 'result2'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-124.js b/test/built-ins/Object/create/15.2.3.5-4-124.js index e380ba737..d22aee94f 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-124.js +++ b/test/built-ins/Object/create/15.2.3.5-4-124.js @@ -7,14 +7,9 @@ description: > Object.create - one property in 'Properties' is the global object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - - try { fnGlobalObject().configurable = true; var newObj = Object.create({}, { @@ -25,9 +20,5 @@ function testcase() { delete newObj.prop; var result2 = newObj.hasOwnProperty("prop"); - return result1 === true && result2 === false; - } finally { - delete fnGlobalObject().configurable; - } - } -runTestCase(testcase); +assert.sameValue(result1, true, 'result1'); +assert.sameValue(result2, false, 'result2'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-13.js b/test/built-ins/Object/create/15.2.3.5-4-13.js index 6aeabdb62..582f529fd 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-13.js +++ b/test/built-ins/Object/create/15.2.3.5-4-13.js @@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-13 description: > Object.create - argument 'Properties' is the JSON object (15.2.3.7 step 2) -includes: [runTestCase.js] ---*/ -function testcase() { - var result = false; Object.defineProperty(JSON, "prop", { @@ -22,11 +19,7 @@ function testcase() { configurable: true }); - try { var newObj = Object.create({}, JSON); - return result && newObj.hasOwnProperty("prop"); - } finally { - delete JSON.prop; - } - } -runTestCase(testcase); + +assert(result, 'result !== true'); +assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-170.js b/test/built-ins/Object/create/15.2.3.5-4-170.js index 02d511b2f..b3c650792 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-170.js +++ b/test/built-ins/Object/create/15.2.3.5-4-170.js @@ -7,21 +7,12 @@ description: > Object.create - one property in 'Properties' is the Math object that uses Object's [[Get]] method to access the 'value' property (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Math.value = "MathValue"; var newObj = Object.create({}, { prop: Math }); - return newObj.prop === "MathValue"; - } finally { - delete Math.value; - } - } -runTestCase(testcase); +assert.sameValue(newObj.prop, "MathValue", 'newObj.prop'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-173.js b/test/built-ins/Object/create/15.2.3.5-4-173.js index eeb9d7d78..01a704169 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-173.js +++ b/test/built-ins/Object/create/15.2.3.5-4-173.js @@ -7,21 +7,12 @@ description: > Object.create - one property in 'Properties' is the JSON object that uses Object's [[Get]] method to access the 'value' property (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { JSON.value = "JSONValue"; var newObj = Object.create({}, { prop: JSON }); - return newObj.prop === "JSONValue"; - } finally { - delete JSON.value; - } - } -runTestCase(testcase); +assert.sameValue(newObj.prop, "JSONValue", 'newObj.prop'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-177.js b/test/built-ins/Object/create/15.2.3.5-4-177.js index 4fad22f25..d9e835efb 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-177.js +++ b/test/built-ins/Object/create/15.2.3.5-4-177.js @@ -7,23 +7,13 @@ description: > Object.create - one property in 'Properties' is the global object that uses Object's [[Get]] method to access the 'value' property (8.10.5 step 5.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - - try { fnGlobalObject().value = "GlobalValue"; var newObj = Object.create({}, { prop: fnGlobalObject() }); - return newObj.prop === "GlobalValue"; - } finally { - delete fnGlobalObject().value; - } - } -runTestCase(testcase); +assert.sameValue(newObj.prop, "GlobalValue", 'newObj.prop'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-196.js b/test/built-ins/Object/create/15.2.3.5-4-196.js index 6a254ac59..4a10a2d35 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-196.js +++ b/test/built-ins/Object/create/15.2.3.5-4-196.js @@ -7,12 +7,8 @@ description: > Object.create - one property in 'Properties' is the Math object that uses Object's [[Get]] method to access the 'writable' property (8.10.5 step 6.a) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Math.writable = true; var newObj = Object.create({}, { @@ -25,9 +21,5 @@ function testcase() { var afterWrite = (newObj.prop === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete Math.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-199.js b/test/built-ins/Object/create/15.2.3.5-4-199.js index 77afd18ae..b0d111992 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-199.js +++ b/test/built-ins/Object/create/15.2.3.5-4-199.js @@ -7,12 +7,8 @@ description: > Object.create - one property in 'Properties' is the JSON object that uses Object's [[Get]] method to access the 'writable' property (8.10.5 step 6.a) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { JSON.writable = true; var newObj = Object.create({}, { @@ -25,9 +21,5 @@ function testcase() { var afterWrite = (newObj.prop === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete JSON.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-203.js b/test/built-ins/Object/create/15.2.3.5-4-203.js index 99dfdc7b7..013ecb214 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-203.js +++ b/test/built-ins/Object/create/15.2.3.5-4-203.js @@ -7,14 +7,9 @@ description: > Object.create - one property in 'Properties' is the global object that uses Object's [[Get]] method to access the 'writable' property (8.10.5 step 6.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - - try { fnGlobalObject().writable = true; var newObj = Object.create({}, { @@ -27,9 +22,5 @@ function testcase() { var afterWrite = (newObj.prop === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete fnGlobalObject().writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-251.js b/test/built-ins/Object/create/15.2.3.5-4-251.js index 0e151bc1a..eceff600f 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-251.js +++ b/test/built-ins/Object/create/15.2.3.5-4-251.js @@ -7,11 +7,8 @@ description: > Object.create - one property in 'Properties' is the Math object that uses Object's [[Get]] method to access the 'get' property (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Math.get = function () { return "VerifyMathObject"; }; @@ -20,9 +17,4 @@ function testcase() { prop: Math }); - return newObj.prop === "VerifyMathObject"; - } finally { - delete Math.get; - } - } -runTestCase(testcase); +assert.sameValue(newObj.prop, "VerifyMathObject", 'newObj.prop'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-252.js b/test/built-ins/Object/create/15.2.3.5-4-252.js index a83e2bd45..e5cd76b90 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-252.js +++ b/test/built-ins/Object/create/15.2.3.5-4-252.js @@ -7,22 +7,14 @@ description: > Object.create - one property in 'Properties' is the JSON object that uses Object's [[Get]] method to access the 'get' property (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { JSON.get = function () { return "VerifyJSONObject"; }; - try { var newObj = Object.create({}, { prop: JSON }); - return newObj.prop === "VerifyJSONObject"; - } finally { - delete JSON.get; - } - } -runTestCase(testcase); +assert.sameValue(newObj.prop, "VerifyJSONObject", 'newObj.prop'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-256.js b/test/built-ins/Object/create/15.2.3.5-4-256.js index 1d7146537..6f35538fe 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-256.js +++ b/test/built-ins/Object/create/15.2.3.5-4-256.js @@ -7,24 +7,15 @@ description: > Object.create - one property in 'Properties' is the global object that uses Object's [[Get]] method to access the 'get' property (8.10.5 step 7.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { fnGlobalObject().get = function () { return "VerifyGlobalObject"; }; - try { var newObj = Object.create({}, { prop: fnGlobalObject() }); - return newObj.prop === "VerifyGlobalObject"; - } finally { - delete fnGlobalObject().get; - } - } -runTestCase(testcase); +assert.sameValue(newObj.prop, "VerifyGlobalObject", 'newObj.prop'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-284.js b/test/built-ins/Object/create/15.2.3.5-4-284.js index 53769b792..58777acf2 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-284.js +++ b/test/built-ins/Object/create/15.2.3.5-4-284.js @@ -7,13 +7,10 @@ description: > Object.create - one property in 'Properties' is the Math object that uses Object's [[Get]] method to access the 'set' property (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var data = "data"; - try { Math.set = function (value) { data = value; }; @@ -26,9 +23,5 @@ function testcase() { newObj.prop = "overrideData"; - return hasProperty && data === "overrideData"; - } finally { - delete Math.set; - } - } -runTestCase(testcase); +assert(hasProperty, 'hasProperty !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-287.js b/test/built-ins/Object/create/15.2.3.5-4-287.js index baa187b60..6057e68fb 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-287.js +++ b/test/built-ins/Object/create/15.2.3.5-4-287.js @@ -7,13 +7,10 @@ description: > Object.create - one property in 'Properties' is the JSON object that uses Object's [[Get]] method to access the 'set' property (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var data = "data"; - try { JSON.set = function (value) { data = value; }; @@ -26,9 +23,5 @@ function testcase() { newObj.prop = "overrideData"; - return hasProperty && data === "overrideData"; - } finally { - delete JSON.set; - } - } -runTestCase(testcase); +assert(hasProperty, 'hasProperty !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-291.js b/test/built-ins/Object/create/15.2.3.5-4-291.js index 4ffc2d5d3..b5d8d69e6 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-291.js +++ b/test/built-ins/Object/create/15.2.3.5-4-291.js @@ -7,15 +7,11 @@ description: > Object.create - one property in 'Properties' is the global object that uses Object's [[Get]] method to access the 'set' property (8.10.5 step 8.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var data = "data"; - try { fnGlobalObject().set = function (value) { data = value; }; @@ -28,9 +24,5 @@ function testcase() { newObj.prop = "overrideData"; - return hasProperty && data === "overrideData"; - } finally { - delete fnGlobalObject().set; - } - } -runTestCase(testcase); +assert(hasProperty, 'hasProperty !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-33.js b/test/built-ins/Object/create/15.2.3.5-4-33.js index 66d7d0feb..28684d926 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-33.js +++ b/test/built-ins/Object/create/15.2.3.5-4-33.js @@ -7,20 +7,12 @@ description: > Object.create - 'Properties' is the Math object that uses Object's [[Get]] method to access own enumerable property (15.2.3.7 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Math.prop = { value: 12, enumerable: true }; var newObj = Object.create({}, Math); - return newObj.hasOwnProperty("prop"); - } finally { - delete Math.prop; - } - } -runTestCase(testcase); + +assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-36.js b/test/built-ins/Object/create/15.2.3.5-4-36.js index 09a48c2ef..f11823460 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-36.js +++ b/test/built-ins/Object/create/15.2.3.5-4-36.js @@ -7,20 +7,12 @@ description: > Object.create - 'Properties' is the JSON object that uses Object's [[Get]] method to access own enumerable property (15.2.3.7 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { JSON.prop = { value: 12, enumerable: true }; var newObj = Object.create({}, JSON); - return newObj.hasOwnProperty("prop"); - } finally { - delete JSON.prop; - } - } -runTestCase(testcase); + +assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-64.js b/test/built-ins/Object/create/15.2.3.5-4-64.js index 084b73b37..dcb8a6f23 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-64.js +++ b/test/built-ins/Object/create/15.2.3.5-4-64.js @@ -7,14 +7,10 @@ description: > Object.create - one property in 'Properties' is the Math object that uses Object's [[Get]] method to access the 'enumerable' property (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; - try { Math.enumerable = true; var newObj = Object.create({}, { @@ -25,9 +21,5 @@ function testcase() { accessed = true; } } - return accessed; - } finally { - delete Math.enumerable; - } - } -runTestCase(testcase); + +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-67.js b/test/built-ins/Object/create/15.2.3.5-4-67.js index ba562de19..c9daddf94 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-67.js +++ b/test/built-ins/Object/create/15.2.3.5-4-67.js @@ -7,14 +7,10 @@ description: > Object.create - one property in 'Properties' is the JSON object that uses Object's [[Get]] method to access the 'enumerable' property (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; - try { JSON.enumerable = true; var newObj = Object.create({}, { @@ -25,9 +21,5 @@ function testcase() { accessed = true; } } - return accessed; - } finally { - delete JSON.enumerable; - } - } -runTestCase(testcase); + +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-71.js b/test/built-ins/Object/create/15.2.3.5-4-71.js index c95e3f3c4..9d7dc1fcc 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-71.js +++ b/test/built-ins/Object/create/15.2.3.5-4-71.js @@ -7,16 +7,11 @@ description: > Object.create - one property in 'Properties' is the global object that uses Object's [[Get]] method to access the 'enumerable' property (8.10.5 step 3.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var accessed = false; - try { fnGlobalObject().enumerable = true; var newObj = Object.create({}, { @@ -27,9 +22,5 @@ function testcase() { accessed = true; } } - return accessed; - } finally { - delete fnGlobalObject().enumerable; - } - } -runTestCase(testcase); + +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-2-11.js b/test/built-ins/Object/defineProperties/15.2.3.7-2-11.js index f80dde265..49e5f4208 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-2-11.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-2-11.js @@ -4,15 +4,11 @@ /*--- es5id: 15.2.3.7-2-11 description: Object.defineProperties - argument 'Properties' is the Math object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; var result = false; - - try { + Object.defineProperty(Math, "prop", { get: function () { result = (this === Math); @@ -23,9 +19,5 @@ function testcase() { }); Object.defineProperties(obj, Math); - return result; - } finally { - delete Math.prop; - } - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-2-14.js b/test/built-ins/Object/defineProperties/15.2.3.7-2-14.js index bb72313cf..4cb5a056a 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-2-14.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-2-14.js @@ -4,15 +4,11 @@ /*--- es5id: 15.2.3.7-2-14 description: Object.defineProperties - argument 'Properties' is the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; var result = false; - try { Object.defineProperty(JSON, "prop", { get: function () { result = (this === JSON); @@ -23,9 +19,5 @@ function testcase() { }); Object.defineProperties(obj, JSON); - return result; - } finally { - delete JSON.prop; - } - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-2-18.js b/test/built-ins/Object/defineProperties/15.2.3.7-2-18.js index afd10e3f1..54d63f93e 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-2-18.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-2-18.js @@ -6,13 +6,9 @@ es5id: 15.2.3.7-2-18 description: > Object.defineProperties - argument 'Properties' is the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var obj = {}; var result = false; @@ -27,11 +23,11 @@ function testcase() { }); Object.defineProperties(obj, fnGlobalObject()); - return result; } catch (e) { - return (e instanceof TypeError); + if (!(e instanceof TypeError)) throw e; + result = true; } finally { delete fnGlobalObject().prop; } - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-a-12.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-a-12.js index 22d61ff94..f13acf2b5 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-a-12.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-a-12.js @@ -6,22 +6,14 @@ es5id: 15.2.3.7-5-a-12 description: > Object.defineProperties - 'Properties' is the Math object which implements its own [[Get]] method to get enumerable own property -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; - try { Math.prop = { value: 12 }; Object.defineProperties(obj, Math); - return obj.hasOwnProperty("prop") && obj.prop === 12; - } finally { - delete Math.prop; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true'); +assert.sameValue(obj.prop, 12, 'obj.prop'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-a-15.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-a-15.js index 910a260ec..07dc678c4 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-a-15.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-a-15.js @@ -6,21 +6,14 @@ es5id: 15.2.3.7-5-a-15 description: > Object.defineProperties - 'Properties' is the JSON object which implements its own [[Get]] method to get enumerable own property -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { JSON.prop = { value: 15 }; Object.defineProperties(obj, JSON); - return obj.hasOwnProperty("prop") && obj.prop === 15; - } finally { - delete JSON.prop; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true'); +assert.sameValue(obj.prop, 15, 'obj.prop'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-130.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-130.js index 93b8a9561..75eb5a7de 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-130.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-130.js @@ -7,22 +7,14 @@ description: > Object.defineProperties - 'descObj' is the Math object which implements its own [[Get]] method to get 'value' property (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Math.value = "Math"; Object.defineProperties(obj, { property: Math }); - return obj.property === "Math"; - } finally { - delete Math.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "Math", 'obj.property'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-133.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-133.js index 809669eb3..75d124af0 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-133.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-133.js @@ -7,22 +7,14 @@ description: > Object.defineProperties - 'descObj' is the JSON object which implements its own [[Get]] method to get 'value' property (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { JSON.value = "JSON"; Object.defineProperties(obj, { property: JSON }); - return obj.property === "JSON"; - } finally { - delete JSON.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "JSON", 'obj.property'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-137.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-137.js index a48e632b2..00afd773f 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-137.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-137.js @@ -7,24 +7,15 @@ description: > Object.defineProperties - 'descObj' is the global object which implements its own [[Get]] method to get 'value' property (8.10.5 step 5.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var obj = {}; - try { fnGlobalObject().value = "global"; Object.defineProperties(obj, { property: fnGlobalObject() }); - return obj.property === "global"; - } finally { - delete fnGlobalObject().value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "global", 'obj.property'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-156.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-156.js index 107e823c3..c578ae4f7 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-156.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-156.js @@ -13,7 +13,6 @@ includes: [propertyHelper.js] var obj = {}; -try { Math.writable = false; Object.defineProperties(obj, { @@ -22,7 +21,3 @@ try { assert(obj.hasOwnProperty("property")); verifyNotWritable(obj, "property"); - -} finally { - delete Math.writable; -} diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-159.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-159.js index c7d08c0a2..9bd06f4ef 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-159.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-159.js @@ -12,7 +12,6 @@ includes: [propertyHelper.js] var obj = {}; -try { JSON.writable = false; Object.defineProperties(obj, { @@ -21,8 +20,3 @@ try { assert(obj.hasOwnProperty("property")); verifyNotWritable(obj, "property"); - -} finally { - delete JSON.writable; -} - diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-163.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-163.js index 9806652a9..c508455ca 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-163.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-163.js @@ -15,7 +15,6 @@ includes: var obj = {}; -try { fnGlobalObject().writable = false; Object.defineProperties(obj, { @@ -24,9 +23,3 @@ try { assert(obj.hasOwnProperty("property")); verifyNotWritable(obj, "property"); - -} finally { - delete fnGlobalObject().writable; -} - - diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-209.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-209.js index 1cd1a9b68..a4dec6de0 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-209.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-209.js @@ -7,14 +7,10 @@ description: > Object.defineProperties - 'descObj' is the Math object which implements its own [[Get]] method to get 'get' property (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; - try { Math.get = function () { return "Math"; }; @@ -23,9 +19,4 @@ function testcase() { property: Math }); - return obj.property === "Math"; - } finally { - delete Math.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "Math", 'obj.property'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-212.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-212.js index 12cb398e1..75f7d4a49 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-212.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-212.js @@ -7,14 +7,10 @@ description: > Object.defineProperties - 'descObj' is the JSON object which implements its own [[Get]] method to get 'get' property (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; - try { JSON.get = function () { return "JSON"; }; @@ -23,9 +19,4 @@ function testcase() { property: JSON }); - return obj.property === "JSON"; - } finally { - delete JSON.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "JSON", 'obj.property'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-216.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-216.js index eb919238e..c68a95226 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-216.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-216.js @@ -7,16 +7,11 @@ description: > Object.defineProperties - 'descObj' is the global object which implements its own [[Get]] method to get 'get' property (8.10.5 step 7.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var obj = {}; - try { fnGlobalObject().get = function () { return "global"; }; @@ -25,9 +20,4 @@ function testcase() { property: fnGlobalObject() }); - return obj.property === "global"; - } finally { - delete fnGlobalObject().get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "global", 'obj.property'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-24.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-24.js index fd15eac75..bab103cc6 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-24.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-24.js @@ -7,15 +7,11 @@ description: > Object.defineProperties - 'descObj' is the Math object which implements its own [[Get]] method to get 'enumerable' property (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; var accessed = false; - try { Math.enumerable = true; Object.defineProperties(obj, { @@ -26,9 +22,5 @@ function testcase() { accessed = true; } } - return accessed; - } finally { - delete Math.enumerable; - } - } -runTestCase(testcase); + +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-244.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-244.js index e002547ee..5324d0334 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-244.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-244.js @@ -7,16 +7,13 @@ description: > Object.defineProperties - 'descObj' is the Math object which implements its own [[Get]] method to get 'set' property (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var data = "data"; var setFun = function (value) { data = value; }; - try { + Math.prop = { set: setFun }; @@ -24,9 +21,6 @@ function testcase() { var obj = {}; Object.defineProperties(obj, Math); obj.prop = "mathData"; - return obj.hasOwnProperty("prop") && data === "mathData"; - } finally { - delete Math.prop; - } - } -runTestCase(testcase); + +assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true'); +assert.sameValue(data, "mathData", 'data'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-247.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-247.js index b43663fa1..c0815c7b0 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-247.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-247.js @@ -7,16 +7,13 @@ description: > Object.defineProperties - 'descObj' is the JSON object which implements its own [[Get]] method to get 'set' property (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var data = "data"; var setFun = function (value) { data = value; }; - try { + JSON.prop = { set: setFun }; @@ -24,9 +21,6 @@ function testcase() { var obj = {}; Object.defineProperties(obj, JSON); obj.prop = "JSONData"; - return obj.hasOwnProperty("prop") && data === "JSONData"; - } finally { - delete JSON.prop; - } - } -runTestCase(testcase); + +assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true'); +assert.sameValue(data, "JSONData", 'data'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-27.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-27.js index 7c99c4277..900b3b090 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-27.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-27.js @@ -7,15 +7,11 @@ description: > Object.defineProperties - 'descObj' is the JSON object which implements its own [[Get]] method to get 'enumerable' property (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; var accessed = false; - try { JSON.enumerable = true; Object.defineProperties(obj, { @@ -26,9 +22,5 @@ function testcase() { accessed = true; } } - return accessed; - } finally { - delete JSON.enumerable; - } - } -runTestCase(testcase); + +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-31.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-31.js index bead27b7f..7c1a48bc1 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-31.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-31.js @@ -7,17 +7,12 @@ description: > Object.defineProperties - 'descObj' is the global object which implements its own [[Get]] method to get 'enumerable' property (8.10.5 step 3.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var obj = {}; var accessed = false; - try { fnGlobalObject().enumerable = true; Object.defineProperties(obj, { @@ -28,9 +23,5 @@ function testcase() { accessed = true; } } - return accessed; - } finally { - delete fnGlobalObject().enumerable; - } - } -runTestCase(testcase); + +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-77.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-77.js index f3794aa35..44f498425 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-77.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-77.js @@ -7,14 +7,10 @@ description: > Object.defineProperties - 'descObj' is the Math object which implements its own [[Get]] method to get 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; - try { Math.configurable = true; Object.defineProperties(obj, { @@ -25,9 +21,5 @@ function testcase() { delete obj.prop; var result2 = obj.hasOwnProperty("prop"); - return result1 === true && result2 === false; - } finally { - delete Math.configurable; - } - } -runTestCase(testcase); +assert.sameValue(result1, true, 'result1'); +assert.sameValue(result2, false, 'result2'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-80.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-80.js index a37654d68..99ab9c525 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-80.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-80.js @@ -7,14 +7,10 @@ description: > Object.defineProperties - 'descObj' is the JSON object which implements its own [[Get]] method to get 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; - try { JSON.configurable = true; Object.defineProperties(obj, { @@ -25,9 +21,5 @@ function testcase() { delete obj.prop; var result2 = obj.hasOwnProperty("prop"); - return result1 === true && result2 === false; - } finally { - delete JSON.configurable; - } - } -runTestCase(testcase); +assert.sameValue(result1, true, 'result1'); +assert.sameValue(result2, false, 'result2'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-84.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-84.js index ceafc60be..e0babbe9d 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-84.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-84.js @@ -7,16 +7,11 @@ description: > Object.defineProperties - 'descObj' is the global object which implements its own [[Get]] method to get 'configurable' property (8.10.5 step 4.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var obj = {}; - try { fnGlobalObject().configurable = true; Object.defineProperties(obj, { @@ -27,9 +22,5 @@ function testcase() { delete obj.prop; var result2 = obj.hasOwnProperty("prop"); - return result1 === true && result2 === false; - } finally { - delete fnGlobalObject().configurable; - } - } -runTestCase(testcase); +assert.sameValue(result1, true, 'result1'); +assert.sameValue(result2, false, 'result2'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-113.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-113.js index bad68510e..e9286e341 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-113.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-113.js @@ -7,14 +7,12 @@ description: > Object.defineProperties - 'O' is an Array, test the length property of 'O' is own data property that overrides an inherited data property (15.4.5.1 step 1) -includes: [runTestCase.js] ---*/ -function testcase() { - var arrProtoLen; var arr = [0, 1, 2]; - try { + +assert.throws(TypeError, function() { arrProtoLen = Array.prototype.length; Array.prototype.length = 0; @@ -25,14 +23,10 @@ function testcase() { Object.defineProperties(arr, { length: { value: 1 } }); - return false; - } catch (e) { - var desc = Object.getOwnPropertyDescriptor(arr, "length"); +}); - return e instanceof TypeError && desc.value === 3 && - desc.writable && !desc.enumerable && !desc.configurable; - } finally { - Array.prototype.length = arrProtoLen; - } - } -runTestCase(testcase); +var desc = Object.getOwnPropertyDescriptor(arr, "length"); +assert.sameValue(desc.value, 3, 'desc.value'); +assert(desc.writable, 'desc.writable !== true'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); +assert.sameValue(desc.configurable, false, 'desc.configurable'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-167.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-167.js index b92b05178..ac2bf4417 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-167.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-167.js @@ -9,13 +9,10 @@ description: > of the length property, test the [[Configurable]] attribute of inherited data property with large index named in 'O' can't stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 1]; - try { + Array.prototype[1] = 2; //we are not allowed to set the [[Configurable]] attribute of property "1" to false here, since Array.prototype is a global object, and non-configurbale property can't revert to configurable Object.defineProperties(arr, { @@ -24,9 +21,7 @@ function testcase() { } }); - return arr.length === 1 && !arr.hasOwnProperty("1") && arr[0] === 0 && Array.prototype[1] === 2; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(arr.length, 1, 'arr.length'); +assert.sameValue(arr.hasOwnProperty("1"), false, 'arr.hasOwnProperty("1")'); +assert.sameValue(arr[0], 0, 'arr[0]'); +assert.sameValue(Array.prototype[1], 2, 'Array.prototype[1]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-168.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-168.js index 98fb79d5b..c93f4a78e 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-168.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-168.js @@ -10,13 +10,11 @@ description: > own data property with large index named in 'O' that overrides inherited data property 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", { configurable: false }); @@ -28,12 +26,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; - } finally { - delete Array.prototype[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]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-169.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-169.js index 0f956d96d..0b72ac3d6 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-169.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-169.js @@ -10,13 +10,11 @@ description: > own data property with large index named in 'O' that overrides inherited accessor property 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", { configurable: false }); @@ -33,13 +31,9 @@ function testcase() { value: 1 } }); - - return false; - } catch (e) { - return e instanceof TypeError && arr.length === 2 && arr.hasOwnProperty("1") && - arr[0] === 0 && arr[1] === 1 && Array.prototype[1] === 2; - } finally { - delete Array.prototype[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]'); +assert.sameValue(Array.prototype[1], 2, 'Array.prototype[1]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-17.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-17.js index c50f5a999..43bc0511b 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-17.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-17.js @@ -6,12 +6,8 @@ es5id: 15.2.3.7-6-a-17 description: > Object.defineProperties - 'O' is the Math object which implements its own [[GetOwnProperty]] method to get 'P' (8.12.9 step 1 ) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.defineProperty(Math, "prop", { value: 11, writable: true, @@ -24,9 +20,6 @@ function testcase() { value: 12 } }); - return hasProperty && Math.prop === 12; - } finally { - delete Math.prop; - } - } -runTestCase(testcase); + +assert(hasProperty, 'hasProperty !== true'); +assert.sameValue(Math.prop, 12, 'Math.prop'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-171.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-171.js index f18a60dc6..ca3db2cb9 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-171.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-171.js @@ -9,13 +9,10 @@ description: > of the length property, test the [[Configurable]] attribute of inherited accessor property with large index named in 'O' can't stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 1]; - try { + Object.defineProperty(Array.prototype, "1", { get: function () { return 1; @@ -29,9 +26,7 @@ function testcase() { } }); - return arr.length === 1 && !arr.hasOwnProperty("1") && arr[0] === 0 && Array.prototype[1] === 1; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(arr.length, 1, 'arr.length'); +assert.sameValue(arr.hasOwnProperty("1"), false, 'arr.hasOwnProperty("1")'); +assert.sameValue(arr[0], 0, 'arr[0]'); +assert.sameValue(Array.prototype[1], 1, 'Array.prototype[1]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-172.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-172.js index cc9e90c15..938699559 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-172.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-172.js @@ -10,13 +10,11 @@ description: > own accessor property with large index named in 'O' that overrides inherited data property 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 2; @@ -31,12 +29,8 @@ function testcase() { value: 1 } }); - return false; - } catch (e) { - return e instanceof TypeError && arr.length === 2 && - arr.hasOwnProperty("1") && arr[0] === 0 && arr[1] === 2; - } finally { - delete Array.prototype[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], 2, 'arr[1]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-173.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-173.js index 84fba667a..0664450db 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-173.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-173.js @@ -10,13 +10,11 @@ description: > own accessor property with large index named in 'O' that overrides inherited accessor property 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; @@ -36,12 +34,9 @@ function testcase() { value: 1 } }); - return false; - } catch (e) { - return e instanceof TypeError && arr.length === 2 && arr.hasOwnProperty("1") && - arr[0] === 0 && arr[1] === 1 && Array.prototype[1] === 2; - } finally { - delete Array.prototype[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]'); +assert.sameValue(Array.prototype[1], 2, 'Array.prototype[1]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-187.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-187.js index 565775b9a..239da3b32 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-187.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-187.js @@ -6,11 +6,8 @@ es5id: 15.2.3.7-6-a-187 description: > Object.defineProperties - 'O' is an Array, 'P' is an array index named property, 'P' is inherited data property (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { value: 11, configurable: true @@ -23,9 +20,7 @@ function testcase() { configurable: false } }); - return arr.hasOwnProperty("0") && typeof arr[0] === "undefined" && Array.prototype[0] === 11; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert(arr.hasOwnProperty("0"), 'arr.hasOwnProperty("0") !== true'); +assert.sameValue(typeof arr[0], "undefined", 'typeof arr[0]'); +assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-188.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-188.js index 604d12717..a5895c270 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-188.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-188.js @@ -7,17 +7,16 @@ description: > Object.defineProperties - 'O' is an Array, 'P' is an array index named property, 'P' is own data property that overrides an inherited data property (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { - try { +var arr = []; + +assert.throws(TypeError, function() { Object.defineProperty(Array.prototype, "0", { value: 11, configurable: true }); - var arr = []; Object.defineProperty(arr, "0", { value: 12, configurable: false @@ -28,11 +27,6 @@ function testcase() { configurable: true } }); - return false; - } catch (e) { - return e instanceof TypeError && arr[0] === 12 && Array.prototype[0] === 11; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +}); +assert.sameValue(arr[0], 12, 'arr[0]'); +assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-189.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-189.js index 4828ac6a6..43dcd4991 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-189.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-189.js @@ -7,11 +7,11 @@ description: > Object.defineProperties - 'O' is an Array, 'P' is an array index named property, 'P' is own data property that overrides an inherited accessor property (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { - try { +var arr = []; + +assert.throws(TypeError, function() { Object.defineProperty(Array.prototype, "0", { get: function () { return 11; @@ -19,7 +19,6 @@ function testcase() { configurable: true }); - var arr = []; Object.defineProperty(arr, "0", { value: 12, configurable: false @@ -30,11 +29,6 @@ function testcase() { configurable: true } }); - return false; - } catch (e) { - return e instanceof TypeError && arr[0] === 12 && Array.prototype[0] === 11; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +}); +assert.sameValue(arr[0], 12, 'arr[0]'); +assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-191.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-191.js index 7a43741be..c074029e5 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-191.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-191.js @@ -6,11 +6,8 @@ es5id: 15.2.3.7-6-a-191 description: > Object.defineProperties - 'O' is an Array, 'P' is an array index property, 'P' is inherited accessor property (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 11; @@ -28,9 +25,7 @@ function testcase() { configurable: false } }); - return arr.hasOwnProperty("0") && arr[0] === 12 && Array.prototype[0] === 11; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert(arr.hasOwnProperty("0"), 'arr.hasOwnProperty("0") !== true'); +assert.sameValue(arr[0], 12, 'arr[0]'); +assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-192.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-192.js index 38fdf6243..5c064cd64 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-192.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-192.js @@ -7,17 +7,16 @@ description: > Object.defineProperties - 'O' is an Array, 'P' is an array index named property, 'P' is own accessor property that overrides an inherited data property (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { - try { +var arr = []; + +assert.throws(TypeError, function() { Object.defineProperty(Array.prototype, "0", { value: 11, configurable: true }); - var arr = []; Object.defineProperty(arr, "0", { get: function () { return 12; @@ -30,11 +29,6 @@ function testcase() { configurable: true } }); - return false; - } catch (e) { - return e instanceof TypeError && arr[0] === 12 && Array.prototype[0] === 11; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +}); +assert.sameValue(arr[0], 12, 'arr[0]'); +assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-193.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-193.js index ec9694038..1f6f92161 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-193.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-193.js @@ -7,11 +7,11 @@ description: > Object.defineProperties - 'O' is an Array, 'P' is an array index named property, 'P' is own accessor property that overrides an inherited accessor property (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { - try { +var arr = []; + +assert.throws(TypeError, function() { Object.defineProperty(Array.prototype, "0", { get: function () { return 11; @@ -19,7 +19,6 @@ function testcase() { configurable: true }); - var arr = []; Object.defineProperty(arr, "0", { get: function () { return 12; @@ -32,11 +31,6 @@ function testcase() { configurable: true } }); - return false; - } catch (e) { - return e instanceof TypeError && arr[0] === 12 && Array.prototype[0] === 11; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +}); +assert.sameValue(arr[0], 12, 'arr[0]'); +assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-20.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-20.js index 6cba1a9c3..c6256b2e2 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-20.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-20.js @@ -6,12 +6,8 @@ es5id: 15.2.3.7-6-a-20 description: > Object.defineProperties - 'O' is a JSON object which implements its own [[GetOwnProperty]] method to get 'P' (8.12.9 step 1 ) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.defineProperty(JSON, "prop", { value: 11, writable: true, @@ -23,9 +19,6 @@ function testcase() { value: 12 } }); - return hasProperty && JSON.prop === 12; - } finally { - delete JSON.prop; - } - } -runTestCase(testcase); + +assert(hasProperty, 'hasProperty !== true'); +assert.sameValue(JSON.prop, 12, 'JSON.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-139-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-139-1.js index 55e12b421..dc4bb72be 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-139-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-139-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Function object which implements its own [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Function.prototype.value = "Function"; var funObj = function (a, b) { return a + b; @@ -20,9 +18,4 @@ function testcase() { Object.defineProperty(obj, "property", funObj); - return obj.property === "Function"; - } finally { - delete Function.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "Function", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-140-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-140-1.js index 8ee35ecef..2427bce09 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-140-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-140-1.js @@ -7,20 +7,13 @@ description: > Object.defineProperty - 'Attributes' is an Array object that uses Object's [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Array.prototype.value = "Array"; var arrObj = [1, 2, 3]; Object.defineProperty(obj, "property", arrObj); - return obj.property === "Array"; - } finally { - delete Array.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "Array", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-141-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-141-1.js index 0f3044492..7168b9b07 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-141-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-141-1.js @@ -7,20 +7,13 @@ description: > Object.defineProperty - 'Attributes' is a String object that uses Object's [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + String.prototype.value = "String"; var strObj = new String("abc"); Object.defineProperty(obj, "property", strObj); - return obj.property === "String"; - } finally { - delete String.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "String", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-142-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-142-1.js index c5f7def07..b7c70877d 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-142-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-142-1.js @@ -7,20 +7,13 @@ description: > Object.defineProperty - 'Attributes' is a Boolean object that uses Object's [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Boolean.prototype.value = "Boolean"; var boolObj = new Boolean(true); Object.defineProperty(obj, "property", boolObj); - return obj.property === "Boolean"; - } finally { - delete Boolean.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "Boolean", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-143-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-143-1.js index 0e69a8849..855177b2c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-143-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-143-1.js @@ -7,20 +7,13 @@ description: > Object.defineProperty - 'Attributes' is a Number object that uses Object's [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Number.prototype.value = "Number"; var numObj = new Number(-2); Object.defineProperty(obj, "property", numObj); - return obj.property === "Number"; - } finally { - delete Number.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "Number", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-144-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-144-1.js index 96bf1f211..2d38e639f 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-144-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-144-1.js @@ -7,20 +7,12 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Object.prototype.value = "Math"; Object.defineProperty(obj, "property", Math); - return obj.property === "Math"; - } finally { - delete Object.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "Math", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-144.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-144.js index 458e7457f..5a243de1c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-144.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-144.js @@ -7,20 +7,12 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'value' property (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Math.value = "Math"; Object.defineProperty(obj, "property", Math); - return obj.property === "Math"; - } finally { - delete Math.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "Math", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-145-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-145-1.js index 7c09699cf..738ae2d0e 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-145-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-145-1.js @@ -7,20 +7,13 @@ description: > Object.defineProperty - 'Attributes' is a Date object that uses Object's [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Date.prototype.value = "Date"; var dateObj = new Date(); Object.defineProperty(obj, "property", dateObj); - return obj.property === "Date"; - } finally { - delete Date.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "Date", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-146-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-146-1.js index 4f34ea230..28fd27b9d 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-146-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-146-1.js @@ -7,20 +7,13 @@ description: > Object.defineProperty - 'Attributes' is a RegExp object that uses Object's [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + RegExp.prototype.value = "RegExp"; var regObj = new RegExp(); Object.defineProperty(obj, "property", regObj); - return obj.property === "RegExp"; - } finally { - delete RegExp.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "RegExp", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-147-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-147-1.js index e0809ac44..2a28c6b51 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-147-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-147-1.js @@ -7,20 +7,12 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Object.prototype.value = "JSON"; Object.defineProperty(obj, "property", JSON); - return obj.property === "JSON"; - } finally { - delete Object.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "JSON", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-147.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-147.js index 89985336f..5974a207b 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-147.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-147.js @@ -7,20 +7,12 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'value' property (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { JSON.value = "JSON"; Object.defineProperty(obj, "property", JSON); - return obj.property === "JSON"; - } finally { - delete JSON.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "JSON", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-148-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-148-1.js index b891ea143..516717351 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-148-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-148-1.js @@ -7,20 +7,13 @@ description: > Object.defineProperty - 'Attributes' is an Error object that uses Object's [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Error.prototype.value = "Error"; var errObj = new Error(); Object.defineProperty(obj, "property", errObj); - return obj.property === "Error"; - } finally { - delete Error.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "Error", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-149-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-149-1.js index 94bae2563..7ce7e83e2 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-149-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-149-1.js @@ -7,21 +7,14 @@ description: > Object.defineProperty - 'Attributes' is an Arguments object which implements its own [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Object.prototype.value = "arguments"; var argObj = (function () { return arguments; })(); Object.defineProperty(obj, "property", argObj); - return obj.property === "arguments"; - } finally { - delete Object.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "arguments", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-151.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-151.js index ea7a65b54..13f2ce89d 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-151.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-151.js @@ -7,22 +7,13 @@ description: > Object.defineProperty - 'Attributes' is the global object that uses Object's [[Get]] method to access the 'value' property (8.10.5 step 5.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var obj = {}; - try { fnGlobalObject().value = "global"; Object.defineProperty(obj, "property", fnGlobalObject()); - return obj.property === "global"; - } finally { - delete fnGlobalObject().value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "global", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-165-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-165-1.js index 9ca90dfff..2daa9523d 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-165-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-165-1.js @@ -7,13 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Function object which implements its own [[Get]] method to access the 'writable' property of prototype object (8.10.5 step 6.b) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Function.prototype.writable = true; var funObj = function (a, b) { return a + b; @@ -27,9 +24,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete Function.prototype.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-166-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-166-1.js index 6dc54828a..66bc45603 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-166-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-166-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is an Array object that uses Object's [[Get]] method to access the 'writable' property of prototype object (8.10.5 step 6.b) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Array.prototype.writable = true; var arrObj = [1, 2, 3]; @@ -24,9 +22,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete Array.prototype.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-167-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-167-1.js index 5c2aff8b2..e5227ee79 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-167-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-167-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a String object that uses Object's [[Get]] method to access the 'writable' property of prototype object (8.10.5 step 6.b) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + String.prototype.writable = true; var strObj = new String("abc"); @@ -24,9 +22,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete String.prototype.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-168-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-168-1.js index 5870b54ae..347024234 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-168-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-168-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Boolean object that uses Object's [[Get]] method to access the 'writable' property of prototype object (8.10.5 step 6.b) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Boolean.prototype.writable = true; var boolObj = new Boolean(true); @@ -24,9 +22,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete Boolean.prototype.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-169-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-169-1.js index b4a10345a..431adb9f6 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-169-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-169-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Number object that uses Object's [[Get]] method to access the 'writable' property of prototype object (8.10.5 step 6.b) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Number.prototype.writable = true; var numObj = new Number(-2); @@ -24,9 +22,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete Number.prototype.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-170-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-170-1.js index 0ac85bc90..bd586b4b1 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-170-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-170-1.js @@ -7,13 +7,10 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'writable' property of prototype object (8.10.5 step 6.b) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Object.prototype.writable = true; Object.defineProperty(obj, "property", Math); @@ -24,9 +21,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete Object.prototype.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-170.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-170.js index 38bdebca8..d0d86774f 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-170.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-170.js @@ -7,13 +7,10 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'writable' property (8.10.5 step 6.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Math.writable = true; Object.defineProperty(obj, "property", Math); @@ -24,9 +21,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete Math.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-172-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-172-1.js index 444791cf8..abcd93fc0 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-172-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-172-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a RegExp object that uses Object's [[Get]] method to access the 'writable' property of prototype object (8.10.5 step 6.b) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + RegExp.prototype.writable = true; var regObj = new RegExp(); @@ -25,9 +23,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete RegExp.prototype.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-173-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-173-1.js index 170c0bed6..78f95f7d2 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-173-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-173-1.js @@ -7,13 +7,10 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'writable' property of prototype object (8.10.5 step 6.b) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Object.prototype.writable = true; Object.defineProperty(obj, "property", JSON); @@ -24,9 +21,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete Object.prototype.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-173.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-173.js index b488a8262..cb368f7d0 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-173.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-173.js @@ -7,13 +7,10 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'writable' property (8.10.5 step 6.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { JSON.writable = true; Object.defineProperty(obj, "property", JSON); @@ -24,9 +21,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete JSON.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-174-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-174-1.js index b17e2fcbd..073df7987 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-174-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-174-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is an Error object that uses Object's [[Get]] method to access the 'writable' property of prototype object (8.10.5 step 6.b) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Error.prototype.writable = true; var errObj = new Error(); @@ -25,9 +23,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete Error.prototype.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-175-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-175-1.js index 7a75d3321..cc32ea6b4 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-175-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-175-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is an Arguments object which implements its own [[Get]] method to access the 'writable' property of prototype object (8.10.5 step 6.b) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Object.prototype.writable = true; var argObj = (function () { return arguments; })(); @@ -25,9 +23,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete Object.prototype.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-177.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-177.js index 2452d47fc..dc5a0e6dd 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-177.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-177.js @@ -7,15 +7,11 @@ description: > Object.defineProperty - 'Attributes' is the global object that uses Object's [[Get]] method to access the 'writable' property (8.10.5 step 6.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var obj = {}; - try { fnGlobalObject().writable = true; Object.defineProperty(obj, "property", fnGlobalObject()); @@ -26,9 +22,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete fnGlobalObject().writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-218-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-218-1.js index 7fd8a49ab..af3ba07d2 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-218-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-218-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Function object which implements its own [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Function.prototype.get = function () { return "functionGetProperty"; }; @@ -20,9 +18,4 @@ function testcase() { Object.defineProperty(obj, "property", funObj); - return obj.property === "functionGetProperty"; - } finally { - delete Function.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "functionGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-219-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-219-1.js index 33c27f263..777e4b1e1 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-219-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-219-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is an Array object that uses Object's [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Array.prototype.get = function () { return "arrayGetProperty"; }; @@ -20,9 +18,4 @@ function testcase() { Object.defineProperty(obj, "property", arrObj); - return obj.property === "arrayGetProperty"; - } finally { - delete Array.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "arrayGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-220-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-220-1.js index af410bfe6..12816889e 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-220-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-220-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a String object that uses Object's [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + String.prototype.get = function () { return "stringGetProperty"; }; @@ -20,9 +18,4 @@ function testcase() { Object.defineProperty(obj, "property", strObj); - return obj.property === "stringGetProperty"; - } finally { - delete String.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "stringGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-221-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-221-1.js index 0d1f65127..5984602a4 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-221-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-221-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Boolean object that uses Object's [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Boolean.prototype.get = function () { return "booleanGetProperty"; }; @@ -20,9 +18,4 @@ function testcase() { Object.defineProperty(obj, "property", boolObj); - return obj.property === "booleanGetProperty"; - } finally { - delete Boolean.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "booleanGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-222-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-222-1.js index 73dd3b73f..2782d5443 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-222-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-222-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Number object that uses Object's [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Number.prototype.get = function () { return "numberGetProperty"; }; @@ -20,9 +18,4 @@ function testcase() { Object.defineProperty(obj, "property", numObj); - return obj.property === "numberGetProperty"; - } finally { - delete Number.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "numberGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-223-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-223-1.js index 4b2dc0f76..cb7c01393 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-223-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-223-1.js @@ -7,22 +7,14 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Object.prototype.get = function () { return "mathGetProperty"; }; Object.defineProperty(obj, "property", Math); - return obj.property === "mathGetProperty"; - } finally { - delete Object.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "mathGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-223.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-223.js index 2db97c35f..165f297a7 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-223.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-223.js @@ -7,22 +7,14 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'get' property (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Math.get = function () { return "mathGetProperty"; }; Object.defineProperty(obj, "property", Math); - return obj.property === "mathGetProperty"; - } finally { - delete Math.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "mathGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-224-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-224-1.js index cdf29528e..4e2957df9 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-224-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-224-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Date object that uses Object's [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Date.prototype.get = function () { return "dateGetProperty"; }; @@ -20,9 +18,4 @@ function testcase() { Object.defineProperty(obj, "property", dateObj); - return obj.property === "dateGetProperty"; - } finally { - delete Date.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "dateGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-225-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-225-1.js index c8caf8bec..cac536761 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-225-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-225-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a RegExp object that uses Object's [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + RegExp.prototype.get = function () { return "regExpGetProperty"; }; @@ -21,9 +19,4 @@ function testcase() { Object.defineProperty(obj, "property", regObj); - return obj.property === "regExpGetProperty"; - } finally { - delete RegExp.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "regExpGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-226-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-226-1.js index 910c8d443..63ccc8a3a 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-226-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-226-1.js @@ -7,22 +7,14 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Object.prototype.get = function () { return "jsonGetProperty"; }; Object.defineProperty(obj, "property", JSON); - return obj.property === "jsonGetProperty"; - } finally { - delete Object.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "jsonGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-226.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-226.js index 982a66756..404626ea1 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-226.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-226.js @@ -7,22 +7,14 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'get' property (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { JSON.get = function () { return "jsonGetProperty"; }; Object.defineProperty(obj, "property", JSON); - return obj.property === "jsonGetProperty"; - } finally { - delete JSON.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "jsonGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-227-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-227-1.js index a512eb5b2..3b694afa2 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-227-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-227-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is an Error object that uses Object's [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Error.prototype.get = function () { return "errorGetProperty"; }; @@ -20,9 +18,4 @@ function testcase() { Object.defineProperty(obj, "property", errObj); - return obj.property === "errorGetProperty"; - } finally { - delete Error.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "errorGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-228-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-228-1.js index 602bd59f2..89b7ba7df 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-228-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-228-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is an Arguments object which implements its own [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Object.prototype.get = function () { return "argumentGetProperty"; }; @@ -20,9 +18,4 @@ function testcase() { Object.defineProperty(obj, "property", argObj); - return obj.property === "argumentGetProperty"; - } finally { - delete Object.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "argumentGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-230.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-230.js index e5e6e3a49..a7dbfae0a 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-230.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-230.js @@ -7,24 +7,15 @@ description: > Object.defineProperty - 'Attributes' is the global object that uses Object's [[Get]] method to access the 'get' property (8.10.5 step 7.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var obj = {}; - try { fnGlobalObject().get = function () { return "globalGetProperty"; }; Object.defineProperty(obj, "property", fnGlobalObject()); - return obj.property === "globalGetProperty"; - } finally { - delete fnGlobalObject().get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "globalGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-248-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-248-1.js index d346c55d7..4ff3487ad 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-248-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-248-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is a Function object which implements its own [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { + Function.prototype.set = function (value) { data = value; }; @@ -22,9 +20,5 @@ function testcase() { Object.defineProperty(obj, "property", funObj); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete Function.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-249-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-249-1.js index 6c1c71c29..12f19e894 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-249-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-249-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is an Array object that uses Object's [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { + Array.prototype.set = function (value) { data = value; }; @@ -22,9 +20,5 @@ function testcase() { Object.defineProperty(obj, "property", arrObj); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete Array.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-250-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-250-1.js index c61187c53..10055b5c8 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-250-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-250-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a String object that uses Object's [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + String.prototype.set = function (value) { data = value; }; @@ -22,9 +20,5 @@ function testcase() { Object.defineProperty(obj, "property", strObj); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete String.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-251-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-251-1.js index c28602cd3..6ea5a518d 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-251-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-251-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is a Boolean object that uses Object's [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { + Boolean.prototype.set = function (value) { data = value; }; @@ -22,9 +20,5 @@ function testcase() { Object.defineProperty(obj, "property", boolObj); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete Boolean.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-252-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-252-1.js index 1961cbddc..749f8bc33 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-252-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-252-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is a Number object that uses Object's [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { + Number.prototype.set = function (value) { data = value; }; @@ -22,9 +20,5 @@ function testcase() { Object.defineProperty(obj, "property", numObj); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete Number.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-253-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-253-1.js index acf887909..96622fe50 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-253-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-253-1.js @@ -7,14 +7,11 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { Object.prototype.set = function (value) { data = value; }; @@ -22,9 +19,5 @@ function testcase() { Object.defineProperty(obj, "property", Math); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete Object.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-253.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-253.js index d9e66b08f..322dfe1f0 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-253.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-253.js @@ -7,14 +7,11 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'set' property (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { Math.set = function (value) { data = value; }; @@ -22,9 +19,5 @@ function testcase() { Object.defineProperty(obj, "property", Math); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete Math.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-254-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-254-1.js index 33b696c2a..9b3a47fe4 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-254-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-254-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is a Date object that uses Object's [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { + Date.prototype.set = function (value) { data = value; }; @@ -22,9 +20,5 @@ function testcase() { Object.defineProperty(obj, "property", dateObj); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete Date.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-255-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-255-1.js index 7d9ae4742..15c2b421e 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-255-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-255-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is a RegExp object that uses Object's [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { + RegExp.prototype.set = function (value) { data = value; }; @@ -22,9 +20,5 @@ function testcase() { Object.defineProperty(obj, "property", regObj); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete RegExp.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-256-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-256-1.js index 1512bc1f7..86747c4b8 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-256-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-256-1.js @@ -7,14 +7,11 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { Object.prototype.set = function (value) { data = value; }; @@ -22,9 +19,5 @@ function testcase() { Object.defineProperty(obj, "property", JSON); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete Object.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-256.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-256.js index da7043199..67353422e 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-256.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-256.js @@ -7,14 +7,11 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'set' property (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { JSON.set = function (value) { data = value; }; @@ -22,9 +19,5 @@ function testcase() { Object.defineProperty(obj, "property", JSON); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete JSON.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-257-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-257-1.js index 037898c4c..a0fe03339 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-257-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-257-1.js @@ -7,14 +7,11 @@ description: > Object.defineProperty - 'Attributes' is an Error object that uses Object's [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { Error.prototype.set = function (value) { data = value; }; @@ -23,9 +20,5 @@ function testcase() { Object.defineProperty(obj, "property", errObj); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete Error.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-258-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-258-1.js index 0d2215471..0b250f10f 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-258-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-258-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is an Arguments object which implements its own [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { + Object.prototype.set = function (value) { data = value; }; @@ -22,9 +20,5 @@ function testcase() { Object.defineProperty(obj, "property", argObj); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete Object.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-260.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-260.js index 24c3df67f..ce66181c2 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-260.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-260.js @@ -7,16 +7,12 @@ description: > Object.defineProperty - 'Attributes' is the global object that uses Object's [[Get]] method to access the 'set' property (8.10.5 step 8.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { fnGlobalObject().set = function (value) { data = value; }; @@ -24,9 +20,5 @@ function testcase() { Object.defineProperty(obj, "property", fnGlobalObject()); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete fnGlobalObject().set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-33-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-33-1.js index 74181ef23..17f152928 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-33-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-33-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is a Function object which implements its own [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { + Function.prototype.enumerable = true; var fun = function () { }; @@ -25,9 +23,4 @@ function testcase() { } } - return accessed; - } finally { - delete Function.prototype.enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-34-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-34-1.js index b41c1fbb6..6a54cf172 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-34-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-34-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is an Array object that uses Object's [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { + Array.prototype.enumerable = true; var arrObj = []; @@ -25,9 +23,4 @@ function testcase() { } } - return accessed; - } finally { - delete Array.prototype.enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-35-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-35-1.js index 867bc4412..908e603b1 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-35-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-35-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is a String object that uses Object's [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { + String.prototype.enumerable = true; var strObj = new String(); @@ -25,9 +23,4 @@ function testcase() { } } - return accessed; - } finally { - delete String.prototype.enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-36-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-36-1.js index f62fc229e..a385748a7 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-36-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-36-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is a Boolean object that uses Object's [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { + Boolean.prototype.enumerable = true; var boolObj = new Boolean(true); @@ -25,9 +23,4 @@ function testcase() { } } - return accessed; - } finally { - delete Boolean.prototype.enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-37-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-37-1.js index 8452d007f..d9e83be1f 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-37-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-37-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is a Number object that uses Object's [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { + Number.prototype.enumerable = true; var numObj = new Number(-2); @@ -25,9 +23,4 @@ function testcase() { } } - return accessed; - } finally { - delete Number.prototype.enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-38-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-38-1.js index eddd64c11..c49dc19dc 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-38-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-38-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { + Object.prototype.enumerable = true; Object.defineProperty(obj, "property", Math); @@ -23,9 +21,5 @@ function testcase() { accessed = true; } } - return accessed; - } finally { - delete Object.prototype.enumerable; - } - } -runTestCase(testcase); + +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-38.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-38.js index 65bad194f..ea7b3809f 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-38.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-38.js @@ -7,14 +7,11 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'enumerable' property (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { Math.enumerable = true; Object.defineProperty(obj, "property", Math); @@ -24,9 +21,5 @@ function testcase() { accessed = true; } } - return accessed; - } finally { - delete Math.enumerable; - } - } -runTestCase(testcase); + +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-39-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-39-1.js index ac30e2ab2..54bc49d18 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-39-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-39-1.js @@ -7,14 +7,11 @@ description: > Object.defineProperty - 'Attributes' is a Date object that uses Object's [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { Date.prototype.enumerable = true; var dateObj = new Date(); @@ -25,9 +22,5 @@ function testcase() { accessed = true; } } - return accessed; - } finally { - delete Date.prototype.enumerable; - } - } -runTestCase(testcase); + +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-40-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-40-1.js index 697f697f0..6f2548ffd 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-40-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-40-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is an RegExp object that uses Object's [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { + RegExp.prototype.enumerable = true; var regObj = new RegExp(); @@ -25,9 +23,4 @@ function testcase() { } } - return accessed; - } finally { - delete RegExp.prototype.enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-41-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-41-1.js index c871601d6..c53c41840 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-41-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-41-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { + Object.prototype.enumerable = true; Object.defineProperty(obj, "property", JSON); @@ -24,9 +22,4 @@ function testcase() { } } - return accessed; - } finally { - delete Object.prototype.enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-41.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-41.js index 381fb50bd..6475a5ceb 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-41.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-41.js @@ -7,14 +7,11 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'enumerable' property (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { JSON.enumerable = true; Object.defineProperty(obj, "property", JSON); @@ -25,9 +22,4 @@ function testcase() { } } - return accessed; - } finally { - delete JSON.enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-42-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-42-1.js index 4ce09b5e3..41e13499f 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-42-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-42-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is an Error object that uses Object's [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { + Error.prototype.enumerable = true; var errObj = new Error(); @@ -25,9 +23,4 @@ function testcase() { } } - return accessed; - } finally { - delete Error.prototype.enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-43-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-43-1.js index 7e0325f17..7a799db39 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-43-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-43-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is an Arguments object which implements its own [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { + Object.prototype.enumerable = true; var argObj = (function () { return arguments; })(); @@ -25,9 +23,4 @@ function testcase() { } } - return accessed; - } finally { - delete Object.prototype.enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-45.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-45.js index ed034969f..114fcde60 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-45.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-45.js @@ -7,16 +7,12 @@ description: > Object.defineProperty - 'Attributes' is the global object that uses Object's [[Get]] method to access the 'enumerable' property (8.10.5 step 3.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { fnGlobalObject().enumerable = true; Object.defineProperty(obj, "property", fnGlobalObject()); @@ -27,9 +23,4 @@ function testcase() { } } - return accessed; - } finally { - delete fnGlobalObject().enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-86-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-86-1.js index 894f753f5..016698c0e 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-86-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-86-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Function object which implements its own [[Get]] method to access the 'configurable' property of prototype object (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Function.prototype.configurable = true; var funObj = function (a, b) { return a + b; @@ -26,9 +24,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete Function.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-87-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-87-1.js index 2b22af147..b28cb6881 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-87-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-87-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is an Array object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Array.prototype.configurable = true; var arrObj = [1, 2, 3]; @@ -24,9 +22,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete Array.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-88-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-88-1.js index 374e43db0..c0708bbe1 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-88-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-88-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a String object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + String.prototype.configurable = true; var strObj = new String("abc"); @@ -24,9 +22,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete String.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-89-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-89-1.js index d5b1212f6..2ee6e1792 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-89-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-89-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Boolean object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Boolean.prototype.configurable = true; var boolObj = new Boolean(true); @@ -24,9 +22,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete Boolean.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-90-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-90-1.js index 4d9174d19..d867abbc6 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-90-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-90-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Number object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Number.prototype.configurable = true; var numObj = new Number(-2); @@ -24,9 +22,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete Number.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-91-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-91-1.js index 29f44fddc..2191b771e 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-91-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-91-1.js @@ -7,13 +7,10 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Object.prototype.configurable = true; Object.defineProperty(obj, "property", Math); @@ -24,9 +21,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete Object.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-91.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-91.js index 9eb1e64dd..e87007a5a 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-91.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-91.js @@ -7,13 +7,10 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Math.configurable = true; Object.defineProperty(obj, "property", Math); @@ -24,9 +21,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete Math.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-92-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-92-1.js index 4a25c26e6..8665effb5 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-92-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-92-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Date object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Date.prototype.configurable = true; var dateObj = new Date(); @@ -24,9 +22,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete Date.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-93-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-93-1.js index aed55e537..b34879406 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-93-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-93-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is an RegExp object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + RegExp.prototype.configurable = true; var regObj = new RegExp(); @@ -24,9 +22,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete RegExp.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-94-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-94-1.js index e382a33f6..293602b42 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-94-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-94-1.js @@ -7,13 +7,10 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Object.prototype.configurable = true; Object.defineProperty(obj, "property", JSON); @@ -24,9 +21,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete Object.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-94.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-94.js index ef9206b3d..f7cd3d9aa 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-94.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-94.js @@ -7,13 +7,10 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { JSON.configurable = true; Object.defineProperty(obj, "property", JSON); @@ -24,9 +21,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete JSON.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-95-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-95-1.js index 8947f2118..28d5de387 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-95-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-95-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is an Error object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Error.prototype.configurable = true; var errObj = new Error(); @@ -24,9 +22,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete Error.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-96-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-96-1.js index 743adb650..53a448dd0 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-96-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-96-1.js @@ -7,13 +7,10 @@ description: > Object.defineProperty - 'Attributes' is an Arguments object which implements its own [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Object.prototype.configurable = true; var argObj = (function () { return arguments; })(); @@ -25,9 +22,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete Object.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-98.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-98.js index 79c8a99e0..1bc8fe297 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-98.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-98.js @@ -7,15 +7,11 @@ description: > Object.defineProperty - 'Attributes' is the global object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var obj = {}; - try { fnGlobalObject().configurable = true; Object.defineProperty(obj, "property", fnGlobalObject()); @@ -26,9 +22,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete fnGlobalObject().configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-117.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-117.js index f80cb5718..2fd599c0b 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-117.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-117.js @@ -7,14 +7,12 @@ description: > Object.defineProperty - 'O' is an Array, test the length property of 'O' is own data property that overrides an inherited data property (15.4.5.1 step 1) -includes: [runTestCase.js] ---*/ -function testcase() { var arrObj = [0, 1, 2]; var arrProtoLen; - try { +assert.throws(TypeError, function() { arrProtoLen = Array.prototype.length; Array.prototype.length = 0; @@ -26,11 +24,6 @@ function testcase() { Object.defineProperty(arrObj, "length", { value: 1 }); - return false; - } catch (e) { - return e instanceof TypeError && arrObj.length === 3 && Array.prototype.length === 0; - } finally { - Array.prototype.length = arrProtoLen; - } - } -runTestCase(testcase); +}); +assert.sameValue(arrObj.length, 3, 'arrObj.length'); +assert.sameValue(Array.prototype.length, 0, 'Array.prototype.length'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-171.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-171.js index b3c686930..29cef1594 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-171.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-171.js @@ -9,20 +9,14 @@ description: > of the length property, test the [[Configurable]] attribute of an inherited data property with large index named in 'O' can't stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arrObj = [0, 1]; - try { + Array.prototype[1] = 2; // Not setting the [[Configurable]] attribute of property "1" to false here, since Array.prototype is a global object, and non-configurbale property can't revert to configurable Object.defineProperty(arrObj, "length", { value: 1 }); - return arrObj.length === 1 && !arrObj.hasOwnProperty("1"); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(arrObj.length, 1, 'arrObj.length'); +assert.sameValue(arrObj.hasOwnProperty("1"), false, 'arrObj.hasOwnProperty("1")'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-172.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-172.js index 94ee183d5..11e3ff7ff 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-172.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-172.js @@ -10,13 +10,11 @@ description: > own data property with large index named in 'O' that overrides an inherited data property can stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arrObj = [0, 1]; - try { + +assert.throws(TypeError, function() { Object.defineProperty(arrObj, "1", { configurable: false }); @@ -25,11 +23,6 @@ function testcase() { Object.defineProperty(arrObj, "length", { value: 1 }); - return false; - } catch (e) { - return e instanceof TypeError && arrObj.length === 2 && arrObj.hasOwnProperty("1"); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +}); +assert.sameValue(arrObj.length, 2, 'arrObj.length'); +assert(arrObj.hasOwnProperty("1"), 'arrObj.hasOwnProperty("1") !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-173.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-173.js index ed42fe598..27a85d434 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-173.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-173.js @@ -10,13 +10,11 @@ description: > own data property with large index named in 'O' that overrides an inherited accessor property can stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arrObj = [0, 1]; - try { + +assert.throws(TypeError, function() { Object.defineProperty(arrObj, "1", { configurable: false }); @@ -31,12 +29,6 @@ function testcase() { Object.defineProperty(arrObj, "length", { value: 1 }); - - return false; - } catch (e) { - return e instanceof TypeError && arrObj.length === 2 && arrObj.hasOwnProperty("1"); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +}); +assert.sameValue(arrObj.length, 2, 'arrObj.length'); +assert(arrObj.hasOwnProperty("1"), 'arrObj.hasOwnProperty("1") !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-175.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-175.js index 79b35f0d3..4e7d05ceb 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-175.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-175.js @@ -9,13 +9,10 @@ description: > of the length property, test the [[Configurable]] attribute of an inherited accessor property with large index named in 'O' can't stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arrObj = [0, 1]; - try { + Object.defineProperty(Array.prototype, "1", { get: function () { return 1; @@ -27,9 +24,5 @@ function testcase() { value: 1 }); - return arrObj.length === 1 && !arrObj.hasOwnProperty("1"); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(arrObj.length, 1, 'arrObj.length'); +assert.sameValue(arrObj.hasOwnProperty("1"), false, 'arrObj.hasOwnProperty("1")'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-176.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-176.js index 17dd6a3e4..4d1d9ac03 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-176.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-176.js @@ -10,13 +10,11 @@ description: > own accessor property with large index named in 'O' that overrides an inherited data property can stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arrObj = [0, 1]; - try { + +assert.throws(TypeError, function() { Object.defineProperty(arrObj, "1", { get: function () { return 2; @@ -28,11 +26,6 @@ function testcase() { Object.defineProperty(arrObj, "length", { value: 1 }); - return false; - } catch (e) { - return e instanceof TypeError && arrObj.length === 2 && arrObj.hasOwnProperty("1"); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +}); +assert.sameValue(arrObj.length, 2, 'arrObj.length'); +assert(arrObj.hasOwnProperty("1"), 'arrObj.hasOwnProperty("1") !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-177.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-177.js index f3cef92f5..f9c666b27 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-177.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-177.js @@ -10,13 +10,11 @@ description: > own accessor property with large index named in 'O' that overrides an inherited accessor property can stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arrObj = [0, 1]; - try { + +assert.throws(TypeError, function() { Object.defineProperty(arrObj, "1", { get: function () { return 1; @@ -34,11 +32,6 @@ function testcase() { Object.defineProperty(arrObj, "length", { value: 1 }); - return false; - } catch (e) { - return e instanceof TypeError && arrObj.length === 2 && arrObj.hasOwnProperty("1"); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +}); +assert.sameValue(arrObj.length, 2, 'arrObj.length'); +assert(arrObj.hasOwnProperty("1"), 'arrObj.hasOwnProperty("1") !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-192.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-192.js index c99967e9f..5e28dc2d3 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-192.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-192.js @@ -8,17 +8,16 @@ description: > named property, 'name' is own data property that overrides an inherited data property, test TypeError is thrown on updating the [[Configurable]] attribute from false to true (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { - try { +var arrObj = []; + +assert.throws(TypeError, function() { Object.defineProperty(Array.prototype, "0", { value: 11, configurable: true }); - var arrObj = []; Object.defineProperty(arrObj, "0", { value: 12, configurable: false @@ -27,11 +26,6 @@ function testcase() { Object.defineProperty(arrObj, "0", { configurable: true }); - return false; - } catch (e) { - return e instanceof TypeError && Array.prototype[0] === 11 && arrObj[0] === 12; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +}); +assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]'); +assert.sameValue(arrObj[0], 12, 'arrObj[0]'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-193.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-193.js index c7ea6830d..03c38b4db 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-193.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-193.js @@ -10,11 +10,11 @@ description: > the [[Configurable]] attribute to true and value of [[Configurable]] attribute of original is false (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { - try { +var arrObj = []; + +assert.throws(TypeError, function() { Object.defineProperty(Array.prototype, "0", { get: function () { return 11; @@ -22,7 +22,6 @@ function testcase() { configurable: true }); - var arrObj = []; Object.defineProperty(arrObj, "0", { value: 12, configurable: false @@ -31,11 +30,6 @@ function testcase() { Object.defineProperty(arrObj, "0", { configurable: true }); - return false; - } catch (e) { - return e instanceof TypeError && Array.prototype[0] === 11 && arrObj[0] === 12; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +}); +assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]'); +assert.sameValue(arrObj[0], 12, 'arrObj[0]'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-196.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-196.js index f6ee1a4cc..7ddb2e1dd 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-196.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-196.js @@ -7,11 +7,10 @@ description: > Object.defineProperty - 'O' is an Array, 'name' is an array index named property, 'name' is own accessor property that overrides an inherited data property (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { - try { + +assert.throws(TypeError, function() { Object.defineProperty(Array.prototype, "0", { value: 11, configurable: true @@ -26,11 +25,4 @@ function testcase() { Object.defineProperty(arrObj, "0", { configurable: true }); - return false; - } catch (e) { - return e instanceof TypeError; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-197.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-197.js index 0dfdf81c9..4fc4f1e83 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-197.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-197.js @@ -7,11 +7,10 @@ description: > Object.defineProperty - 'O' is an Array, 'name' is an array index named property, 'name' is own accessor property that overrides an inherited accessor property (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { - try { + +assert.throws(TypeError, function() { Object.defineProperty(Array.prototype, "0", { get: function () { }, configurable: true @@ -26,11 +25,4 @@ function testcase() { Object.defineProperty(arrObj, "0", { configurable: true }); - return false; - } catch (e) { - return e instanceof TypeError; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-354-8.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-354-8.js index fd80a39e1..af11b7433 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-354-8.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-354-8.js @@ -13,7 +13,7 @@ includes: ---*/ var obj = fnGlobalObject(); -try { + Object.defineProperty(obj, "prop", { value: 2010, writable: false, @@ -24,7 +24,3 @@ try { assert.sameValue(obj.prop, 2010); verifyNotWritable(obj, "prop"); assert.sameValue(obj.prop, 2010); -} finally { - delete obj.prop; -} - diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-360-3.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-360-3.js index 1aa14ab70..b1cdb7890 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-360-3.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-360-3.js @@ -14,7 +14,7 @@ includes: ---*/ var obj = fnGlobalObject(); -try { + Object.defineProperty(obj, "prop", { value: 2010, writable: false, @@ -38,6 +38,3 @@ try { assert.sameValue(obj.prop, 20); assert.sameValue(typeof desc2.set, "undefined"); assert.sameValue(desc2.get, getFunc); -} finally { - delete obj.prop; -} diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-402.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-402.js index 976842919..1ef35f2bc 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-402.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-402.js @@ -6,11 +6,8 @@ es5id: 15.2.3.6-4-402 description: > ES5 Attributes - [[Value]] attribute of inherited property of [[Prototype]] internal property is correct (String instance) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(String.prototype, "prop", { value: 1001, writable: true, @@ -19,9 +16,5 @@ function testcase() { }); var strObj = new String(); - return !strObj.hasOwnProperty("prop") && strObj.prop === 1001; - } finally { - delete String.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(strObj.hasOwnProperty("prop"), false, 'strObj.hasOwnProperty("prop")'); +assert.sameValue(strObj.prop, 1001, 'strObj.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-403.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-403.js index c19ec0616..989f5d5e9 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-403.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-403.js @@ -7,11 +7,8 @@ description: > ES5 Attributes - Successfully add a property to an object when the object's prototype has a property with same name and [[Writable]] attribute is set to true (Array instance) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "prop", { value: 1001, writable: true, @@ -21,9 +18,5 @@ function testcase() { var arrObj = []; arrObj.prop = 1002; - return arrObj.hasOwnProperty("prop") && arrObj.prop === 1002; - } finally { - delete Array.prototype.prop; - } - } -runTestCase(testcase); +assert(arrObj.hasOwnProperty("prop"), 'arrObj.hasOwnProperty("prop") !== true'); +assert.sameValue(arrObj.prop, 1002, 'arrObj.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-404.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-404.js index c65cd138d..5cd579892 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-404.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-404.js @@ -6,11 +6,8 @@ es5id: 15.2.3.6-4-404 description: > ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to true is enumerable (Boolean instance) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Boolean.prototype, "prop", { value: 1001, writable: true, @@ -26,9 +23,5 @@ function testcase() { } } - return !boolObj.hasOwnProperty("prop") && verifyEnumerable; - } finally { - delete Boolean.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(boolObj.hasOwnProperty("prop"), false, 'boolObj.hasOwnProperty("prop")'); +assert(verifyEnumerable, 'verifyEnumerable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-405.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-405.js index 7ff234090..3f7a50438 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-405.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-405.js @@ -10,7 +10,6 @@ description: > includes: [propertyHelper.js] ---*/ -try { Object.defineProperty(Number.prototype, "prop", { value: 1001, writable: false, @@ -22,7 +21,3 @@ try { assert(!numObj.hasOwnProperty("prop")); verifyNotWritable(numObj, "prop", "noCheckOwnProp"); -} finally { - delete Number.prototype.prop; -} - diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-406.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-406.js index cd6ece4e6..25ede11d5 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-406.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-406.js @@ -6,11 +6,8 @@ es5id: 15.2.3.6-4-406 description: > ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to false is non-enumerable (Function instance) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Function.prototype, "prop", { value: 1001, writable: false, @@ -26,9 +23,5 @@ function testcase() { } } - return !funObj.hasOwnProperty("prop") && !verifyEnumerable; - } finally { - delete Function.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(funObj.hasOwnProperty("prop"), false, 'funObj.hasOwnProperty("prop")'); +assert.sameValue(verifyEnumerable, false, 'verifyEnumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-407.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-407.js index 4e4f2555b..eeabd495e 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-407.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-407.js @@ -6,11 +6,8 @@ es5id: 15.2.3.6-4-407 description: > ES5 Attributes - [[Value]] attribute of inherited property of [[Prototype]] internal property is correct (Error Instance) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Error.prototype, "prop", { value: 1001, writable: true, @@ -19,9 +16,5 @@ function testcase() { }); var errObj = new Error(); - return !errObj.hasOwnProperty("prop") && errObj.prop === 1001; - } finally { - delete Error.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(errObj.hasOwnProperty("prop"), false, 'errObj.hasOwnProperty("prop")'); +assert.sameValue(errObj.prop, 1001, 'errObj.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-408.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-408.js index f25895f32..c1223a55c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-408.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-408.js @@ -7,11 +7,8 @@ description: > ES5 Attributes - Successfully add a property to an object when the object's prototype has a property with same name and [[Writable]] attribute is set to true (Date instance) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Date.prototype, "prop", { value: 1001, writable: true, @@ -21,9 +18,5 @@ function testcase() { var dateObj = new Date(); dateObj.prop = 1002; - return dateObj.hasOwnProperty("prop") && dateObj.prop === 1002; - } finally { - delete Date.prototype.prop; - } - } -runTestCase(testcase); +assert(dateObj.hasOwnProperty("prop"), 'dateObj.hasOwnProperty("prop") !== true'); +assert.sameValue(dateObj.prop, 1002, 'dateObj.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-409.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-409.js index 2b48ac1e0..8dd96da0b 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-409.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-409.js @@ -6,11 +6,8 @@ es5id: 15.2.3.6-4-409 description: > ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to false is enumerable (RegExp instance) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(RegExp.prototype, "prop", { value: 1001, writable: true, @@ -26,9 +23,5 @@ function testcase() { } } - return !regObj.hasOwnProperty("prop") && verifyEnumerable; - } finally { - delete RegExp.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(regObj.hasOwnProperty("prop"), false, 'regObj.hasOwnProperty("prop")'); +assert(verifyEnumerable, 'verifyEnumerable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-410.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-410.js index be87243a7..7c7a84256 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-410.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-410.js @@ -10,7 +10,6 @@ description: > includes: [propertyHelper.js] ---*/ -try { Object.defineProperty(Object.prototype, "prop", { value: 1001, writable: false, @@ -21,8 +20,3 @@ try { assert(!JSON.hasOwnProperty("prop")); verifyNotWritable(JSON, "prop", "noCheckOwnProp"); assert.sameValue(JSON.prop, 1001); - -} finally { - delete Object.prototype.prop; -} - diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-411.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-411.js index c22e5c0f3..b8d82ce40 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-411.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-411.js @@ -6,11 +6,8 @@ es5id: 15.2.3.6-4-411 description: > ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to false is non-enumerable (Math) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Object.prototype, "prop", { value: 1001, writable: false, @@ -25,9 +22,5 @@ function testcase() { } } - return !Math.hasOwnProperty("prop") && !verifyEnumerable; - } finally { - delete Object.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(Math.hasOwnProperty("prop"), false, 'Math.hasOwnProperty("prop")'); +assert.sameValue(verifyEnumerable, false, 'verifyEnumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-417.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-417.js index 15fc5c5a5..6df596d40 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-417.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-417.js @@ -6,12 +6,10 @@ es5id: 15.2.3.6-4-417 description: > ES5 Attributes - [[Value]] attribute of inherited property of [[Prototype]] internal property is correct(Function.prototype.bind) -includes: [runTestCase.js] ---*/ -function testcase() { var foo = function () { }; - try { + Object.defineProperty(Function.prototype, "prop", { value: 1001, writable: true, @@ -21,9 +19,5 @@ function testcase() { var obj = foo.bind({}); - return !obj.hasOwnProperty("prop") && obj.prop === 1001; - } finally { - delete Function.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(obj.hasOwnProperty("prop"), false, 'obj.hasOwnProperty("prop")'); +assert.sameValue(obj.prop, 1001, 'obj.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-418.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-418.js index 4e04e0352..d2c0ab532 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-418.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-418.js @@ -7,12 +7,10 @@ description: > ES5 Attributes - Successfully add a property to an object when the object's prototype has a property with the same name and [[Writable]] set to true (Function.prototype.bind) -includes: [runTestCase.js] ---*/ -function testcase() { var foo = function () { }; - try { + Object.defineProperty(Function.prototype, "prop", { value: 1001, writable: true, @@ -23,9 +21,5 @@ function testcase() { var obj = foo.bind({}); obj.prop = 1002; - return obj.hasOwnProperty("prop") && obj.prop === 1002; - } finally { - delete Function.prototype.prop; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true'); +assert.sameValue(obj.prop, 1002, 'obj.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-419.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-419.js index 5a707bcc0..e175d090f 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-419.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-419.js @@ -6,12 +6,10 @@ es5id: 15.2.3.6-4-419 description: > ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to true is enumerable (Function.prototype.bind) -includes: [runTestCase.js] ---*/ -function testcase() { var foo = function () { }; - try { + Object.defineProperty(Function.prototype, "prop", { value: 1001, writable: true, @@ -27,9 +25,5 @@ function testcase() { } } - return !obj.hasOwnProperty("prop") && verifyEnumerable; - } finally { - delete Function.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(obj.hasOwnProperty("prop"), false, 'obj.hasOwnProperty("prop")'); +assert(verifyEnumerable, 'verifyEnumerable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-420.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-420.js index 9c192fd4b..f403f9b34 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-420.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-420.js @@ -11,7 +11,7 @@ includes: [propertyHelper.js] ---*/ var foo = function () { }; -try { + Object.defineProperty(Function.prototype, "prop", { value: 1001, writable: false, @@ -22,7 +22,3 @@ try { var obj = foo.bind({}); assert(!obj.hasOwnProperty("prop")); verifyNotWritable(foo, "prop", "noCheckOwnProp"); -} finally { - delete Function.prototype.prop; -} - diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-421.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-421.js index adb3af773..120ffe0fd 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-421.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-421.js @@ -6,12 +6,10 @@ es5id: 15.2.3.6-4-421 description: > ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to false is non-enumerable (Function.prototype.bind) -includes: [runTestCase.js] ---*/ -function testcase() { var foo = function () { }; - try { + Object.defineProperty(Function.prototype, "prop", { value: 1001, writable: false, @@ -27,9 +25,5 @@ function testcase() { } } - return !obj.hasOwnProperty("prop") && !verifyEnumerable; - } finally { - delete Function.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(obj.hasOwnProperty("prop"), false, 'obj.hasOwnProperty("prop")'); +assert.sameValue(verifyEnumerable, false, 'verifyEnumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-531-17.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-531-17.js index 84835f3ca..84b8696dc 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-531-17.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-531-17.js @@ -7,14 +7,11 @@ description: > ES5 Attributes - Updating an indexed accessor property 'P' using simple assignment is successful, 'O' is the global object (8.12.5 step 5.b) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var obj = fnGlobalObject(); - try { + obj.verifySetFunc = "data"; var setFunc = function (value) { obj.verifySetFunc = value; @@ -34,10 +31,6 @@ function testcase() { var propertyDefineCorrect = obj.hasOwnProperty("0"); var desc = Object.getOwnPropertyDescriptor(obj, "0"); - return propertyDefineCorrect && desc.set === setFunc && obj[0] === "overrideData"; - } finally { - delete obj[0]; - delete obj.verifySetFunc; - } - } -runTestCase(testcase); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.set, setFunc, 'desc.set'); +assert.sameValue(obj[0], "overrideData", 'obj[0]'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-531-8.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-531-8.js index a39afa763..610532c9c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-531-8.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-531-8.js @@ -13,7 +13,7 @@ includes: ---*/ var obj = fnGlobalObject(); -try { + obj.verifySetFunc = "data"; var getFunc = function () { return obj.verifySetFunc; @@ -31,7 +31,3 @@ try { verifyNotWritable(obj, "prop"); assert.sameValue(typeof desc.set, "undefined"); assert.sameValue(obj.prop, "data"); -} finally { - delete obj.prop; - delete obj.verifySetFunc; -} diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-578.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-578.js index f90c6ff42..eee9a7cfe 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-578.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-578.js @@ -6,12 +6,10 @@ es5id: 15.2.3.6-4-578 description: > ES5 Attributes - [[Get]] field of inherited property of [[Prototype]] internal property is correct (String instance) -includes: [runTestCase.js] ---*/ -function testcase() { var data = "data"; - try { + Object.defineProperty(String.prototype, "prop", { get: function () { return data; @@ -24,9 +22,5 @@ function testcase() { }); var strObj = new String(); - return !strObj.hasOwnProperty("prop") && strObj.prop === "data"; - } finally { - delete String.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(strObj.hasOwnProperty("prop"), false, 'strObj.hasOwnProperty("prop")'); +assert.sameValue(strObj.prop, "data", 'strObj.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-579.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-579.js index dab54da13..e910f3335 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-579.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-579.js @@ -6,12 +6,10 @@ es5id: 15.2.3.6-4-579 description: > ES5 Attributes - Success to add property into object (Array instance) -includes: [runTestCase.js] ---*/ -function testcase() { var data = "data"; - try { + Object.defineProperty(Array.prototype, "prop", { get: function () { return data; @@ -25,9 +23,6 @@ function testcase() { var arrObj = []; arrObj.prop = "myOwnProperty"; - return !arrObj.hasOwnProperty("prop") && arrObj.prop === "myOwnProperty" && data === "myOwnProperty"; - } finally { - delete Array.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(arrObj.hasOwnProperty("prop"), false, 'arrObj.hasOwnProperty("prop")'); +assert.sameValue(arrObj.prop, "myOwnProperty", 'arrObj.prop'); +assert.sameValue(data, "myOwnProperty", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-580.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-580.js index 8fd5bd6b1..d4c99db07 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-580.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-580.js @@ -6,12 +6,10 @@ es5id: 15.2.3.6-4-580 description: > ES5 Attributes - Inherited property is enumerable (Boolean instance) -includes: [runTestCase.js] ---*/ -function testcase() { var data = "data"; - try { + Object.defineProperty(Boolean.prototype, "prop", { get: function () { return data; @@ -30,9 +28,5 @@ function testcase() { } } - return !boolObj.hasOwnProperty("prop") && verifyEnumerable; - } finally { - delete Boolean.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(boolObj.hasOwnProperty("prop"), false, 'boolObj.hasOwnProperty("prop")'); +assert(verifyEnumerable, 'verifyEnumerable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-581.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-581.js index 478e76009..2931f9c8f 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-581.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-581.js @@ -8,7 +8,7 @@ includes: [propertyHelper.js] ---*/ var data = "data"; -try { + Object.defineProperty(Number.prototype, "prop", { get: function () { return data; @@ -23,6 +23,3 @@ try { assert(!numObj.hasOwnProperty("prop")); assert.sameValue(numObj.prop, "data"); assert.sameValue(data, "data"); -} finally { - delete Number.prototype.prop; -} diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-582.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-582.js index ee7a5d0c9..7895b7455 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-582.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-582.js @@ -6,12 +6,10 @@ es5id: 15.2.3.6-4-582 description: > ES5 Attributes - Inherited property is non-enumerable (Function instance) -includes: [runTestCase.js] ---*/ -function testcase() { var data = "data"; - try { + Object.defineProperty(Function.prototype, "prop", { get: function () { return data; @@ -27,9 +25,5 @@ function testcase() { } } - return !funObj.hasOwnProperty("prop") && !verifyEnumerable; - } finally { - delete Function.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(funObj.hasOwnProperty("prop"), false, 'funObj.hasOwnProperty("prop")'); +assert.sameValue(verifyEnumerable, false, 'verifyEnumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-583.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-583.js index 4c765944c..97b7352fd 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-583.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-583.js @@ -6,12 +6,10 @@ es5id: 15.2.3.6-4-583 description: > ES5 Attributes - [[Get]] field of inherited property of [[Prototype]] internal property is correct (Error Instance) -includes: [runTestCase.js] ---*/ -function testcase() { var data = "data"; - try { + Object.defineProperty(Error.prototype, "prop", { get: function () { return data; @@ -24,9 +22,5 @@ function testcase() { }); var errObj = new Error(); - return !errObj.hasOwnProperty("prop") && errObj.prop === "data"; - } finally { - delete Error.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(errObj.hasOwnProperty("prop"), false, 'errObj.hasOwnProperty("prop")'); +assert.sameValue(errObj.prop, "data", 'errObj.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-584.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-584.js index 7b8241f0f..716431a7b 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-584.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-584.js @@ -4,12 +4,10 @@ /*--- es5id: 15.2.3.6-4-584 description: ES5 Attributes - Failed to add property into object (Date instance) -includes: [runTestCase.js] ---*/ -function testcase() { var data = "data"; - try { + Object.defineProperty(Date.prototype, "prop", { get: function () { return data; @@ -23,9 +21,6 @@ function testcase() { var dateObj = new Date(); dateObj.prop = "myOwnProperty"; - return !dateObj.hasOwnProperty("prop") && dateObj.prop === "myOwnProperty" && data === "myOwnProperty"; - } finally { - delete Date.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(dateObj.hasOwnProperty("prop"), false, 'dateObj.hasOwnProperty("prop")'); +assert.sameValue(dateObj.prop, "myOwnProperty", 'dateObj.prop'); +assert.sameValue(data, "myOwnProperty", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-585.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-585.js index 4b0699022..b58e59416 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-585.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-585.js @@ -4,12 +4,10 @@ /*--- es5id: 15.2.3.6-4-585 description: ES5 Attributes - Inherited property is enumerable (RegExp instance) -includes: [runTestCase.js] ---*/ -function testcase() { var data = "data"; - try { + Object.defineProperty(RegExp.prototype, "prop", { get: function () { return data; @@ -28,9 +26,5 @@ function testcase() { } } - return !regObj.hasOwnProperty("prop") && verifyEnumerable; - } finally { - delete RegExp.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(regObj.hasOwnProperty("prop"), false, 'regObj.hasOwnProperty("prop")'); +assert(verifyEnumerable, 'verifyEnumerable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-586.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-586.js index f10dbde3a..37c718de9 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-586.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-586.js @@ -10,7 +10,7 @@ includes: [propertyHelper.js] ---*/ var data = "data"; -try { + Object.defineProperty(Object.prototype, "prop", { get: function () { return data; @@ -23,6 +23,3 @@ try { assert(!JSON.hasOwnProperty("prop")); assert.sameValue(JSON.prop, "data"); assert.sameValue(data, "data"); -} finally { - delete Object.prototype.prop; -} diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-587.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-587.js index 911768de1..441dfe023 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-587.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-587.js @@ -4,12 +4,10 @@ /*--- es5id: 15.2.3.6-4-587 description: ES5 Attributes - Inherited property is non-enumerable (Math) -includes: [runTestCase.js] ---*/ -function testcase() { var data = "data"; - try { + Object.defineProperty(Object.prototype, "prop", { get: function () { return data; @@ -24,9 +22,5 @@ function testcase() { } } - return !Math.hasOwnProperty("prop") && !verifyEnumerable; - } finally { - delete Object.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(Math.hasOwnProperty("prop"), false, 'Math.hasOwnProperty("prop")'); +assert.sameValue(verifyEnumerable, false, 'verifyEnumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-593.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-593.js index 558c90b47..877f17efb 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-593.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-593.js @@ -7,13 +7,11 @@ description: > ES5 Attributes - [[Get]] field of inherited property of [[Prototype]] internal property is correct (Function.prototype.bind) -includes: [runTestCase.js] ---*/ -function testcase() { var foo = function () { }; var data = "data"; - try { + Object.defineProperty(Function.prototype, "prop", { get: function () { return data; @@ -27,9 +25,5 @@ function testcase() { var obj = foo.bind({}); - return !obj.hasOwnProperty("prop") && obj.prop === data; - } finally { - delete Function.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(obj.hasOwnProperty("prop"), false, 'obj.hasOwnProperty("prop")'); +assert.sameValue(obj.prop, data, 'obj.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-594.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-594.js index 6fe125ff1..8d5726679 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-594.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-594.js @@ -6,13 +6,11 @@ es5id: 15.2.3.6-4-594 description: > ES5 Attributes - Success to update value of property into of [[Proptotype]] internal property (Function.prototype.bind) -includes: [runTestCase.js] ---*/ -function testcase() { var foo = function () { }; var data = "data"; - try { + Object.defineProperty(Function.prototype, "prop", { get: function () { return data; @@ -27,9 +25,5 @@ function testcase() { var obj = foo.bind({}); obj.prop = "overrideData"; - return !obj.hasOwnProperty("prop") && obj.prop === "overrideData"; - } finally { - delete Function.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(obj.hasOwnProperty("prop"), false, 'obj.hasOwnProperty("prop")'); +assert.sameValue(obj.prop, "overrideData", 'obj.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-595.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-595.js index 30be14f7a..2f800ac1c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-595.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-595.js @@ -6,13 +6,11 @@ es5id: 15.2.3.6-4-595 description: > ES5 Attributes - Inherited property is enumerable (Function.prototype.bind) -includes: [runTestCase.js] ---*/ -function testcase() { var foo = function () { }; var data = "data"; - try { + Object.defineProperty(Function.prototype, "prop", { get: function () { return data; @@ -33,9 +31,5 @@ function testcase() { } } - return !obj.hasOwnProperty("prop") && verifyEnumerable; - } finally { - delete Function.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(obj.hasOwnProperty("prop"), false, 'obj.hasOwnProperty("prop")'); +assert(verifyEnumerable, 'verifyEnumerable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-596.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-596.js index 8c99225e0..5489deaa0 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-596.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-596.js @@ -11,7 +11,7 @@ includes: [propertyHelper.js] var foo = function () { }; var data = "data"; -try { + Object.defineProperty(Function.prototype, "prop", { get: function () { return data; @@ -25,6 +25,3 @@ try { assert(!obj.hasOwnProperty("prop")); verifyNotWritable(obj, "prop", "nocheck"); assert.sameValue(obj.prop, "data");; -} finally { - delete Function.prototype.prop; -} diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-597.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-597.js index 81c4daa17..9a46c54cd 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-597.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-597.js @@ -6,13 +6,11 @@ es5id: 15.2.3.6-4-597 description: > ES5 Attributes - Inherited property is non-enumerable (Function.prototype.bind) -includes: [runTestCase.js] ---*/ -function testcase() { var foo = function () { }; var data = "data"; - try { + Object.defineProperty(Function.prototype, "prop", { get: function () { return data; @@ -30,9 +28,5 @@ function testcase() { } } - return !obj.hasOwnProperty("prop") && !verifyEnumerable; - } finally { - delete Function.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(obj.hasOwnProperty("prop"), false, 'obj.hasOwnProperty("prop")'); +assert.sameValue(verifyEnumerable, false, 'verifyEnumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-598.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-598.js index 640eb9e6e..55420c69f 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-598.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-598.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-598 description: > ES5 Attributes - all attributes in Object.getPrototypeOf are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "getPrototypeOf"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.getPrototypeOf; - try { Object.getPrototypeOf = "2010"; var isWritable = (Object.getPrototypeOf === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("getPrototypeOf"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "getPrototypeOf", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-599.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-599.js index 03b2f21f7..00e61a739 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-599.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-599.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-599 description: > ES5 Attributes - all attributes in Object.getOwnPropertyDescriptor are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "getOwnPropertyDescriptor"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.getOwnPropertyDescriptor; - try { Object.getOwnPropertyDescriptor = "2010"; var isWritable = (Object.getOwnPropertyDescriptor === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("getOwnPropertyDescriptor"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "getOwnPropertyDescriptor", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-600.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-600.js index ad0ab1994..7f1ab0b27 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-600.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-600.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-600 description: > ES5 Attributes - all attributes in Object.getOwnPropertyNames are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "getOwnPropertyNames"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.getOwnPropertyNames; - try { Object.getOwnPropertyNames = "2010"; var isWritable = (Object.getOwnPropertyNames === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("getOwnPropertyNames"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "getOwnPropertyNames", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-601.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-601.js index 52108e4df..b9bcd8dc3 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-601.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-601.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-601 description: ES5 Attributes - all attributes in Object.create are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "create"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.create; - try { Object.create = "2010"; var isWritable = (Object.create === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("create"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "create", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-602.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-602.js index 6fd4a3d95..d2f6f0de2 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-602.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-602.js @@ -6,15 +6,13 @@ es5id: 15.2.3.6-4-602 description: > ES5 Attributes - all attributes in Object.defineProperty are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "defineProperty"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.defineProperty; - try { + Object.defineProperty = "2010"; var isWritable = (Object.defineProperty === "2010"); @@ -31,12 +29,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("defineProperty"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty = temp; - Object.defineProperty(Object, "defineProperty", { - enumerable: false - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-603.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-603.js index 542f3b58e..7959a39ee 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-603.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-603.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-603 description: > ES5 Attributes - all attributes in Object.defineProperties are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "defineProperties"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.defineProperties; - try { Object.defineProperties = "2010"; var isWritable = (Object.defineProperties === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("defineProperties"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "defineProperties", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-604.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-604.js index c008b7363..497ebad75 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-604.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-604.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-604 description: ES5 Attributes - all attributes in Object.seal are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "seal"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.seal; - try { Object.seal = "2010"; var isWritable = (Object.seal === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("seal"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "seal", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-605.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-605.js index a9a897e8f..45952f26c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-605.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-605.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-605 description: ES5 Attributes - all attributes in Object.freeze are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "freeze"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.freeze; - try { Object.freeze = "2010"; var isWritable = (Object.freeze === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("freeze"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "freeze", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-606.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-606.js index 471a8a7db..a3621fdd1 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-606.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-606.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-606 description: > ES5 Attributes - all attributes in Object.preventExtensions are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "preventExtensions"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.preventExtensions; - try { Object.preventExtensions = "2010"; var isWritable = (Object.preventExtensions === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("preventExtensions"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "preventExtensions", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-607.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-607.js index 580052300..88beb3e67 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-607.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-607.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-607 description: ES5 Attributes - all attributes in Object.isSealed are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "isSealed"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.isSealed; - try { Object.isSealed = "2010"; var isWritable = (Object.isSealed === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("isSealed"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "isSealed", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-608.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-608.js index cde4a901b..f752bc678 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-608.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-608.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-608 description: ES5 Attributes - all attributes in Object.isFrozen are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "isFrozen"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.isFrozen; - try { Object.isFrozen = "2010"; var isWritable = (Object.isFrozen === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("isFrozen"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "isFrozen", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-609.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-609.js index 43ad1010e..aa12befa7 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-609.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-609.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-609 description: ES5 Attributes - all attributes in Object.isExtensible are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "isExtensible"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.isExtensible; - try { Object.isExtensible = "2010"; var isWritable = (Object.isExtensible === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("isExtensible"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "isExtensible", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-610.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-610.js index e8b2403df..07cc6c4d8 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-610.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-610.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-610 description: ES5 Attributes - all attributes in Object.keys are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "keys"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.keys; - try { Object.keys = "2010"; var isWritable = (Object.keys === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("keys"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "keys", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-611.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-611.js index 949e52fad..aa0a5b9ce 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-611.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-611.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-611 description: > ES5 Attributes - all attributes in Function.prototype.bind are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Function.prototype, "bind"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Function.prototype.bind; - try { Function.prototype.bind = "2010"; var isWritable = (Function.prototype.bind === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Function.prototype.hasOwnProperty("bind"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Function.prototype, "bind", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-612.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-612.js index 3378d1497..74ff9cba3 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-612.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-612.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-612 description: > ES5 Attributes - all attributes in Array.prototype.indexOf are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Array.prototype, "indexOf"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Array.prototype.indexOf; - try { Array.prototype.indexOf = "2010"; var isWritable = (Array.prototype.indexOf === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Array.prototype.hasOwnProperty("indexOf"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Array.prototype, "indexOf", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-613.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-613.js index 8d179d0b2..58bf1afa6 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-613.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-613.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-613 description: ES5 Attributes - all attributes in Object.lastIndexOf are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Array.prototype, "lastIndexOf"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Array.prototype.lastIndexOf; - try { Array.prototype.lastIndexOf = "2010"; var isWritable = (Array.prototype.lastIndexOf === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Array.prototype.hasOwnProperty("lastIndexOf"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Array.prototype, "lastIndexOf", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-614.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-614.js index f4ee4f588..cd393df4c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-614.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-614.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-614 description: > ES5 Attributes - all attributes in Array.prototype.every are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Array.prototype, "every"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Array.prototype.every; - try { Array.prototype.every = "2010"; var isWritable = (Array.prototype.every === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Array.prototype.hasOwnProperty("every"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Array.prototype, "every", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-615.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-615.js index c93ce2921..172758c2c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-615.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-615.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-615 description: ES5 Attributes - all attributes in Array.prototype.some are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Array.prototype, "some"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Array.prototype.some; - try { Array.prototype.some = "2010"; var isWritable = (Array.prototype.some === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Array.prototype.hasOwnProperty("some"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Array.prototype, "some", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-616.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-616.js index e922be1de..4a53ab993 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-616.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-616.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-616 description: > ES5 Attributes - all attributes in Array.prototype.forEach are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Array.prototype, "forEach"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Array.prototype.forEach; - try { Array.prototype.forEach = "2010"; var isWritable = (Array.prototype.forEach === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Array.prototype.hasOwnProperty("forEach"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Array.prototype, "forEach", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-617.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-617.js index e361a7aee..7e41f46c4 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-617.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-617.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-617 description: ES5 Attributes - all attributes in Array.prototype.map are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Array.prototype, "map"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Array.prototype.map; - try { Array.prototype.map = "2010"; var isWritable = (Array.prototype.map === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Array.prototype.hasOwnProperty("map"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Array.prototype, "map", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-618.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-618.js index 6685458f0..27492e2e3 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-618.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-618.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-618 description: > ES5 Attributes - all attributes in Array.prototype.filter are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Array.prototype, "filter"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Array.prototype.filter; - try { Array.prototype.filter = "2010"; var isWritable = (Array.prototype.filter === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Array.prototype.hasOwnProperty("filter"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Array.prototype, "filter", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-619.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-619.js index d0788918c..408f1417d 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-619.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-619.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-619 description: > ES5 Attributes - all attributes in Array.prototype.reduce are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Array.prototype, "reduce"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Array.prototype.reduce; - try { Array.prototype.reduce = "2010"; var isWritable = (Array.prototype.reduce === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Array.prototype.hasOwnProperty("reduce"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Array.prototype, "reduce", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-620.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-620.js index 8afc75751..e2a9f56f5 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-620.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-620.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-620 description: > ES5 Attributes - all attributes in Array.prototype.reduceRight are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Array.prototype, "reduceRight"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Array.prototype.reduceRight; - try { Array.prototype.reduceRight = "2010"; var isWritable = (Array.prototype.reduceRight === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Array.prototype.hasOwnProperty("reduceRight"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Array.prototype, "reduceRight", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-621.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-621.js index 273168780..b7e2ebf5c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-621.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-621.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-621 description: > ES5 Attributes - all attributes in String.prototype.trim are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(String.prototype, "trim"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = String.prototype.trim; - try { String.prototype.trim = "2010"; var isWritable = (String.prototype.trim === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !String.prototype.hasOwnProperty("trim"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(String.prototype, "trim", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-622.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-622.js index 6ca6f94ce..c587d33d4 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-622.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-622.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-622 description: ES5 Attributes - all attributes in Date.now are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Date, "now"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Date.now; - try { Date.now = "2010"; var isWritable = (Date.now === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Date.hasOwnProperty("now"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Date, "now", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-623.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-623.js index d1374fdae..f96eb0c02 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-623.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-623.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-623 description: > ES5 Attributes - all attributes in Date.prototype.toISOString are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Date.prototype, "toISOString"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Date.prototype.toISOString; - try { Date.prototype.toISOString = "2010"; var isWritable = (Date.prototype.toISOString === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Date.prototype.hasOwnProperty("toISOString"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Date.prototype, "toISOString", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-624.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-624.js index c8515ada1..5b6abba13 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-624.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-624.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-624 description: > ES5 Attributes - all attributes in Date.prototype.toJSON are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Date.prototype, "toJSON"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Date.prototype.toJSON; - try { Date.prototype.toJSON = "2010"; var isWritable = (Date.prototype.toJSON === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Date.prototype.hasOwnProperty("toJSON"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Date.prototype, "toJSON", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-2-4.js b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-2-4.js index 8401f8ad7..fd42435c7 100644 --- a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-2-4.js +++ b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-2-4.js @@ -6,23 +6,15 @@ es5id: 15.2.3.4-2-4 description: > Object.getOwnPropertyNames - returned array is the standard built-in constructor -includes: [runTestCase.js] ---*/ -function testcase() { var oldArray = Array; Array = function () { throw new Error("invoke customer defined Array!"); }; var obj = {}; - try { + var result = Object.getOwnPropertyNames(obj); - return Object.prototype.toString.call(result) === "[object Array]"; - } catch (ex) { - return false; - } finally { - Array = oldArray; - } - } -runTestCase(testcase); + +assert.sameValue(Object.prototype.toString.call(result), "[object Array]", 'Object.prototype.toString.call(result)'); |