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/defineProperty | |
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/defineProperty')
155 files changed, 420 insertions, 1531 deletions
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'); |