diff options
521 files changed, 1267 insertions, 5328 deletions
diff --git a/test/built-ins/Array/prototype/concat/15.4.4.4-5-b-iii-3-b-1.js b/test/built-ins/Array/prototype/concat/15.4.4.4-5-b-iii-3-b-1.js index 6213da000..5d7c7ad6a 100644 --- a/test/built-ins/Array/prototype/concat/15.4.4.4-5-b-iii-3-b-1.js +++ b/test/built-ins/Array/prototype/concat/15.4.4.4-5-b-iii-3-b-1.js @@ -6,11 +6,8 @@ es5id: 15.4.4.4-5-b-iii-3-b-1 description: > Array.prototype.concat will concat an Array when index property (read-only) exists in Array.prototype (Step 5.b.iii.3.b) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { value: 100, writable: false, @@ -39,9 +36,7 @@ function testcase() { delete newArr[0]; verifyConfigurable = newArr.hasOwnProperty("0"); - return verifyValue && !verifyConfigurable && verifyEnumerable && verifyWritable; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(verifyValue, 'verifyValue !== true'); +assert.sameValue(verifyConfigurable, false, 'verifyConfigurable'); +assert(verifyEnumerable, 'verifyEnumerable !== true'); +assert(verifyWritable, 'verifyWritable !== true'); diff --git a/test/built-ins/Array/prototype/concat/15.4.4.4-5-c-i-1.js b/test/built-ins/Array/prototype/concat/15.4.4.4-5-c-i-1.js index f9b0a95d1..ffbe3c161 100644 --- a/test/built-ins/Array/prototype/concat/15.4.4.4-5-c-i-1.js +++ b/test/built-ins/Array/prototype/concat/15.4.4.4-5-c-i-1.js @@ -6,11 +6,8 @@ es5id: 15.4.4.4-5-c-i-1 description: > Array.prototype.concat will concat an Array when index property (read-only) exists in Array.prototype (Step 5.c.i) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { value: 100, writable: false, @@ -41,11 +38,9 @@ function testcase() { delete newArr[0]; verifyConfigurable = newArr.hasOwnProperty("0"); - return hasProperty && instanceOfVerify && verifyValue && !verifyConfigurable && verifyEnumerable && verifyWritable; - - - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(hasProperty, 'hasProperty !== true'); +assert(instanceOfVerify, 'instanceOfVerify !== true'); +assert(verifyValue, 'verifyValue !== true'); +assert.sameValue(verifyConfigurable, false, 'verifyConfigurable'); +assert(verifyEnumerable, 'verifyEnumerable !== true'); +assert(verifyWritable, 'verifyWritable !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-1-10.js b/test/built-ins/Array/prototype/every/15.4.4.16-1-10.js index eae3883e3..862cc5806 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-1-10.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-1-10.js @@ -4,21 +4,13 @@ /*--- es5id: 15.4.4.16-1-10 description: Array.prototype.every applied to the Math object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return ('[object Math]' !== Object.prototype.toString.call(obj)); } - try { Math.length = 1; Math[0] = 1; - return !Array.prototype.every.call(Math, callbackfn); - } finally { - delete Math[0]; - delete Math.length; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.every.call(Math, callbackfn), false, 'Array.prototype.every.call(Math, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-1-13.js b/test/built-ins/Array/prototype/every/15.4.4.16-1-13.js index a3ef08822..99a2a65c9 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-1-13.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-1-13.js @@ -4,21 +4,13 @@ /*--- es5id: 15.4.4.16-1-13 description: Array.prototype.every applied to the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return ('[object JSON]' !== Object.prototype.toString.call(obj)); } - try { JSON.length = 1; JSON[0] = 1; - return !Array.prototype.every.call(JSON, callbackfn); - } finally { - delete JSON.length; - delete JSON[0]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.every.call(JSON, callbackfn), false, 'Array.prototype.every.call(JSON, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-1-3.js b/test/built-ins/Array/prototype/every/15.4.4.16-1-3.js index 63ec4d5ce..f0aa17de3 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-1-3.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-1-3.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.16-1-3 description: Array.prototype.every applied to boolean primitive -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -16,13 +13,8 @@ function testcase() { return obj instanceof Boolean; } - try { Boolean.prototype[0] = 1; Boolean.prototype.length = 1; - return Array.prototype.every.call(false, callbackfn) && accessed; - } finally { - delete Boolean.prototype[0]; - delete Boolean.prototype.length; - } - } -runTestCase(testcase); + +assert(Array.prototype.every.call(false, callbackfn), 'Array.prototype.every.call(false, callbackfn) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-1-5.js b/test/built-ins/Array/prototype/every/15.4.4.16-1-5.js index 894af85c4..1cb763223 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-1-5.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-1-5.js @@ -4,23 +4,16 @@ /*--- es5id: 15.4.4.16-1-5 description: Array.prototype.every applied to number primitive -includes: [runTestCase.js] ---*/ -function testcase() { var accessed = false; function callbackfn(val, idx, obj) { accessed = true; return obj instanceof Number; } - try { Number.prototype[0] = 1; Number.prototype.length = 1; - return Array.prototype.every.call(2.5, callbackfn) && accessed; - } finally { - delete Number.prototype[0]; - delete Number.prototype.length; - } - } -runTestCase(testcase); + +assert(Array.prototype.every.call(2.5, callbackfn), 'Array.prototype.every.call(2.5, callbackfn) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-12.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-12.js index 0fa99092d..b6c2fbf28 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-12.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-12.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-2-12 description: > Array.prototype.every - 'length' is own accessor property without a get function that overrides an inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { var accessed = false; function callbackfn(val, idx, obj) { @@ -17,7 +15,6 @@ function testcase() { return val > 10; } - try { Object.defineProperty(Object.prototype, "length", { get: function () { return 2; @@ -31,10 +28,5 @@ function testcase() { configurable: true }); - return Array.prototype.every.call(obj, callbackfn) && !accessed; - } finally { - delete Object.prototype.length; - } - - } -runTestCase(testcase); +assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-15.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-15.js index d6770afeb..e8e4f7111 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-15.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-15.js @@ -4,12 +4,9 @@ /*--- es5id: 15.4.4.16-2-15 description: Array.prototype.every - 'length' is property of the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { function callbackfn1(val, idx, obj) { return val > 10; } @@ -18,19 +15,11 @@ function testcase() { return val > 11; } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 12; fnGlobalObject()[1] = 11; fnGlobalObject()[2] = 9; fnGlobalObject().length = 2; - return Array.prototype.every.call(fnGlobalObject(), callbackfn1) && - !Array.prototype.every.call(fnGlobalObject(), callbackfn2); - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert(Array.prototype.every.call(fnGlobalObject(), callbackfn1), 'Array.prototype.every.call(fnGlobalObject(), callbackfn1) !== true'); +assert.sameValue(Array.prototype.every.call(fnGlobalObject(), callbackfn2), false, 'Array.prototype.every.call(fnGlobalObject(), callbackfn2)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-18.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-18.js index c0fdf9bfa..de0fb94e0 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-18.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-18.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-2-18 description: > Array.prototype.every applied to String object, which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn1(val, idx, obj) { return parseInt(val, 10) > 1; } @@ -19,12 +17,8 @@ function testcase() { } var str = new String("432"); - try { + String.prototype[3] = "1"; - return Array.prototype.every.call(str, callbackfn1) && - !Array.prototype.every.call(str, callbackfn2); - } finally { - delete String.prototype[3]; - } - } -runTestCase(testcase); + +assert(Array.prototype.every.call(str, callbackfn1), 'Array.prototype.every.call(str, callbackfn1) !== true'); +assert.sameValue(Array.prototype.every.call(str, callbackfn2), false, 'Array.prototype.every.call(str, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-2.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-2.js index d0fac1906..c9a1d4459 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-2.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-2.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.16-2-2 description: Array.prototype.every - 'length' is own data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn1(val, idx, obj) { return val > 10; } @@ -16,13 +14,7 @@ function testcase() { return val > 11; } - try { Array.prototype[2] = 9; - return [12, 11].every(callbackfn1) && - ![12, 11].every(callbackfn2); - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert([12, 11].every(callbackfn1), '[12, 11].every(callbackfn1) !== true'); +assert.sameValue([12, 11].every(callbackfn2), false, '[12, 11].every(callbackfn2)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-4.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-4.js index b034070d9..1538d8c71 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-4.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-4.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-2-4 description: > Array.prototype.every - 'length' is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var arrProtoLen = 0; function callbackfn1(val, idx, obj) { return val > 10; @@ -19,17 +17,9 @@ function testcase() { return val > 11; } - try { arrProtoLen = Array.prototype.length; Array.prototype.length = 0; Array.prototype[2] = 9; - return [12, 11].every(callbackfn1) && - ![12, 11].every(callbackfn2); - } finally { - Array.prototype.length = arrProtoLen; - delete Array.prototype[2]; - } - - } -runTestCase(testcase); +assert([12, 11].every(callbackfn1), '[12, 11].every(callbackfn1) !== true'); +assert.sameValue([12, 11].every(callbackfn2), false, '[12, 11].every(callbackfn2)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-10.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-10.js index 6143011cb..938d3ba2b 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-10.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-10.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-7-b-10 description: > Array.prototype.every - deleting property of prototype causes prototype index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { var accessed = false; function callbackfn(val, idx, obj) { accessed = true; @@ -25,11 +23,7 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; - return Array.prototype.every.call(arr, callbackfn) && accessed; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(Array.prototype.every.call(arr, callbackfn), 'Array.prototype.every.call(arr, callbackfn) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-11.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-11.js index 88fa11342..8bd0b1c8e 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-11.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-11.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-7-b-11 description: > Array.prototype.every - deleting property of prototype causes prototype index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var accessed = false; function callbackfn(val, idx, obj) { accessed = true; @@ -25,11 +23,7 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; - return arr.every(callbackfn) && accessed; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(arr.every(callbackfn), 'arr.every(callbackfn) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-12.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-12.js index 27a3ee00b..6c2fecf4a 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-12.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-12.js @@ -7,10 +7,8 @@ description: > Array.prototype.every - deleting own property with prototype property causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 1) { return false; @@ -28,11 +26,6 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; - return !Array.prototype.every.call(arr, callbackfn); - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.every.call(arr, callbackfn), false, 'Array.prototype.every.call(arr, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-13.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-13.js index 62ee94646..868218c95 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-13.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-13.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-7-b-13 description: > Array.prototype.every - deleting own property with prototype property causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 1) { return false; @@ -27,11 +25,6 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; - return !arr.every(callbackfn); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-15.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-15.js index 49aef9a9c..4696de85a 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-15.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-15.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-7-b-15 description: > Array.prototype.every - decreasing length of array with prototype property causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 2 && val === "prototype") { return false; @@ -19,7 +17,6 @@ function testcase() { } var arr = [0, 1, 2]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -35,9 +32,4 @@ function testcase() { configurable: true }); - return !arr.every(callbackfn); - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-6.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-6.js index ee189be49..a3e937b83 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-6.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-6.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-7-b-6 description: > Array.prototype.every - properties can be added to prototype after current position are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 6.99) { return false; @@ -32,10 +30,4 @@ function testcase() { configurable: true }); - try { - return !Array.prototype.every.call(arr, callbackfn); - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.every.call(arr, callbackfn), false, 'Array.prototype.every.call(arr, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-7.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-7.js index f1f40c869..1ce29f83d 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-7.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-7.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-7-b-7 description: > Array.prototype.every - properties can be added to prototype after current position are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 6.99) { return false; @@ -32,10 +30,4 @@ function testcase() { configurable: true }); - try { - return !arr.every(callbackfn); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-12.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-12.js index 6d75b595c..19bb52286 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-12.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-12.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-7-c-i-12 description: > Array.prototype.every - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 0) { return val === 10; @@ -19,7 +17,7 @@ function testcase() { } var arr = []; - try { + Array.prototype[0] = 10; Object.defineProperty(arr, "0", { @@ -29,9 +27,4 @@ function testcase() { configurable: true }); - return !arr.every(callbackfn); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-14.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-14.js index 46ee18b94..6e7c7cc88 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-14.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.16-7-c-i-14 description: > Array.prototype.every - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 0) { return val === 5; @@ -20,7 +17,7 @@ function testcase() { } var arr = []; - try { + Object.defineProperty(Array.prototype, "0", { get: function () { return 5; @@ -35,9 +32,4 @@ function testcase() { configurable: true }); - return !arr.every(callbackfn); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-16.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-16.js index 083f71cc3..532ff09de 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-16.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-16.js @@ -6,11 +6,8 @@ es5id: 15.4.4.16-7-c-i-16 description: > Array.prototype.every - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 0) { return val !== 11; @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 11; @@ -27,9 +23,4 @@ function testcase() { configurable: true }); - return ![, , , ].every(callbackfn); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue([, , , ].every(callbackfn), false, '[, , , ].every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-19.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-19.js index ccc919361..88fffa5ce 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-19.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.every - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -24,11 +21,8 @@ function testcase() { set: function () { }, configurable: true }); - try { + Object.prototype[1] = 10; - return Array.prototype.every.call(obj, callbackfn) && accessed; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-20.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-20.js index b4d136af2..4a98ce795 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-20.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-20.js @@ -7,11 +7,8 @@ description: > Array.prototype.every - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -26,11 +23,7 @@ function testcase() { configurable: true }); - try { Array.prototype[0] = 100; - return arr.every(callbackfn) && accessed; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert(arr.every(callbackfn), 'arr.every(callbackfn) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-22.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-22.js index b45076a25..0fbf17c5f 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-22.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.16-7-c-i-22 description: > Array.prototype.every - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -18,16 +15,10 @@ function testcase() { return typeof val === "undefined"; } - try { Object.defineProperty(Array.prototype, "0", { set: function () { }, configurable: true }); - return [, ].every(callbackfn) && accessed; - } finally { - delete Array.prototype[0]; - } - - } -runTestCase(testcase); +assert([, ].every(callbackfn), '[, ].every(callbackfn) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-23.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-23.js index 84d1818f7..5dcc93e3a 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-23.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-23.js @@ -6,13 +6,9 @@ es5id: 15.4.4.16-7-c-i-23 description: > Array.prototype.every - This object is an global object which contains index property -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 0) { return val !== 11; @@ -21,14 +17,8 @@ function testcase() { } } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 11; fnGlobalObject().length = 1; - return !Array.prototype.every.call(fnGlobalObject(), callbackfn); - } finally { - delete fnGlobalObject()[0]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.every.call(fnGlobalObject(), callbackfn), false, 'Array.prototype.every.call(fnGlobalObject(), callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-4.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-4.js index 4ca15dde7..dfdcc49eb 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-4.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-4.js @@ -6,24 +6,16 @@ es5id: 15.4.4.16-7-c-i-4 description: > Array.prototype.every - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var called = 0; function callbackfn(val, idx, obj) { called++; return val === 12; } - try { Array.prototype[0] = 11; Array.prototype[1] = 11; - return [12, 12].every(callbackfn) && called === 2; - } finally { - delete Array.prototype[0]; - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert([12, 12].every(callbackfn), '[12, 12].every(callbackfn) !== true'); +assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-6.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-6.js index a7dc6772a..58101ea15 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-6.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.16-7-c-i-6 description: > Array.prototype.every - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -18,16 +15,12 @@ function testcase() { return val === 11; } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 9; }, configurable: true }); - return [11].every(callbackfn) && accessed; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-8.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-8.js index 158d7d4cb..5122c0159 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-8.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.16-7-c-i-8 description: > Array.prototype.every - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 1) { return val !== 13; @@ -19,11 +16,6 @@ function testcase() { } } - try { Array.prototype[1] = 13; - return ![, , , ].every(callbackfn); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue([, , , ].every(callbackfn), false, '[, , , ].every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-10.js index f37a264d5..7e04a5d22 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-10.js @@ -4,22 +4,14 @@ /*--- es5id: 15.4.4.20-1-10 description: Array.prototype.filter applied to the Math object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return '[object Math]' === Object.prototype.toString.call(obj); } - try { Math.length = 1; Math[0] = 1; var newArr = Array.prototype.filter.call(Math, callbackfn); - return newArr[0] === 1; - } finally { - delete Math[0]; - delete Math.length; - } - } -runTestCase(testcase); + +assert.sameValue(newArr[0], 1, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-13.js index 5fe44bc8e..01d90636b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-13.js @@ -4,23 +4,14 @@ /*--- es5id: 15.4.4.20-1-13 description: Array.prototype.filter applied to the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return '[object JSON]' === Object.prototype.toString.call(JSON); } - try { JSON.length = 1; JSON[0] = 1; var newArr = Array.prototype.filter.call(JSON, callbackfn); - return newArr[0] === 1; - } finally { - delete JSON.length; - delete JSON[0]; - } - } -runTestCase(testcase); + +assert.sameValue(newArr[0], 1, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-3.js index e28ad21f8..206fc72ec 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-3.js @@ -4,24 +4,15 @@ /*--- es5id: 15.4.4.20-1-3 description: Array.prototype.filter applied to boolean primitive -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return obj instanceof Boolean; } - try { Boolean.prototype[0] = true; Boolean.prototype.length = 1; var newArr = Array.prototype.filter.call(false, callbackfn); - return newArr[0] === true; - } finally { - delete Boolean.prototype[0]; - delete Boolean.prototype.length; - } - } -runTestCase(testcase); +assert.sameValue(newArr[0], true, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-5.js index 57b05bfd7..2259c056e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-5.js @@ -4,23 +4,15 @@ /*--- es5id: 15.4.4.20-1-5 description: Array.prototype.filter applied to number primitive -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return obj instanceof Number; } - try { Number.prototype[0] = 1; Number.prototype.length = 1; var newArr = Array.prototype.filter.call(2.5, callbackfn); - return newArr[0] === 1; - } finally { - delete Number.prototype[0]; - delete Number.prototype.length; - } - } -runTestCase(testcase); + +assert.sameValue(newArr[0], 1, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-12.js index 7e2e1c9a8..d7feb9fe7 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-12.js @@ -6,18 +6,14 @@ es5id: 15.4.4.20-2-12 description: > Array.prototype.filter - 'length' is own accessor property without a get function that overrides an inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { accessed = true; return true; } - try { Object.defineProperty(Object.prototype, "length", { get: function () { return 2; @@ -32,9 +28,6 @@ function testcase() { }); var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 0 && !accessed; - } finally { - delete Object.prototype.length; - } - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-15.js index 0c1de8b5a..70ab8e9e4 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-15.js @@ -4,30 +4,18 @@ /*--- es5id: 15.4.4.20-2-15 description: Array.prototype.filter - 'length' is property of the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj.length === 2; } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 12; fnGlobalObject()[1] = 11; fnGlobalObject()[2] = 9; fnGlobalObject().length = 2; var newArr = Array.prototype.filter.call(fnGlobalObject(), callbackfn); - return newArr.length === 2; - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-4.js index f1e276c13..b36c82c11 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-4.js @@ -6,24 +6,16 @@ es5id: 15.4.4.20-2-4 description: > Array.prototype.filter - 'length' is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arrProtoLen; function callbackfn(val, idx, obj) { return obj.length === 2; } - try { arrProtoLen = Array.prototype.length; Array.prototype.length = 0; var newArr = [12, 11].filter(callbackfn); - return newArr.length === 2; - } finally { - Array.prototype.length = arrProtoLen; - } - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-10.js index 8f0117671..5a2b72963 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-10.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-b-10 description: > Array.prototype.filter - deleting property of prototype causes prototype index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -24,13 +21,8 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 2 && newArr[1] !== 1; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 2, 'newArr.length'); +assert.notSameValue(newArr[1], 1, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-11.js index 91d8425dc..c5beda40a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-11.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-b-11 description: > Array.prototype.filter - deleting property of prototype causes prototype index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -24,12 +21,8 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; var newArr = arr.filter(callbackfn); - return newArr.length === 2 && newArr[1] !== 1; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 2, 'newArr.length'); +assert.notSameValue(newArr[1], 1, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-12.js index 971d6fb1a..b2795b275 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-12.js @@ -7,10 +7,8 @@ description: > Array.prototype.filter - deleting own property with prototype property causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return true; } @@ -24,13 +22,8 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 3 && newArr[1] === 1; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 3, 'newArr.length'); +assert.sameValue(newArr[1], 1, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-13.js index a2c95dc80..1a6b93b3b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-13.js @@ -6,10 +6,8 @@ es5id: 15.4.4.20-9-b-13 description: > Array.prototype.filter - deleting own property with prototype property causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return val < 3 ? true : false; } @@ -23,13 +21,8 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; var newArr = arr.filter(callbackfn); - return newArr.length === 3 && newArr[1] === 1; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 3, 'newArr.length'); +assert.sameValue(newArr[1], 1, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-15.js index bfecbab57..6ec65a078 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-15.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-b-15 description: > Array.prototype.filter - decreasing length of array with prototype property causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return true; } var arr = [0, 1, 2]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -33,9 +30,5 @@ function testcase() { var newArr = arr.filter(callbackfn); - return newArr.length === 3 && newArr[2] === "prototype"; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 3, 'newArr.length'); +assert.sameValue(newArr[2], "prototype", 'newArr[2]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-6.js index fb6cb8546..0fe3fbe53 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-6.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-b-6 description: > Array.prototype.filter - properties can be added to prototype after current position are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return true; } var obj = { length: 2 }; - try { Object.defineProperty(obj, "0", { get: function () { Object.defineProperty(Object.prototype, "1", { @@ -31,9 +28,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 2 && Array[1] === 6.99; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 2, 'newArr.length'); +assert.sameValue(Array[1], 6.99, 'Array[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-7.js index 3f5425bdb..07895b968 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-7.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-b-7 description: > Array.prototype.filter - properties can be added to prototype after current position are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return true; } var arr = [0, , 2]; - try { Object.defineProperty(arr, "0", { get: function () { Object.defineProperty(Array.prototype, "1", { @@ -31,9 +28,5 @@ function testcase() { var newArr = arr.filter(callbackfn); - return newArr.length === 3 && newArr[1] === 6.99; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 3, 'newArr.length'); +assert.sameValue(newArr[1], 6.99, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-12.js index d5de9313b..53fa3c59c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-12.js @@ -6,16 +6,14 @@ es5id: 15.4.4.20-9-c-i-12 description: > Array.prototype.filter - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return val === 111 && idx === 0; } var arr = []; - try { + Array.prototype[0] = 10; Object.defineProperty(arr, "0", { @@ -26,9 +24,5 @@ function testcase() { }); var newArr = arr.filter(callbackfn); - return newArr.length === 1 && newArr[0] === 111; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 111, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-14.js index e1fc9a360..2dbcb59ca 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-14.js @@ -6,17 +6,14 @@ es5id: 15.4.4.20-9-c-i-14 description: > Array.prototype.filter - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return idx === 0 && val === 11; } var arr = []; - try { + Object.defineProperty(Array.prototype, "0", { get: function () { return 5; @@ -32,9 +29,5 @@ function testcase() { }); var newArr = arr.filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-16.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-16.js index bf19222a3..d2e1b6a8c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-16.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-16.js @@ -6,16 +6,12 @@ es5id: 15.4.4.20-9-c-i-16 description: > Array.prototype.filter - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return idx === 0 && val === 11; } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 11; @@ -24,9 +20,5 @@ function testcase() { }); var newArr = [, , , ].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-19.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-19.js index c376762f1..19f788941 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-19.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.filter - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return undefined === val && idx === 1; } @@ -21,13 +18,9 @@ function testcase() { set: function () { }, configurable: true }); - try { + Object.prototype[1] = 10; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === undefined; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-20.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-20.js index cab605947..347c1b2f0 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-20.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-20.js @@ -7,11 +7,8 @@ description: > Array.prototype.filter - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return undefined === val && idx === 0; } @@ -23,13 +20,8 @@ function testcase() { configurable: true }); - try { Array.prototype[0] = 100; var newArr = arr.filter(callbackfn); - return newArr.length === 1 && newArr[0] === undefined; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-22.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-22.js index 80dea66bc..f1aea69c8 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-22.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-22.js @@ -6,25 +6,17 @@ es5id: 15.4.4.20-9-c-i-22 description: > Array.prototype.filter - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return undefined === val && idx === 0; } - try { Object.defineProperty(Array.prototype, "0", { set: function () { }, configurable: true }); var newArr = [, ].filter(callbackfn); - return newArr.length === 1 && newArr[0] === undefined; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-23.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-23.js index 65c706585..a6a8070f5 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-23.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-23.js @@ -6,26 +6,17 @@ es5id: 15.4.4.20-9-c-i-23 description: > Array.prototype.filter - This object is the global object which contains index property -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return idx === 0 && val === 11; } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 11; fnGlobalObject().length = 1; var newArr = Array.prototype.filter.call(fnGlobalObject(), callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } finally { - delete fnGlobalObject()[0]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-4.js index 8a8df41e4..730f8e654 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-4.js @@ -6,22 +6,14 @@ es5id: 15.4.4.20-9-c-i-4 description: > Array.prototype.filter - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return (idx === 0) && (val === 12); } - try { Array.prototype[0] = 11; var newArr = [12].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 12; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 12, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-6.js index 60664f516..5442b2568 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-6.js @@ -6,16 +6,12 @@ es5id: 15.4.4.20-9-c-i-6 description: > Array.prototype.filter - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return val === 11; } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 9; @@ -24,9 +20,5 @@ function testcase() { }); var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-8.js index 461a5747e..24277b866 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-8.js @@ -6,22 +6,14 @@ es5id: 15.4.4.20-9-c-i-8 description: > Array.prototype.filter - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return (idx === 1) && (val === 13); } - try { Array.prototype[1] = 13; var newArr = [, , , ].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 13; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 13, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-10.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-10.js index 1075b71eb..aa3e95bc1 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-10.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-10.js @@ -4,24 +4,16 @@ /*--- es5id: 15.4.4.18-1-10 description: Array.prototype.forEach applied to the Math object -includes: [runTestCase.js] ---*/ -function testcase() { var result = false; function callbackfn(val, idx, obj) { result = ('[object Math]' === Object.prototype.toString.call(obj)); } - try { Math.length = 1; Math[0] = 1; Array.prototype.forEach.call(Math, callbackfn); - return result; - } finally { - delete Math[0]; - delete Math.length; - } - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-13.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-13.js index a8bd71089..f0a8a9fab 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-13.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-13.js @@ -4,23 +4,15 @@ /*--- es5id: 15.4.4.18-1-13 description: Array.prototype.forEach applied to the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { var result = false; function callbackfn(val, idx, obj) { result = ('[object JSON]' === Object.prototype.toString.call(obj)); } - try { JSON.length = 1; JSON[0] = 1; Array.prototype.forEach.call(JSON, callbackfn); - return result; - } finally { - delete JSON.length; - delete JSON[0]; - } - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-3.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-3.js index 39f15fb9d..a022e67fd 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-3.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-3.js @@ -4,26 +4,17 @@ /*--- es5id: 15.4.4.18-1-3 description: Array.prototype.forEach applied to boolean primitive -includes: [runTestCase.js] ---*/ -function testcase() { var result = false; function callbackfn(val, idx, obj) { result = obj instanceof Boolean; } - try { Boolean.prototype[0] = true; Boolean.prototype.length = 1; Array.prototype.forEach.call(false, callbackfn); - return result; - } finally { - delete Boolean.prototype[0]; - delete Boolean.prototype.length; - } - } -runTestCase(testcase); +assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-5.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-5.js index 1b5d8581d..1d91a9c25 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-5.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-5.js @@ -4,24 +4,16 @@ /*--- es5id: 15.4.4.18-1-5 description: Array.prototype.forEach applied to number primitive -includes: [runTestCase.js] ---*/ -function testcase() { var result = false; function callbackfn(val, idx, obj) { result = obj instanceof Number; } - try { Number.prototype[0] = 1; Number.prototype.length = 1; Array.prototype.forEach.call(2.5, callbackfn); - return result; - } finally { - delete Number.prototype[0]; - delete Number.prototype.length; - } - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-12.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-12.js index e80245d66..ddfb0705a 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-12.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-12.js @@ -7,16 +7,13 @@ description: > Array.prototype.forEach - 'length' is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var accessed = false; function callbackfn(val, idx, obj) { accessed = true; } - try { Object.defineProperty(Object.prototype, "length", { get: function () { return 2; @@ -31,10 +28,5 @@ function testcase() { }); Array.prototype.forEach.call(obj, callbackfn); - return !accessed; - } finally { - delete Object.prototype.length; - } - } -runTestCase(testcase); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-15.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-15.js index 6405b659a..4ffc305bd 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-15.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-15.js @@ -4,30 +4,19 @@ /*--- es5id: 15.4.4.18-2-15 description: Array.prototype.forEach - 'length' is property of the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var result = false; function callbackfn(val, idx, obj) { result = (obj.length === 2); } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 12; fnGlobalObject()[1] = 11; fnGlobalObject()[2] = 9; fnGlobalObject().length = 2; Array.prototype.forEach.call(fnGlobalObject(), callbackfn); - return result; - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-4.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-4.js index f2e114247..63fab3907 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-4.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-4.js @@ -6,24 +6,16 @@ es5id: 15.4.4.18-2-4 description: > Array.prototype.forEach - 'length' is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var result = false; var arrProtoLen; function callbackfn(val, idx, obj) { result = (obj.length === 2); } - try { arrProtoLen = Array.prototype.length; Array.prototype.length = 0; [12, 11].forEach(callbackfn); - return result; - } finally { - Array.prototype.length = arrProtoLen; - } - } -runTestCase(testcase); +assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-10.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-10.js index 4d2baaba6..5decb3084 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-10.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-10.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-b-10 description: > Array.prototype.forEach - deleting property of prototype causes prototype index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -31,12 +28,8 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; Array.prototype.forEach.call(obj, callbackfn); - return testResult && accessed; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-11.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-11.js index c035e4cf0..3b9d3e726 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-11.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-11.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-b-11 description: > Array.prototype.forEach - deleting property of prototype causes prototype index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -31,12 +28,8 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; arr.forEach(callbackfn); - return testResult && accessed; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-12.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-12.js index 97fa5dd6b..fbb3fc5f6 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-12.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-12.js @@ -7,11 +7,8 @@ description: > Array.prototype.forEach - deleting own property with prototype property causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -30,12 +27,7 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; Array.prototype.forEach.call(obj, callbackfn); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-13.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-13.js index 47e607672..2aeb3d93b 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-13.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-13.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-b-13 description: > Array.prototype.forEach - deleting own property with prototype property causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -28,12 +25,7 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; arr.forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-15.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-15.js index a9f726659..919cc3f18 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-15.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-15.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-b-15 description: > Array.prototype.forEach - decreasing length of array with prototype property causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -20,7 +17,6 @@ function testcase() { } var arr = [0, 1, 2]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -38,9 +34,4 @@ function testcase() { arr.forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-6.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-6.js index 5e519a511..5ee511ca5 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-6.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-b-6 description: > Array.prototype.forEach - properties can be added to prototype after current position are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -34,11 +31,6 @@ function testcase() { configurable: true }); - try { Array.prototype.forEach.call(obj, callbackfn); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-7.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-7.js index 556792dcb..3c5d7780d 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-7.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-b-7 description: > Array.prototype.forEach - properties can be added to prototype after current position are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -34,11 +31,6 @@ function testcase() { configurable: true }); - try { arr.forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-12.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-12.js index 27ac3e1b0..3501d5944 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-12.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-12.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-c-i-12 description: > Array.prototype.forEach - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -20,7 +17,7 @@ function testcase() { } var arr = []; - try { + Array.prototype[0] = 10; Object.defineProperty(arr, "0", { @@ -32,9 +29,4 @@ function testcase() { arr.forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-14.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-14.js index 030a7501d..6112a791c 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-14.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-c-i-14 description: > Array.prototype.forEach - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -20,7 +17,7 @@ function testcase() { } var arr = []; - try { + Object.defineProperty(Array.prototype, "0", { get: function () { return 5; @@ -37,9 +34,4 @@ function testcase() { arr.forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-16.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-16.js index 9474fa7ce..0ac1f6e70 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-16.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-16.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-c-i-16 description: > Array.prototype.forEach - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 11; @@ -29,9 +25,4 @@ function testcase() { [, , , ].forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-19.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-19.js index 466692873..7ac8752f5 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-19.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.forEach - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -27,7 +24,6 @@ function testcase() { configurable: true }); - try { Object.defineProperty(Object.prototype, "1", { get: function () { return 10; @@ -37,9 +33,4 @@ function testcase() { Array.prototype.forEach.call(obj, callbackfn); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-20.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-20.js index 7b892e144..4c5f34821 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-20.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-20.js @@ -7,11 +7,8 @@ description: > Array.prototype.forEach - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -27,7 +24,6 @@ function testcase() { configurable: true }); - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 100; @@ -37,9 +33,4 @@ function testcase() { arr.forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-22.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-22.js index 3ba358eb4..4f5b44132 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-22.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-c-i-22 description: > Array.prototype.forEach - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "0", { set: function () { }, configurable: true @@ -27,10 +23,4 @@ function testcase() { [, 1].forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-23.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-23.js index 55b1339b4..7818c59d7 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-23.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-23.js @@ -6,13 +6,9 @@ es5id: 15.4.4.18-7-c-i-23 description: > Array.prototype.forEach - This object is an global object which contains index property -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -21,17 +17,10 @@ function testcase() { } } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 11; fnGlobalObject().length = 1; Array.prototype.forEach.call(fnGlobalObject(), callbackfn); - return testResult; - } finally { - delete fnGlobalObject()[0]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-4.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-4.js index a0259fb98..833b519f9 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-4.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-c-i-4 description: > Array.prototype.forEach - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -19,14 +16,8 @@ function testcase() { } } - try { Array.prototype[0] = 11; [12].forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-6.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-6.js index 5a95ec965..e1a7f9851 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-6.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-c-i-6 description: > Array.prototype.forEach - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 9; @@ -29,9 +25,4 @@ function testcase() { [11].forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-8.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-8.js index d2efd7e9c..a213a17a6 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-8.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-c-i-8 description: > Array.prototype.forEach - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -19,14 +16,8 @@ function testcase() { } } - try { Array.prototype[1] = 13; [, , , ].forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-10.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-10.js index f77c37a11..dbbcefece 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-10.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-10.js @@ -4,17 +4,9 @@ /*--- es5id: 15.4.4.14-1-10 description: Array.prototype.indexOf applied to the Math object -includes: [runTestCase.js] ---*/ -function testcase() { - try { Math[1] = true; Math.length = 2; - return Array.prototype.indexOf.call(Math, true) === 1; - } finally { - delete Math[1]; - delete Math.length; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(Math, true), 1, 'Array.prototype.indexOf.call(Math, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-13.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-13.js index a492656df..f04b1089d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-13.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-13.js @@ -4,18 +4,11 @@ /*--- es5id: 15.4.4.14-1-13 description: Array.prototype.indexOf applied to the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - try { + JSON[3] = targetObj; JSON.length = 5; - return Array.prototype.indexOf.call(JSON, targetObj) === 3; - } finally { - delete JSON[3]; - delete JSON.length; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(JSON, targetObj), 3, 'Array.prototype.indexOf.call(JSON, targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-17.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-17.js index 26a8e4778..375445d10 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-17.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-17.js @@ -4,20 +4,11 @@ /*--- es5id: 15.4.4.14-1-17 description: Array.prototype.indexOf applied to the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[1] = true; fnGlobalObject().length = 2; - return Array.prototype.indexOf.call(fnGlobalObject(), true) === 1; - } finally { - delete fnGlobalObject()[1]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(fnGlobalObject(), true), 1, 'Array.prototype.indexOf.call(fnGlobalObject(), true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-3.js index 70e6ba624..adac07916 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-3.js @@ -4,19 +4,11 @@ /*--- es5id: 15.4.4.14-1-3 description: Array.prototype.indexOf applied to boolean primitive -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - try { + Boolean.prototype[1] = targetObj; Boolean.prototype.length = 2; - return Array.prototype.indexOf.call(true, targetObj) === 1; - } finally { - delete Boolean.prototype[1]; - delete Boolean.prototype.length; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(true, targetObj), 1, 'Array.prototype.indexOf.call(true, targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-5.js index 896156aa9..9d0a3f6fa 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-5.js @@ -4,19 +4,11 @@ /*--- es5id: 15.4.4.14-1-5 description: Array.prototype.indexOf applied to number primitive -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - try { + Number.prototype[1] = targetObj; Number.prototype.length = 2; - return Array.prototype.indexOf.call(5, targetObj) === 1; - } finally { - delete Number.prototype[1]; - delete Number.prototype.length; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(5, targetObj), 1, 'Array.prototype.indexOf.call(5, targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-12.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-12.js index cb3f134ef..c38c41d40 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-12.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-12.js @@ -7,11 +7,8 @@ description: > Array.prototype.indexOf - 'length' is own accessor property without a get function that overrides an inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Object.prototype, "length", { get: function () { return 20; @@ -25,9 +22,4 @@ function testcase() { configurable: true }); - return Array.prototype.indexOf.call(obj, 1) === -1; - } finally { - delete Object.prototype.length; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, 1), -1, 'Array.prototype.indexOf.call(obj, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-18.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-18.js index e0ba535b5..0e0c49fc4 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-18.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-18.js @@ -6,17 +6,11 @@ es5id: 15.4.4.14-2-18 description: > Array.prototype.indexOf applied to String object, which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { var str = new String("012"); - try { + String.prototype[3] = "3"; - return Array.prototype.indexOf.call(str, "2") === 2 && - Array.prototype.indexOf.call(str, "3") === -1; - } finally { - delete String.prototype[3]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(str, "2"), 2, 'Array.prototype.indexOf.call(str, "2")'); +assert.sameValue(Array.prototype.indexOf.call(str, "3"), -1, 'Array.prototype.indexOf.call(str, "3")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-2.js index 1c9b02f38..fadb62c9a 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-2.js @@ -4,19 +4,12 @@ /*--- es5id: 15.4.4.14-2-2 description: Array.prototype.indexOf - 'length' is own data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - try { + Array.prototype[2] = targetObj; - return [0, targetObj].indexOf(targetObj) === 1 && - [0, 1].indexOf(targetObj) === -1; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert.sameValue([0, targetObj].indexOf(targetObj), 1, '[0, targetObj].indexOf(targetObj)'); +assert.sameValue([0, 1].indexOf(targetObj), -1, '[0, 1].indexOf(targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-4.js index 7537df83a..6614dfd67 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-4.js @@ -6,23 +6,12 @@ es5id: 15.4.4.14-2-4 description: > Array.prototype.indexOf - 'length' is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var targetObj = {}; var arrProtoLen; - try { arrProtoLen = Array.prototype.length; Array.prototype.length = 0; - return [0, targetObj].indexOf(targetObj) === 1; - - } finally { - - Array.prototype.length = arrProtoLen; - } - } -runTestCase(testcase); +assert.sameValue([0, targetObj].indexOf(targetObj), 1, '[0, targetObj].indexOf(targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-10.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-10.js index 2d648413b..0613b8931 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-10.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-10.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-10 description: > Array.prototype.indexOf - properties can be added to prototype after current position are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, , 2]; Object.defineProperty(arr, "0", { @@ -26,10 +23,4 @@ function testcase() { configurable: true }); - try { - return arr.indexOf(6.99) === 1; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(arr.indexOf(6.99), 1, 'arr.indexOf(6.99)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-13.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-13.js index 5cf294667..1d0e8b9e3 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-13.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-13.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-13 description: > Array.prototype.indexOf - deleting property of prototype causes prototype index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = { 2: 2, length: 20 }; Object.defineProperty(arr, "0", { @@ -21,11 +18,6 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; - return -1 === Array.prototype.indexOf.call(arr, 1); - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(arr, 1), -1, 'Array.prototype.indexOf.call(arr, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-14.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-14.js index 2c819c849..441d6548e 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-14.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-14 description: > Array.prototype.indexOf - deleting property of prototype causes prototype index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, , 2]; Object.defineProperty(arr, "0", { @@ -21,11 +18,6 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; - return -1 === arr.indexOf(1); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(arr.indexOf(1), -1, 'arr.indexOf(1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-15.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-15.js index be5c7ddf7..c0cdb29c7 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-15.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-15.js @@ -7,11 +7,8 @@ description: > Array.prototype.indexOf - deleting own property with prototype property causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = { 0: 0, 1: 111, 2: 2, length: 10 }; Object.defineProperty(arr, "0", { @@ -22,11 +19,6 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; - return 1 === Array.prototype.indexOf.call(arr, 1); - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(arr, 1), 1, 'Array.prototype.indexOf.call(arr, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-16.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-16.js index 715c7b2d8..b0b90e110 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-16.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-16.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-16 description: > Array.prototype.indexOf - deleting own property with prototype property causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 111, 2]; Object.defineProperty(arr, "0", { @@ -21,11 +18,6 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; - return 1 === arr.indexOf(1); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(arr.indexOf(1), 1, 'arr.indexOf(1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-18.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-18.js index cca19813b..dba9ebe12 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-18.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-18.js @@ -6,14 +6,10 @@ es5id: 15.4.4.14-9-a-18 description: > Array.prototype.indexOf - decreasing length of array with prototype property causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 1, 2]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -29,9 +25,4 @@ function testcase() { configurable: true }); - return 2 === arr.indexOf("prototype"); - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert.sameValue(arr.indexOf("prototype"), 2, 'arr.indexOf("prototype")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-9.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-9.js index be22ec2e1..946f14516 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-9.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-9.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-9 description: > Array.prototype.indexOf - properties can be added to prototype after current position are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = { length: 2 }; Object.defineProperty(arr, "0", { @@ -26,10 +23,4 @@ function testcase() { configurable: true }); - try { - return Array.prototype.indexOf.call(arr, 6.99) === 1; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(arr, 6.99), 1, 'Array.prototype.indexOf.call(arr, 6.99)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-11.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-11.js index 264dee961..91f888fe3 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-11.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-11.js @@ -6,13 +6,10 @@ es5id: 15.4.4.14-9-b-i-11 description: > Array.prototype.indexOf - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = []; - try { + Array.prototype[0] = false; Object.defineProperty(arr, "0", { get: function () { @@ -21,9 +18,4 @@ function testcase() { configurable: true }); - return 0 === arr.indexOf(true); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(arr.indexOf(true), 0, 'arr.indexOf(true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-12.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-12.js index b81c50887..d57984392 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-12.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-12.js @@ -7,13 +7,10 @@ description: > Array.prototype.indexOf - element to be retrieved is own accessor property that overrides an inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { length: 1 }; - try { Object.prototype[0] = false; Object.defineProperty(obj, "0", { get: function () { @@ -22,9 +19,4 @@ function testcase() { configurable: true }); - return 0 === Array.prototype.indexOf.call(obj, true); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 0, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-13.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-13.js index 8b10ac1ce..89e660c3a 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-13.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-13.js @@ -6,13 +6,10 @@ es5id: 15.4.4.14-9-b-i-13 description: > Array.prototype.indexOf - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = []; - try { + Object.defineProperty(Array.prototype, "0", { get: function () { return false; @@ -27,9 +24,4 @@ function testcase() { configurable: true }); - return 0 === arr.indexOf(true); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(arr.indexOf(true), 0, 'arr.indexOf(true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-14.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-14.js index 3f11e9c8f..f7fa2ff9b 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-14.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-14.js @@ -7,14 +7,10 @@ description: > Array.prototype.indexOf - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { length: 1 }; - try { Object.defineProperty(Object.prototype, "0", { get: function () { return false; @@ -29,9 +25,4 @@ function testcase() { configurable: true }); - return 0 === Array.prototype.indexOf.call(obj, true); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 0, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-15.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-15.js index 9b48b40ca..172a32b6b 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-15.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-15.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-b-i-15 description: > Array.prototype.indexOf - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 10; @@ -32,13 +29,6 @@ function testcase() { configurable: true }); - return 0 === [, , , ].indexOf(10) && - 1 === [, , , ].indexOf(20) && - 2 === [, , , ].indexOf(30); - } finally { - delete Array.prototype[0]; - delete Array.prototype[1]; - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert.sameValue([, , , ].indexOf(10), 0, '[, , , ].indexOf(10)'); +assert.sameValue([, , , ].indexOf(20), 1, '[, , , ].indexOf(20)'); +assert.sameValue([, , , ].indexOf(30), 2, '[, , , ].indexOf(30)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-16.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-16.js index 06a2388a1..7aab5413d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-16.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-16.js @@ -6,12 +6,8 @@ es5id: 15.4.4.14-9-b-i-16 description: > Array.prototype.indexOf - element to be retrieved is inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.defineProperty(Object.prototype, "0", { get: function () { return 10; @@ -33,13 +29,6 @@ function testcase() { configurable: true }); - return 0 === Array.prototype.indexOf.call({ length: 3 }, 10) && - 1 === Array.prototype.indexOf.call({ length: 3 }, 20) && - 2 === Array.prototype.indexOf.call({ length: 3 }, 30); - } finally { - delete Object.prototype[0]; - delete Object.prototype[1]; - delete Object.prototype[2]; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call({ length: 3 }, 10), 0, 'Array.prototype.indexOf.call({ length: 3 }, 10)'); +assert.sameValue(Array.prototype.indexOf.call({ length: 3 }, 20), 1, 'Array.prototype.indexOf.call({ length: 3 }, 20)'); +assert.sameValue(Array.prototype.indexOf.call({ length: 3 }, 30), 2, 'Array.prototype.indexOf.call({ length: 3 }, 30)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-19.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-19.js index 4fd2ad3ef..895c3a2dc 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-19.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.indexOf - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = []; Object.defineProperty(arr, "0", { @@ -19,7 +16,6 @@ function testcase() { configurable: true }); - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 2; @@ -27,9 +23,4 @@ function testcase() { configurable: true }); - return arr.indexOf(undefined) === 0; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(arr.indexOf(undefined), 0, 'arr.indexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-21.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-21.js index 5dbbdc8a9..da3b000c5 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-21.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-21.js @@ -6,18 +6,11 @@ es5id: 15.4.4.14-9-b-i-21 description: > Array.prototype.indexOf - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { set: function () { }, configurable: true }); - return 0 === [, ].indexOf(undefined); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue([, ].indexOf(undefined), 0, '[, ].indexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-22.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-22.js index 437535a95..765ea4934 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-22.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-22.js @@ -6,19 +6,11 @@ es5id: 15.4.4.14-9-b-i-22 description: > Array.prototype.indexOf - element to be retrieved is inherited accessor property without a get function on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.defineProperty(Object.prototype, "0", { set: function () { }, configurable: true }); - return 0 === Array.prototype.indexOf.call({ length: 1 }, undefined); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call({ length: 1 }, undefined), 0, 'Array.prototype.indexOf.call({ length: 1 }, undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-23.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-23.js index 048df751e..0b4a011ae 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-23.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-23.js @@ -4,28 +4,17 @@ /*--- es5id: 15.4.4.14-9-b-i-23 description: Array.prototype.indexOf - This object is the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var targetObj = {}; - try { + var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = targetObj; fnGlobalObject()[100] = "100"; fnGlobalObject()[200] = "200"; fnGlobalObject().length = 200; - return 0 === Array.prototype.indexOf.call(fnGlobalObject(), targetObj) && - 100 === Array.prototype.indexOf.call(fnGlobalObject(), "100") && - -1 === Array.prototype.indexOf.call(fnGlobalObject(), "200"); - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[100]; - delete fnGlobalObject()[200]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(fnGlobalObject(), targetObj), 0, 'Array.prototype.indexOf.call(fnGlobalObject(), targetObj)'); +assert.sameValue(Array.prototype.indexOf.call(fnGlobalObject(), "100"), 100, 'Array.prototype.indexOf.call(fnGlobalObject(), "100")'); +assert.sameValue(Array.prototype.indexOf.call(fnGlobalObject(), "200"), -1, 'Array.prototype.indexOf.call(fnGlobalObject(), "200")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-3.js index 8eed80239..b25f32a11 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-3.js @@ -6,15 +6,8 @@ es5id: 15.4.4.14-9-b-i-3 description: > Array.prototype.indexOf - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - try { Array.prototype[0] = false; - return [true].indexOf(true) === 0; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue([true].indexOf(true), 0, '[true].indexOf(true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-4.js index 2e8f71094..050883cf5 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-4.js @@ -7,16 +7,8 @@ description: > Array.prototype.indexOf - element to be retrieved is own data property that overrides an inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.prototype[0] = false; - return 0 === Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true), 0, 'Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-5.js index 3fd67f5bc..865f0bcc7 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-5.js @@ -6,20 +6,13 @@ es5id: 15.4.4.14-9-b-i-5 description: > Array.prototype.indexOf - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { get: function () { return false; }, configurable: true }); - return 0 === [true].indexOf(true); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue([true].indexOf(true), 0, '[true].indexOf(true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-6.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-6.js index 7891b45ca..44fc07646 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-6.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-6.js @@ -7,21 +7,13 @@ description: > Array.prototype.indexOf - element to be retrieved is own data property that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.defineProperty(Object.prototype, "0", { get: function () { return false; }, configurable: true }); - return 0 === Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true), 0, 'Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-7.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-7.js index 24cdc0197..6c2ca2f4c 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-7.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-7.js @@ -6,21 +6,12 @@ es5id: 15.4.4.14-9-b-i-7 description: > Array.prototype.indexOf - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - try { Array.prototype[0] = true; Array.prototype[1] = false; Array.prototype[2] = "true"; - return 0 === [, , , ].indexOf(true) && - 1 === [, , , ].indexOf(false) && - 2 === [, , , ].indexOf("true"); - } finally { - delete Array.prototype[0]; - delete Array.prototype[1]; - delete Array.prototype[2]; - } - } -runTestCase(testcase); + +assert.sameValue([, , , ].indexOf(true), 0, '[, , , ].indexOf(true)'); +assert.sameValue([, , , ].indexOf(false), 1, '[, , , ].indexOf(false)'); +assert.sameValue([, , , ].indexOf("true"), 2, '[, , , ].indexOf("true")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-8.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-8.js index 8dc554233..7278aa4e6 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-8.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-8.js @@ -6,22 +6,12 @@ es5id: 15.4.4.14-9-b-i-8 description: > Array.prototype.indexOf - element to be retrieved is inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.prototype[0] = true; Object.prototype[1] = false; Object.prototype[2] = "true"; - return 0 === Array.prototype.indexOf.call({ length: 3 }, true) && - 1 === Array.prototype.indexOf.call({ length: 3 }, false) && - 2 === Array.prototype.indexOf.call({ length: 3 }, "true"); - } finally { - delete Object.prototype[0]; - delete Object.prototype[1]; - delete Object.prototype[2]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call({ length: 3 }, true), 0, 'Array.prototype.indexOf.call({ length: 3 }, true)'); +assert.sameValue(Array.prototype.indexOf.call({ length: 3 }, false), 1, 'Array.prototype.indexOf.call({ length: 3 }, false)'); +assert.sameValue(Array.prototype.indexOf.call({ length: 3 }, "true"), 2, 'Array.prototype.indexOf.call({ length: 3 }, "true")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-10.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-10.js index c14fdcdab..003149362 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-10.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-10.js @@ -4,18 +4,9 @@ /*--- es5id: 15.4.4.15-1-10 description: Array.prototype.lastIndexOf applied to the Math object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Math.length = 2; Math[1] = 100; - return 1 === Array.prototype.lastIndexOf.call(Math, 100); - } finally { - delete Math.length; - delete Math[1]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(Math, 100), 1, 'Array.prototype.lastIndexOf.call(Math, 100)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-13.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-13.js index 2248f3079..853dc236c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-13.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-13.js @@ -4,19 +4,11 @@ /*--- es5id: 15.4.4.15-1-13 description: Array.prototype.lastIndexOf applied to the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { - var targetObj = {}; - try { + JSON[3] = targetObj; JSON.length = 5; - return 3 === Array.prototype.lastIndexOf.call(JSON, targetObj); - } finally { - delete JSON[3]; - delete JSON.length; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(JSON, targetObj), 3, 'Array.prototype.lastIndexOf.call(JSON, targetObj)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-17.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-17.js index 86c066c18..d3ce16250 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-17.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-17.js @@ -4,21 +4,13 @@ /*--- es5id: 15.4.4.15-1-17 description: Array.prototype.lastIndexOf applied to the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var targetObj = ["global"]; - try { + var oldLen = fnGlobalObject().length; fnGlobalObject()[1] = targetObj; fnGlobalObject().length = 3; - return 1 === Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj); - } finally { - delete fnGlobalObject()[1]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj), 1, 'Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-3.js index 003cce69d..a11694233 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-3.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.15-1-3 description: Array.prototype.lastIndexOf applied to boolean primitive -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Boolean.prototype[1] = true; Boolean.prototype.length = 2; - return 1 === Array.prototype.lastIndexOf.call(true, true); - } finally { - delete Boolean.prototype[1]; - delete Boolean.prototype.length; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(true, true), 1, 'Array.prototype.lastIndexOf.call(true, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-5.js index b4e63bca8..5d8e94214 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-5.js @@ -4,18 +4,9 @@ /*--- es5id: 15.4.4.15-1-5 description: Array.prototype.lastIndexOf applied to number primitive -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Number.prototype[1] = isNaN; Number.prototype.length = 2; - return 1 === Array.prototype.lastIndexOf.call(5, isNaN); - } finally { - delete Number.prototype[1]; - delete Number.prototype.length; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(5, isNaN), 1, 'Array.prototype.lastIndexOf.call(5, isNaN)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-12.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-12.js index d36a4b77d..d5416b835 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-12.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-12.js @@ -7,11 +7,8 @@ description: > Array.prototype.lastIndexOf - 'length' is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Object.prototype, "length", { get: function () { return 20; @@ -25,9 +22,4 @@ function testcase() { configurable: true }); - return Array.prototype.lastIndexOf.call(obj, 1) === -1; - } finally { - delete Object.prototype.length; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 1), -1, 'Array.prototype.lastIndexOf.call(obj, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-18.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-18.js index 1fc26ab04..752ca25e1 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-18.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-18.js @@ -6,18 +6,11 @@ es5id: 15.4.4.15-2-18 description: > Array.prototype.lastIndexOf applied to String object which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { - var str = new String("012"); - try { + String.prototype[3] = "3"; - return Array.prototype.lastIndexOf.call(str, "2") === 2 && - Array.prototype.lastIndexOf.call(str, "3") === -1; - } finally { - delete String.prototype[3]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(str, "2"), 2, 'Array.prototype.lastIndexOf.call(str, "2")'); +assert.sameValue(Array.prototype.lastIndexOf.call(str, "3"), -1, 'Array.prototype.lastIndexOf.call(str, "3")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-2.js index 6f1bec1a0..4bd36ef64 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-2.js @@ -6,18 +6,11 @@ es5id: 15.4.4.15-2-2 description: > Array.prototype.lastIndexOf - 'length' is own data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - try { + Array.prototype[2] = targetObj; - return [0, targetObj].lastIndexOf(targetObj) === 1 && - [0, 1].lastIndexOf(targetObj) === -1; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert.sameValue([0, targetObj].lastIndexOf(targetObj), 1, '[0, targetObj].lastIndexOf(targetObj)'); +assert.sameValue([0, 1].lastIndexOf(targetObj), -1, '[0, 1].lastIndexOf(targetObj)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-4.js index 3e7d765d7..60676edb7 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-4.js @@ -6,19 +6,12 @@ es5id: 15.4.4.15-2-4 description: > Array.prototype.lastIndexOf when 'length' is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var targetObj = {}; var arrProtoLen; - try { + arrProtoLen = Array.prototype.length; Array.prototype.length = 0; - return [0, targetObj, 2].lastIndexOf(targetObj) === 1; - } finally { - Array.prototype.length = arrProtoLen; - } - } -runTestCase(testcase); + +assert.sameValue([0, targetObj, 2].lastIndexOf(targetObj), 1, '[0, targetObj, 2].lastIndexOf(targetObj)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-10.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-10.js index 5ec39f5b7..a65561e05 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-10.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-10.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-a-10 description: > Array.prototype.lastIndexOf - properties can be added to prototype after current position are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, , 2]; Object.defineProperty(arr, "2", { @@ -26,10 +23,4 @@ function testcase() { configurable: true }); - try { - return arr.lastIndexOf(6.99) === 1; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(arr.lastIndexOf(6.99), 1, 'arr.lastIndexOf(6.99)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-13.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-13.js index 7636e4411..916acc55a 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-13.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-13.js @@ -7,11 +7,8 @@ description: > Array.prototype.lastIndexOf - deleting property of prototype causes prototype index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = { 2: 2, length: 20 }; Object.defineProperty(arr, "3", { @@ -22,11 +19,6 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; - return -1 === Array.prototype.lastIndexOf.call(arr, 1); - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(arr, 1), -1, 'Array.prototype.lastIndexOf.call(arr, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-14.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-14.js index 6a7c0e004..03969578a 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-14.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-a-14 description: > Array.prototype.lastIndexOf - deleting property of prototype causes prototype index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, , 2]; Object.defineProperty(arr, "20", { @@ -21,11 +18,6 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; - return -1 === arr.lastIndexOf(1); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(arr.lastIndexOf(1), -1, 'arr.lastIndexOf(1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-15.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-15.js index 72d4bcae7..8d5ca467c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-15.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-15.js @@ -7,11 +7,8 @@ description: > Array.prototype.lastIndexOf - deleting own property with prototype property causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = { 0: 0, 1: 111, 2: 2, length: 10 }; Object.defineProperty(arr, "6", { @@ -22,11 +19,6 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; - return 1 === Array.prototype.lastIndexOf.call(arr, 1); - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(arr, 1), 1, 'Array.prototype.lastIndexOf.call(arr, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-16.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-16.js index 9cf101b44..2d54abecb 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-16.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-16.js @@ -7,11 +7,8 @@ description: > Array.prototype.lastIndexOf - deleting own property with prototype property causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 111, 2]; Object.defineProperty(arr, "2", { @@ -22,11 +19,6 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; - return 1 === arr.lastIndexOf(1); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(arr.lastIndexOf(1), 1, 'arr.lastIndexOf(1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-18.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-18.js index 3ccde5b66..229cf7e58 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-18.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-18.js @@ -6,14 +6,10 @@ es5id: 15.4.4.15-8-a-18 description: > Array.prototype.lastIndexOf - decreasing length of array with prototype property causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 1, 2, 3, 4]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -29,9 +25,4 @@ function testcase() { configurable: true }); - return 2 === arr.lastIndexOf("prototype"); - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert.sameValue(arr.lastIndexOf("prototype"), 2, 'arr.lastIndexOf("prototype")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-9.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-9.js index 0cce8eaeb..646564143 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-9.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-9.js @@ -7,11 +7,8 @@ description: > Array.prototype.lastIndexOf - properties can be added to prototype after current position are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = { length: 9 }; Object.defineProperty(arr, "4", { @@ -27,10 +24,4 @@ function testcase() { configurable: true }); - try { - return Array.prototype.lastIndexOf.call(arr, Infinity) === 1; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(arr, Infinity), 1, 'Array.prototype.lastIndexOf.call(arr, Infinity)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-11.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-11.js index 806209dd9..7f88d0691 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-11.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-11.js @@ -7,13 +7,10 @@ description: > Array.prototype.lastIndexOf - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = []; - try { + Array.prototype[0] = false; Object.defineProperty(arr, "0", { get: function () { @@ -22,9 +19,4 @@ function testcase() { configurable: true }); - return 0 === arr.lastIndexOf(true); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(arr.lastIndexOf(true), 0, 'arr.lastIndexOf(true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-12.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-12.js index b67dfe5ed..a699e4077 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-12.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-12.js @@ -7,13 +7,10 @@ description: > Array.prototype.lastIndexOf - element to be retrieved is own accessor property that overrides an inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { length: 1 }; - try { Object.prototype[0] = false; Object.defineProperty(obj, "0", { get: function () { @@ -22,9 +19,4 @@ function testcase() { configurable: true }); - return 0 === Array.prototype.lastIndexOf.call(obj, true); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 0, 'Array.prototype.lastIndexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-13.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-13.js index 0b527f82b..43c6045bd 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-13.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-13.js @@ -7,13 +7,10 @@ description: > Array.prototype.lastIndexOf - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = []; - try { + Object.defineProperty(Array.prototype, "0", { get: function () { return false; @@ -28,9 +25,4 @@ function testcase() { configurable: true }); - return 0 === arr.lastIndexOf(true); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(arr.lastIndexOf(true), 0, 'arr.lastIndexOf(true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-14.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-14.js index 474ce9b0a..60245d65f 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-14.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-14.js @@ -7,14 +7,10 @@ description: > Array.prototype.lastIndexOf - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { length: 1 }; - try { Object.defineProperty(Object.prototype, "0", { get: function () { return false; @@ -29,9 +25,4 @@ function testcase() { configurable: true }); - return 0 === Array.prototype.lastIndexOf.call(obj, true); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 0, 'Array.prototype.lastIndexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-15.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-15.js index 6ff9ba3d6..2bdb9cd52 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-15.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-15.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-b-i-15 description: > Array.prototype.lastIndexOf - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 10; @@ -32,13 +29,6 @@ function testcase() { configurable: true }); - return 0 === [, , , ].lastIndexOf(10) && - 1 === [, , , ].lastIndexOf(20) && - 2 === [, , , ].lastIndexOf(30); - } finally { - delete Array.prototype[0]; - delete Array.prototype[1]; - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert.sameValue([, , , ].lastIndexOf(10), 0, '[, , , ].lastIndexOf(10)'); +assert.sameValue([, , , ].lastIndexOf(20), 1, '[, , , ].lastIndexOf(20)'); +assert.sameValue([, , , ].lastIndexOf(30), 2, '[, , , ].lastIndexOf(30)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-16.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-16.js index ab7348aa8..9d9696d60 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-16.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-16.js @@ -6,12 +6,8 @@ es5id: 15.4.4.15-8-b-i-16 description: > Array.prototype.lastIndexOf - element to be retrieved is inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.defineProperty(Object.prototype, "0", { get: function () { return 10; @@ -33,13 +29,6 @@ function testcase() { configurable: true }); - return 0 === Array.prototype.lastIndexOf.call({ length: 3 }, 10) && - 1 === Array.prototype.lastIndexOf.call({ length: 3 }, 20) && - 2 === Array.prototype.lastIndexOf.call({ length: 3 }, 30); - } finally { - delete Object.prototype[0]; - delete Object.prototype[1]; - delete Object.prototype[2]; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call({ length: 3 }, 10), 0, 'Array.prototype.lastIndexOf.call({ length: 3 }, 10)'); +assert.sameValue(Array.prototype.lastIndexOf.call({ length: 3 }, 20), 1, 'Array.prototype.lastIndexOf.call({ length: 3 }, 20)'); +assert.sameValue(Array.prototype.lastIndexOf.call({ length: 3 }, 30), 2, 'Array.prototype.lastIndexOf.call({ length: 3 }, 30)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-19.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-19.js index 71477a04b..6ab787b59 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-19.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-19.js @@ -7,13 +7,10 @@ description: > Array.prototype.lastIndexOf - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { length: 1 }; - try { + Object.defineProperty(Object.prototype, "0", { get: function () { return 20; @@ -25,9 +22,5 @@ function testcase() { configurable: true }); - return obj.hasOwnProperty(0) && 0 === Array.prototype.lastIndexOf.call(obj, undefined); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty(0), 'obj.hasOwnProperty(0) !== true'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, undefined), 0, 'Array.prototype.lastIndexOf.call(obj, undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-20.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-20.js index f11603bc8..779199dbe 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-20.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-20.js @@ -7,13 +7,10 @@ description: > Array.prototype.lastIndexOf - element to be retrieved is an own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [, 1]; - try { + Object.defineProperty(Array.prototype, "0", { get: function () { return 100; @@ -25,9 +22,5 @@ function testcase() { configurable: true }); - return arr.hasOwnProperty(0) && arr.lastIndexOf(undefined) === 0; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(arr.hasOwnProperty(0), 'arr.hasOwnProperty(0) !== true'); +assert.sameValue(arr.lastIndexOf(undefined), 0, 'arr.lastIndexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-21.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-21.js index 5388971f4..b3a5e120a 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-21.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-21.js @@ -6,18 +6,11 @@ es5id: 15.4.4.15-8-b-i-21 description: > Array.prototype.lastIndexOf - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { set: function () { }, configurable: true }); - return [, ].lastIndexOf(undefined) === 0; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue([, ].lastIndexOf(undefined), 0, '[, ].lastIndexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-22.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-22.js index ba1d369b6..0387717f9 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-22.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-22.js @@ -6,19 +6,11 @@ es5id: 15.4.4.15-8-b-i-22 description: > Array.prototype.lastIndexOf - element to be retrieved is inherited accessor property without a get function on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.defineProperty(Object.prototype, "0", { set: function () { }, configurable: true }); - return 0 === Array.prototype.lastIndexOf.call({ length: 1 }, undefined); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call({ length: 1 }, undefined), 0, 'Array.prototype.lastIndexOf.call({ length: 1 }, undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-23.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-23.js index 6e703b419..1cae88226 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-23.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-23.js @@ -4,28 +4,17 @@ /*--- es5id: 15.4.4.15-8-b-i-23 description: Array.prototype.lastIndexOf - This object is the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var targetObj = {}; - try { + var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = targetObj; fnGlobalObject()[100] = "100"; fnGlobalObject()[200] = "200"; fnGlobalObject().length = 200; - return 0 === Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj) && - 100 === Array.prototype.lastIndexOf.call(fnGlobalObject(), "100") && - -1 === Array.prototype.lastIndexOf.call(fnGlobalObject(), "200"); - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[100]; - delete fnGlobalObject()[200]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj), 0, 'Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj)'); +assert.sameValue(Array.prototype.lastIndexOf.call(fnGlobalObject(), "100"), 100, 'Array.prototype.lastIndexOf.call(fnGlobalObject(), "100")'); +assert.sameValue(Array.prototype.lastIndexOf.call(fnGlobalObject(), "200"), -1, 'Array.prototype.lastIndexOf.call(fnGlobalObject(), "200")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-3.js index 1c6891091..9409d4a82 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-3.js @@ -6,15 +6,8 @@ es5id: 15.4.4.15-8-b-i-3 description: > Array.prototype.lastIndexOf - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - try { Array.prototype[0] = Object; - return [Object.prototype].lastIndexOf(Object.prototype) === 0; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue([Object.prototype].lastIndexOf(Object.prototype), 0, '[Object.prototype].lastIndexOf(Object.prototype)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-4.js index 2bd1212e7..4b1e8873b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-4.js @@ -7,16 +7,8 @@ description: > Array.prototype.lastIndexOf - element to be retrieved is own data property that overrides an inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.prototype[0] = false; - return 0 === Array.prototype.lastIndexOf.call({ 0: true, 1: 1, length: 2 }, true); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call({ 0: true, 1: 1, length: 2 }, true), 0, 'Array.prototype.lastIndexOf.call({ 0: true, 1: 1, length: 2 }, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-5.js index ca9741e2e..a03864b3a 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-5.js @@ -6,20 +6,13 @@ es5id: 15.4.4.15-8-b-i-5 description: > Array.prototype.lastIndexOf - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { get: function () { return false; }, configurable: true }); - return 0 === [Number].lastIndexOf(Number); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue([Number].lastIndexOf(Number), 0, '[Number].lastIndexOf(Number)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-6.js index e5a16ce6f..112b55bc5 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-6.js @@ -7,21 +7,13 @@ description: > Array.prototype.lastIndexOf - element to be retrieved is own data property that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.defineProperty(Object.prototype, "0", { get: function () { return false; }, configurable: true }); - return 0 === Array.prototype.lastIndexOf.call({ 0: true, 1: 1, length: 2 }, true); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call({ 0: true, 1: 1, length: 2 }, true), 0, 'Array.prototype.lastIndexOf.call({ 0: true, 1: 1, length: 2 }, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-7.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-7.js index 491783e0d..91db94835 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-7.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-7.js @@ -6,22 +6,12 @@ es5id: 15.4.4.15-8-b-i-7 description: > Array.prototype.lastIndexOf - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Array.prototype[0] = true; Array.prototype[1] = false; Array.prototype[2] = "true"; - return 0 === [, , , ].lastIndexOf(true) && - 1 === [, , , ].lastIndexOf(false) && - 2 === [, , , ].lastIndexOf("true"); - } finally { - delete Array.prototype[0]; - delete Array.prototype[1]; - delete Array.prototype[2]; - } - } -runTestCase(testcase); + +assert.sameValue([, , , ].lastIndexOf(true), 0, '[, , , ].lastIndexOf(true)'); +assert.sameValue([, , , ].lastIndexOf(false), 1, '[, , , ].lastIndexOf(false)'); +assert.sameValue([, , , ].lastIndexOf("true"), 2, '[, , , ].lastIndexOf("true")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-8.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-8.js index 46dee4a02..7bb0a3e3d 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-8.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-8.js @@ -6,22 +6,12 @@ es5id: 15.4.4.15-8-b-i-8 description: > Array.prototype.lastIndexOf - element to be retrieved is inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.prototype[0] = true; Object.prototype[1] = false; Object.prototype[2] = "true"; - return 0 === Array.prototype.lastIndexOf.call({ length: 3 }, true) && - 1 === Array.prototype.lastIndexOf.call({ length: 3 }, false) && - 2 === Array.prototype.lastIndexOf.call({ length: 3 }, "true"); - } finally { - delete Object.prototype[0]; - delete Object.prototype[1]; - delete Object.prototype[2]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call({ length: 3 }, true), 0, 'Array.prototype.lastIndexOf.call({ length: 3 }, true)'); +assert.sameValue(Array.prototype.lastIndexOf.call({ length: 3 }, false), 1, 'Array.prototype.lastIndexOf.call({ length: 3 }, false)'); +assert.sameValue(Array.prototype.lastIndexOf.call({ length: 3 }, "true"), 2, 'Array.prototype.lastIndexOf.call({ length: 3 }, "true")'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-10.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-10.js index 41e50d3f1..df6724e5e 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-10.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-10.js @@ -4,22 +4,14 @@ /*--- es5id: 15.4.4.19-1-10 description: Array.prototype.map - applied to the Math object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return ('[object Math]' === Object.prototype.toString.call(obj)); } - - try { + Math.length = 1; Math[0] = 1; var testResult = Array.prototype.map.call(Math, callbackfn); - return testResult[0] === true; - } finally { - delete Math[0]; - delete Math.length; - } - } -runTestCase(testcase); + +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-13.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-13.js index 7fb75ac18..b346c7069 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-13.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-13.js @@ -4,22 +4,14 @@ /*--- es5id: 15.4.4.19-1-13 description: Array.prototype.map - applied to the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return ('[object JSON]' === Object.prototype.toString.call(obj)); } - try { JSON.length = 1; JSON[0] = 1; var testResult = Array.prototype.map.call(JSON, callbackfn); - return testResult[0] === true; - } finally { - delete JSON.length; - delete JSON[0]; - } - } -runTestCase(testcase); + +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-3.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-3.js index 6f8186e3e..cf445ae5a 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-3.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-3.js @@ -4,24 +4,15 @@ /*--- es5id: 15.4.4.19-1-3 description: Array.prototype.map - applied to boolean primitive -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj instanceof Boolean; } - try { Boolean.prototype[0] = true; Boolean.prototype.length = 1; var testResult = Array.prototype.map.call(false, callbackfn); - return testResult[0] === true; - } finally { - delete Boolean.prototype[0]; - delete Boolean.prototype.length; - } - } -runTestCase(testcase); + +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-5.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-5.js index 3902cede4..42edb09b8 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-5.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-5.js @@ -4,23 +4,15 @@ /*--- es5id: 15.4.4.19-1-5 description: Array.prototype.map - applied to number primitive -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return obj instanceof Number; } - try { Number.prototype[0] = 1; Number.prototype.length = 1; var testResult = Array.prototype.map.call(2.5, callbackfn); - return testResult[0] === true; - } finally { - delete Number.prototype[0]; - delete Number.prototype.length; - } - } -runTestCase(testcase); + +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-12.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-12.js index 12897a9d4..10d6cd990 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-12.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-12.js @@ -7,15 +7,12 @@ description: > Array.prototype.map - applied to the Array-like object when 'length' is own accessor property without a get function that overrides an inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return val > 10; } - try { Object.defineProperty(Object.prototype, "length", { get: function () { return 2; @@ -30,9 +27,5 @@ function testcase() { }); var testResult = Array.prototype.map.call(obj, callbackfn); - return testResult.length === 0; - } finally { - delete Object.prototype.length; - } - } -runTestCase(testcase); + +assert.sameValue(testResult.length, 0, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-15.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-15.js index 3c5f2e419..96ad9dc0d 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-15.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-15.js @@ -6,29 +6,18 @@ es5id: 15.4.4.19-2-15 description: > Array.prototype.map - when 'length' is property of the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return val > 10; } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 12; fnGlobalObject()[1] = 11; fnGlobalObject()[2] = 9; fnGlobalObject().length = 2; var testResult = Array.prototype.map.call(fnGlobalObject(), callbackfn); - return testResult.length === 2; - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert.sameValue(testResult.length, 2, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-18.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-18.js index d0b007728..9a642eb49 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-18.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-18.js @@ -6,22 +6,15 @@ es5id: 15.4.4.19-2-18 description: > Array.prototype.map - applied to String object, which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return parseInt(val, 10) > 1; } var str = new String("432"); - try { + String.prototype[3] = "1"; var testResult = Array.prototype.map.call(str, callbackfn); - return 3 === testResult.length; - } finally { - delete String.prototype[3]; - } - } -runTestCase(testcase); +assert.sameValue(testResult.length, 3, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-4.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-4.js index 380a48157..fb0928033 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-4.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-4.js @@ -6,21 +6,15 @@ es5id: 15.4.4.19-2-4 description: > Array.prototype.map - when 'length' is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return val > 10; } var arrProtoLen; - try { + arrProtoLen = Array.prototype.length; Array.prototype.length = 0; var testResult = [12, 11].map(callbackfn); - return testResult.length === 2; - } finally { - Array.prototype.length = arrProtoLen; - } - } -runTestCase(testcase); + +assert.sameValue(testResult.length, 2, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-1.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-1.js index 348844e73..8ecad2ed0 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-1.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-1.js @@ -5,14 +5,12 @@ es5id: 15.4.4.19-5-1 description: Array.prototype.map - thisArg not passed flags: [noStrict] -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - try { fnGlobalObject()._15_4_4_19_5_1 = true; + +(function() { var _15_4_4_19_5_1 = false; function callbackfn(val, idx, obj) { @@ -20,13 +18,7 @@ function testcase() { } var srcArr = [1]; var resArr = srcArr.map(callbackfn); - if( resArr[0] === true) - return true; - - return false; - } - finally { - delete fnGlobalObject()._15_4_4_19_5_1; - } - } -runTestCase(testcase); + +assert.sameValue(resArr[0], true, 'resArr[0]'); + +})(); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-10.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-10.js index 878b63834..e89ff27c0 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-10.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-10.js @@ -6,10 +6,8 @@ es5id: 15.4.4.19-8-b-10 description: > Array.prototype.map - deleting property of prototype causes prototype index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return idx === 1 && typeof val === "undefined"; } @@ -23,12 +21,8 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; var testResult = Array.prototype.map.call(obj, callbackfn); - return testResult.length === 20 && typeof testResult[1] === "undefined"; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(testResult.length, 20, 'testResult.length'); +assert.sameValue(typeof testResult[1], "undefined", 'typeof testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-11.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-11.js index a3642aa3a..f03c01e7f 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-11.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-11.js @@ -6,10 +6,8 @@ es5id: 15.4.4.19-8-b-11 description: > Array.prototype.map - deleting property of prototype causes prototype index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return idx === 1 && typeof val === "undefined"; } @@ -23,12 +21,8 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; var testResult = arr.map(callbackfn); - return testResult.length === 3 && typeof testResult[1] === "undefined"; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(testResult.length, 3, 'testResult.length'); +assert.sameValue(typeof testResult[1], "undefined", 'typeof testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-12.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-12.js index 037a444c0..8d7e2b7c9 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-12.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-12.js @@ -7,10 +7,8 @@ description: > Array.prototype.map - deleting own property with prototype property causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 3) { return false; @@ -28,12 +26,7 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 3; var testResult = Array.prototype.map.call(obj, callbackfn); - return testResult[1] === false; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(testResult[1], false, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-13.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-13.js index bd9e316b3..f0c563a32 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-13.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-13.js @@ -6,10 +6,8 @@ es5id: 15.4.4.19-8-b-13 description: > Array.prototype.map - deleting own property with prototype property causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 3) { return false; @@ -27,12 +25,7 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 3; var testResult = arr.map(callbackfn); - return testResult[1] === false; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(testResult[1], false, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-15.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-15.js index 2ed922634..6df5013c8 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-15.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-15.js @@ -6,10 +6,8 @@ es5id: 15.4.4.19-8-b-15 description: > Array.prototype.map - decreasing length of array with prototype property causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 2 && val === "prototype") { return false; @@ -19,7 +17,6 @@ function testcase() { } var arr = [0, 1, 2]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -36,9 +33,6 @@ function testcase() { }); var testResult = arr.map(callbackfn); - return testResult.length === 3 && testResult[2] === false; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); + +assert.sameValue(testResult.length, 3, 'testResult.length'); +assert.sameValue(testResult[2], false, 'testResult[2]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-6.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-6.js index 9a037a13e..effed6153 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-6.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-6.js @@ -6,10 +6,8 @@ es5id: 15.4.4.19-8-b-6 description: > Array.prototype.map - properties can be added to prototype after current position are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 6.99) { return false; @@ -32,11 +30,7 @@ function testcase() { configurable: true }); - try { var testResult = Array.prototype.map.call(obj, callbackfn); - return testResult[0] === true && testResult[1] === false; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(testResult[0], true, 'testResult[0]'); +assert.sameValue(testResult[1], false, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-7.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-7.js index 2ab6eab8e..20a2b97cf 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-7.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-7.js @@ -6,10 +6,8 @@ es5id: 15.4.4.19-8-b-7 description: > Array.prototype.map - properties can be added to prototype after current position are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 6.99) { return false; @@ -19,7 +17,6 @@ function testcase() { } var arr = [0, , 2]; - try { Object.defineProperty(arr, "0", { get: function () { Object.defineProperty(Array.prototype, "1", { @@ -34,9 +31,6 @@ function testcase() { }); var testResult = arr.map(callbackfn); - return testResult[0] === true && testResult[1] === false; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(testResult[0], true, 'testResult[0]'); +assert.sameValue(testResult[1], false, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-12.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-12.js index 2b8436a92..962266bb0 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-12.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-12.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-12 description: > Array.prototype.map - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = "abc"; function callbackfn(val, idx, obj) { @@ -22,7 +19,6 @@ function testcase() { var arr = []; - try { Array.prototype[0] = 11; Object.defineProperty(arr, "0", { @@ -34,11 +30,4 @@ function testcase() { var testResult = arr.map(callbackfn); - return testResult[0] === true; - } finally { - delete Array.prototype[0]; - } - - - } -runTestCase(testcase); +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-14.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-14.js index 2bef80c0e..d8b569e66 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-14.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-14 description: > Array.prototype.map - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = "abc"; function callbackfn(val, idx, obj) { @@ -22,7 +19,6 @@ function testcase() { var arr = []; - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 11; @@ -39,9 +35,4 @@ function testcase() { var testResult = arr.map(callbackfn); - return testResult[0] === true; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-16.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-16.js index e380db295..b699886dc 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-16.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-16.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-16 description: > Array.prototype.map - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = "abc"; function callbackfn(val, idx, obj) { @@ -20,7 +17,6 @@ function testcase() { return false; } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return kValue; @@ -30,11 +26,4 @@ function testcase() { var testResult = [, ].map(callbackfn); - return testResult[0] === true; - } finally { - delete Array.prototype[0]; - } - - - } -runTestCase(testcase); +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-19.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-19.js index a402884f2..1efaff41a 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-19.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.map - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 0) { return typeof val === "undefined"; @@ -21,7 +18,6 @@ function testcase() { var arr = []; - try { Object.defineProperty(arr, "0", { set: function () { }, configurable: true @@ -36,9 +32,4 @@ function testcase() { var testResult = arr.map(callbackfn); - return testResult[0] === true; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-22.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-22.js index 04ae7f3a0..2779c6be1 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-22.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-22 description: > Array.prototype.map - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 0) { return typeof val === "undefined"; @@ -18,7 +15,6 @@ function testcase() { return false; } - try { Object.defineProperty(Array.prototype, "0", { set: function () { }, configurable: true @@ -26,9 +22,4 @@ function testcase() { var testResult = [,].map(callbackfn); - return testResult[0] === true; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-23.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-23.js index b1708513b..d3cb8eddd 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-23.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-23.js @@ -6,13 +6,9 @@ es5id: 15.4.4.19-8-c-i-23 description: > Array.prototype.map - This object is the global object which contains index property -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var kValue = "abc"; function callbackfn(val, idx, obj) { @@ -22,17 +18,10 @@ function testcase() { return false; } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = kValue; fnGlobalObject().length = 2; var testResult = Array.prototype.map.call(fnGlobalObject(), callbackfn); - return testResult[0] === true; - } finally { - delete fnGlobalObject()[0]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-4.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-4.js index 2de5c4a29..495608a4f 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-4.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-4 description: > Array.prototype.map - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = "abc"; function callbackfn(val, idx, obj) { @@ -20,14 +17,8 @@ function testcase() { return false; } - try { Array.prototype[0] = 11; var testResult = [kValue].map(callbackfn); - return testResult[0] === true; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-6.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-6.js index 2063d22b5..69e6c2b15 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-6.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-6 description: > Array.prototype.map - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = "abc"; function callbackfn(val, idx, obj) { @@ -20,7 +17,6 @@ function testcase() { return false; } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 9; @@ -29,9 +25,5 @@ function testcase() { }); var testResult = [kValue].map(callbackfn); - return testResult[0] === true; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-8.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-8.js index c6bb4d070..7bb2463d4 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-8.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-8.js @@ -6,10 +6,8 @@ es5id: 15.4.4.19-8-c-i-8 description: > Array.prototype.map - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1) { return val === 13; @@ -17,14 +15,8 @@ function testcase() { return false; } - try { Array.prototype[1] = 13; var newArr = [, , , ].map(callbackfn); - return newArr[1] === true; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(newArr[1], true, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-10.js index 4b83a862e..c4d43ade4 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-10.js @@ -4,22 +4,13 @@ /*--- es5id: 15.4.4.21-1-10 description: Array.prototype.reduce applied to the Math object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return ('[object Math]' === Object.prototype.toString.call(obj)); } - try { Math.length = 1; Math[0] = 1; - return Array.prototype.reduce.call(Math, callbackfn, 1); - } finally { - delete Math[0]; - delete Math.length; - } - } -runTestCase(testcase); + +assert(Array.prototype.reduce.call(Math, callbackfn, 1), 'Array.prototype.reduce.call(Math, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-13.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-13.js index 26fb71985..f69286416 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-13.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-13.js @@ -4,22 +4,13 @@ /*--- es5id: 15.4.4.21-1-13 description: Array.prototype.reduce applied to the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return ('[object JSON]' === Object.prototype.toString.call(obj)); } - try { JSON.length = 1; JSON[0] = 1; - return Array.prototype.reduce.call(JSON, callbackfn, 1); - } finally { - delete JSON.length; - delete JSON[0]; - } - } -runTestCase(testcase); + +assert(Array.prototype.reduce.call(JSON, callbackfn, 1), 'Array.prototype.reduce.call(JSON, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-3.js index 41d0f0f70..fc90a041f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-3.js @@ -4,24 +4,13 @@ /*--- es5id: 15.4.4.21-1-3 description: Array.prototype.reduce applied to boolean primitive -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return obj instanceof Boolean; } - try { Boolean.prototype[0] = true; Boolean.prototype.length = 1; - return Array.prototype.reduce.call(false, callbackfn, 1); - - } finally { - delete Boolean.prototype[0]; - delete Boolean.prototype.length; - } - } -runTestCase(testcase); +assert(Array.prototype.reduce.call(false, callbackfn, 1), 'Array.prototype.reduce.call(false, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-5.js index b4d6a33f6..b49b2ed69 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-5.js @@ -4,22 +4,13 @@ /*--- es5id: 15.4.4.21-1-5 description: Array.prototype.reduce applied to number primitive -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(prevVal, curVal, idx, obj) { return obj instanceof Number; } - try { Number.prototype[0] = 1; Number.prototype.length = 1; - return Array.prototype.reduce.call(2.5, callbackfn, 1); - } finally { - delete Number.prototype[0]; - delete Number.prototype.length; - } - } -runTestCase(testcase); +assert(Array.prototype.reduce.call(2.5, callbackfn, 1), 'Array.prototype.reduce.call(2.5, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-12.js index 3367bd74d..d4d464b37 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-12.js @@ -7,17 +7,13 @@ description: > Array.prototype.reduce - 'length' is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { accessed = true; } - try { Object.defineProperty(Object.prototype, "length", { get: function () { return 2; @@ -31,10 +27,5 @@ function testcase() { configurable: true }); - return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed; - } finally { - delete Object.prototype.length; - } - - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-15.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-15.js index a54963224..136c455d5 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-15.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-15.js @@ -4,29 +4,17 @@ /*--- es5id: 15.4.4.21-2-15 description: Array.prototype.reduce - 'length' is property of the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (obj.length === 2); } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 12; fnGlobalObject()[1] = 11; fnGlobalObject()[2] = 9; fnGlobalObject().length = 2; - return Array.prototype.reduce.call(fnGlobalObject(), callbackfn, 1) === true; - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.reduce.call(fnGlobalObject(), callbackfn, 1), true, 'Array.prototype.reduce.call(fnGlobalObject(), callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-4.js index 65f6ab980..c81d714b7 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-4.js @@ -6,23 +6,15 @@ es5id: 15.4.4.21-2-4 description: > Array.prototype.reduce - 'length' is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var storeProtoLength; function callbackfn(prevVal, curVal, idx, obj) { return (obj.length === 2); } - try { storeProtoLength = Array.prototype.length; Array.prototype.length = 0; - return [12, 11].reduce(callbackfn, 1) === true; - } finally { - Array.prototype.length = storeProtoLength; - } - } -runTestCase(testcase); +assert.sameValue([12, 11].reduce(callbackfn, 1), true, '[12, 11].reduce(callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-12.js index 5a5861786..c424aec71 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-12.js @@ -6,10 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-12 description: > Array.prototype.reduce - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -18,7 +16,6 @@ function testcase() { } } - try { Array.prototype[0] = 0; var arr = [, 1, 2]; @@ -30,9 +27,5 @@ function testcase() { }); arr.reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-14.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-14.js index 890abdb07..d39a7cae8 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-14.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-14 description: > Array.prototype.reduce - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,7 +15,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 0; @@ -35,9 +31,5 @@ function testcase() { }); arr.reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-16.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-16.js index ee48f7229..e55a1f28f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-16.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-16.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-16 description: > Array.prototype.reduce - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,7 +15,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 0; @@ -29,9 +25,5 @@ function testcase() { var arr = [, 1, 2]; arr.reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-19.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-19.js index aa6858ffa..234bc4733 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-19.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.prototype[0] = 0; var obj = { 1: 1, 2: 2, length: 3 }; @@ -30,9 +26,5 @@ function testcase() { }); Array.prototype.reduce.call(obj, callbackfn); - return testResult; - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-20.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-20.js index f277c7687..da85e960b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-20.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-20.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Array.prototype[0] = 0; var arr = [, 1, 2]; Object.defineProperty(arr, "0", { @@ -28,10 +24,5 @@ function testcase() { }); arr.reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-22.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-22.js index 06161f964..45a6b6187 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-22.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-22 description: > Array.prototype.reduce - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,7 +15,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "0", { set: function () { }, configurable: true @@ -27,11 +23,5 @@ function testcase() { var arr = [, 1, 2]; arr.reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-23.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-23.js index a7950d53f..bd3aee02e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-23.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-23.js @@ -6,13 +6,9 @@ es5id: 15.4.4.21-8-b-iii-1-23 description: > Array.prototype.reduce - This object is the global object which contains index property -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -20,7 +16,6 @@ function testcase() { } } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 0; fnGlobalObject()[1] = 1; @@ -28,13 +23,5 @@ function testcase() { fnGlobalObject().length = 3; Array.prototype.reduce.call(fnGlobalObject(), callbackfn); - return testResult; - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-4.js index a7fb1aef7..6ae2de2f6 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-4 description: > Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,13 +15,7 @@ function testcase() { } } - try { Array.prototype[0] = "9"; [0, 1, 2].reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-6.js index 61e59a16f..d22b5dfcb 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-6 description: > Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,7 +15,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return "5"; @@ -27,9 +23,5 @@ function testcase() { }); [0, 1, 2].reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-8.js index f95968531..65385bf3a 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-8 description: > Array.prototype.reduce - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,16 +15,9 @@ function testcase() { } } - try { Array.prototype[0] = 0; Array.prototype[1] = 1; Array.prototype[2] = 2; [, , ,].reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - delete Array.prototype[1]; - delete Array.prototype[2]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-4.js index d51d654f4..73a14f816 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-4.js @@ -6,21 +6,13 @@ es5id: 15.4.4.21-8-c-4 description: > Array.prototype.reduce doesn't throw error when array has no own properties but prototype contains a single property -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [, , , ]; try { Array.prototype[1] = "prototype"; arr.reduce(function () { }); - return true; - } catch (ex) { - return false; } finally { delete Array.prototype[1]; } - } -runTestCase(testcase); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-10.js index 364d473a8..94251d584 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-10.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - deleting property of prototype in step 8 causes deleted index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -32,12 +29,8 @@ function testcase() { configurable: true }); - try { Object.prototype[3] = 1; Array.prototype.reduce.call(obj, callbackfn); - return testResult && accessed; - } finally { - delete Object.prototype[3]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-11.js index 2e6175b84..571998554 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-11.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-11 description: > Array.prototype.reduce - deleting property of prototype in step 8 causes deleted index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -30,12 +27,8 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; arr.reduce(callbackfn); - return testResult && accessed; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-12.js index 00a571679..518230d38 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-12.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - deleting own property with prototype property in step 8 causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -30,12 +27,7 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; Array.prototype.reduce.call(obj, callbackfn); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-13.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-13.js index 2a87c6cba..0ac438a30 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-13.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-13.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - deleting own property with prototype property in step 8 causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -29,12 +26,7 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; arr.reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-15.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-15.js index d617adae4..cb33ae3b1 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-15.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-15.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-15 description: > Array.prototype.reduce - decreasing length of array with prototype property in step 8 causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -20,7 +17,6 @@ function testcase() { } var arr = [0, 1, 2, 3]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -38,9 +34,4 @@ function testcase() { arr.reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-19.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-19.js index b5ce1f276..25d1b3172 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-19.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-19.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-19 description: > Array.prototype.reduce - properties added to prototype are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -34,11 +31,6 @@ function testcase() { configurable: true }); - try { Array.prototype.reduce.call(obj, callbackfn, "initialValue"); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-20.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-20.js index 70a64eb37..16ee69830 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-20.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-20.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-20 description: > Array.prototype.reduce - properties can be added to prototype are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -34,11 +31,6 @@ function testcase() { configurable: true }); - try { arr.reduce(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-23.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-23.js index 35fe6ee22..817c69c88 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-23.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-23.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-23 description: > Array.prototype.reduce - deleting property of prototype causes deleted index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -31,12 +28,8 @@ function testcase() { configurable: true }); - try { Object.prototype[3] = 1; Array.prototype.reduce.call(obj, callbackfn, "initialValue"); - return testResult && accessed; - } finally { - delete Object.prototype[3]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-24.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-24.js index 93f9208c9..177cac34f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-24.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-24.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-24 description: > Array.prototype.reduce - deleting property of prototype causes deleted index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -30,12 +27,8 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; arr.reduce(callbackfn, "initialValue"); - return testResult && accessed; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-25.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-25.js index cfc7ffdb5..0298579da 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-25.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-25.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - deleting own property with prototype property causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -30,12 +27,7 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; Array.prototype.reduce.call(obj, callbackfn, "initialValue"); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-26.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-26.js index f27c60423..46b725848 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-26.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-26.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-26 description: > Array.prototype.reduce - deleting own property with prototype property causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -28,12 +25,7 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; arr.reduce(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-28.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-28.js index 8bbc583a7..a44efd94a 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-28.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-28.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-28 description: > Array.prototype.reduce - decreasing length of array with prototype property causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -20,7 +17,6 @@ function testcase() { } var arr = [0, 1, 2, 3]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -38,9 +34,4 @@ function testcase() { arr.reduce(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-6.js index d2c78e07a..13789a719 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-6 description: > Array.prototype.reduce - properties added to prototype in step 8 are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -34,11 +31,6 @@ function testcase() { configurable: true }); - try { Array.prototype.reduce.call(obj, callbackfn); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-7.js index 919a860f6..b0ec14398 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-7 description: > Array.prototype.reduce - properties added to prototype in step 8 are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -34,11 +31,6 @@ function testcase() { configurable: true }); - try { arr.reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-12.js index f1ef64857..db642de13 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-12.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-12 description: > Array.prototype.reduce - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Array.prototype[1] = 1; var arr = [0, ,2]; @@ -31,10 +27,5 @@ function testcase() { }); arr.reduce(callbackfn, initialValue); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-14.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-14.js index adf87d01d..3067ab15e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-14.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-14 description: > Array.prototype.reduce - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "1", { get: function () { return 1; @@ -36,10 +32,5 @@ function testcase() { configurable: true }); arr.reduce(callbackfn, initialValue); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-16.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-16.js index 58f4a8472..aaacf94e0 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-16.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-16.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-16 description: > Array.prototype.reduce - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "1", { get: function () { return 1; @@ -30,10 +26,5 @@ function testcase() { var arr = [0, , 2, ]; arr.reduce(callbackfn, initialValue); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-19.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-19.js index cdc1ba9ff..8f0fde6b4 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-19.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -20,7 +17,6 @@ function testcase() { } } - try { Object.defineProperty(Object.prototype, "1", { get: function () { return 1; @@ -36,9 +32,5 @@ function testcase() { }); Array.prototype.reduce.call(obj, callbackfn, initialValue); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-20.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-20.js index d7948d50b..1e98a7a55 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-20.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-20.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -20,7 +17,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "1", { get: function () { return 11; @@ -35,10 +31,5 @@ function testcase() { }); arr.reduce(callbackfn, initialValue); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-22.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-22.js index e4d7ef9b6..ef835d0ac 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-22.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-22 description: > Array.prototype.reduce - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "1", { set: function () { }, configurable: true @@ -28,10 +24,5 @@ function testcase() { var arr = [0, , 2]; arr.reduce(callbackfn, initialValue); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-23.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-23.js index 00113eb51..7d8ad83f1 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-23.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-23.js @@ -6,13 +6,9 @@ es5id: 15.4.4.21-9-c-i-23 description: > Array.prototype.reduce - This object is the global object which contains index property -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -21,19 +17,11 @@ function testcase() { } } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 0; fnGlobalObject()[1] = 1; fnGlobalObject().length = 2; Array.prototype.reduce.call(fnGlobalObject(), callbackfn, initialValue); - return testResult; - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-4.js index 41a712ed5..8808f44d1 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-4 description: > Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,12 +16,7 @@ function testcase() { } } - try { Array.prototype[1] = "3"; [0, 1, 2].reduce(callbackfn, initialValue); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-6.js index 5cecfe049..db1c864bd 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-6 description: > Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "1", { get: function () { return "9"; @@ -27,11 +23,5 @@ function testcase() { configurable: true }); [0, 1, 2].reduce(callbackfn, initialValue); - return testResult; - - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-8.js index c57e824a2..1d8b72d92 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-8 description: > Array.prototype.reduce - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,17 +16,9 @@ function testcase() { } } - try { Array.prototype[0] = 0; Array.prototype[1] = 1; Array.prototype[2] = 2; [, , , ].reduce(callbackfn, initialValue); - return testResult; - } finally { - delete Array.prototype[0]; - delete Array.prototype[1]; - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-10.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-10.js index a146182df..35b7715bb 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-10.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-10.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.22-1-10 description: Array.prototype.reduceRight applied to the Math object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -16,13 +13,8 @@ function testcase() { return '[object Math]' === Object.prototype.toString.call(obj); } - try { Math.length = 1; Math[0] = 1; - return Array.prototype.reduceRight.call(Math, callbackfn, 1) && accessed; - } finally { - delete Math[0]; - delete Math.length; - } - } -runTestCase(testcase); + +assert(Array.prototype.reduceRight.call(Math, callbackfn, 1), 'Array.prototype.reduceRight.call(Math, callbackfn, 1) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-13.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-13.js index b85fa21ff..1791e2bc8 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-13.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-13.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.22-1-13 description: Array.prototype.reduceRight applied to the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -16,13 +13,8 @@ function testcase() { return ('[object JSON]' === Object.prototype.toString.call(obj)); } - try { JSON.length = 1; JSON[0] = 1; - return Array.prototype.reduceRight.call(JSON, callbackfn, 1) && accessed; - } finally { - delete JSON.length; - delete JSON[0]; - } - } -runTestCase(testcase); + +assert(Array.prototype.reduceRight.call(JSON, callbackfn, 1), 'Array.prototype.reduceRight.call(JSON, callbackfn, 1) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-3.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-3.js index 6d932248a..22200e777 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-3.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-3.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.22-1-3 description: Array.prototype.reduceRight applied to boolean primitive -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -16,13 +13,8 @@ function testcase() { return obj instanceof Boolean; } - try { Boolean.prototype[0] = 1; Boolean.prototype.length = 1; - return Array.prototype.reduceRight.call(false, callbackfn, 1) && accessed; - } finally { - delete Boolean.prototype[0]; - delete Boolean.prototype.length; - } - } -runTestCase(testcase); + +assert(Array.prototype.reduceRight.call(false, callbackfn, 1), 'Array.prototype.reduceRight.call(false, callbackfn, 1) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-5.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-5.js index e482f0fbd..16d8c5bbd 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-5.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-5.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.22-1-5 description: Array.prototype.reduceRight applied to number primitive -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -16,13 +13,8 @@ function testcase() { return obj instanceof Number; } - try { Number.prototype[0] = 1; Number.prototype.length = 1; - return Array.prototype.reduceRight.call(2.5, callbackfn, 1) && accessed; - } finally { - delete Number.prototype[0]; - delete Number.prototype.length; - } - } -runTestCase(testcase); + +assert(Array.prototype.reduceRight.call(2.5, callbackfn, 1), 'Array.prototype.reduceRight.call(2.5, callbackfn, 1) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-12.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-12.js index 55c81f627..093e493ba 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-12.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-12.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - 'length' is own accessor property without a get function that overrides an inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,7 +16,6 @@ function testcase() { return typeof obj.length === "undefined"; } - try { Object.defineProperty(Object.prototype, "length", { get: function () { return 2; @@ -33,9 +29,5 @@ function testcase() { configurable: true }); - return Array.prototype.reduceRight.call(obj, callbackfn, 11) === 11 && !accessed; - } finally { - delete Object.prototype.length; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 11), 11, 'Array.prototype.reduceRight.call(obj, callbackfn, 11)'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-15.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-15.js index ae3bf03ab..78a7ee7e9 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-15.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-15.js @@ -6,13 +6,9 @@ es5id: 15.4.4.22-2-15 description: > Array.prototype.reduceRight - 'length' is property of the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -20,18 +16,11 @@ function testcase() { return obj.length === fnGlobalObject().length; } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 12; fnGlobalObject()[1] = 11; fnGlobalObject()[2] = 9; fnGlobalObject().length = 2; - return Array.prototype.reduceRight.call(fnGlobalObject(), callbackfn, 111) && accessed; - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert(Array.prototype.reduceRight.call(fnGlobalObject(), callbackfn, 111), 'Array.prototype.reduceRight.call(fnGlobalObject(), callbackfn, 111) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-18.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-18.js index af67834e8..3d3aed329 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-18.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-18.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-2-18 description: > Array.prototype.reduceRight applied to String object, which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var str = new String("432"); @@ -19,11 +16,7 @@ function testcase() { return obj.length === 3; } - try { String.prototype[3] = "1"; - return Array.prototype.reduceRight.call(str, callbackfn, 111) && accessed; - } finally { - delete String.prototype[3]; - } - } -runTestCase(testcase); + +assert(Array.prototype.reduceRight.call(str, callbackfn, 111), 'Array.prototype.reduceRight.call(str, callbackfn, 111) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-4.js index 930853b5c..3c3a8e6b9 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-2-4 description: > Array.prototype.reduceRight - 'length' is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var arrProtoLen; function callbackfn(prevVal, curVal, idx, obj) { @@ -18,14 +15,8 @@ function testcase() { return obj.length === 2; } - try { arrProtoLen = Array.prototype.length; Array.prototype.length = 0; - return [12, 11].reduceRight(callbackfn, 11) && accessed; - } finally { - Array.prototype.length = arrProtoLen; - } - - } -runTestCase(testcase); +assert([12, 11].reduceRight(callbackfn, 11), '[12, 11].reduceRight(callbackfn, 11) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-12.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-12.js index 96616646d..884278982 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-12.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-12.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Array.prototype[2] = 2; var arr = [0, 1]; @@ -31,10 +27,5 @@ function testcase() { }); arr.reduceRight(callbackfn); - return testResult; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-14.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-14.js index f35f43bd6..bbf447769 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-14.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-14.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "2", { get: function () { return 2; @@ -37,10 +33,5 @@ function testcase() { }); arr.reduceRight(callbackfn); - return testResult; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-16.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-16.js index a7814ef34..7e37073a5 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-16.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-16.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-16 description: > Array.prototype.reduceRight - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,7 +15,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "2", { get: function () { return 2; @@ -29,10 +25,5 @@ function testcase() { var arr = [0, 1, , ]; arr.reduceRight(callbackfn); - return testResult; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-19.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-19.js index c0087cdb0..cb28c4bb1 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-19.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.prototype[2] = 2; var obj = { 0: 0, 1: 1, length: 3 }; @@ -29,10 +25,5 @@ function testcase() { }); Array.prototype.reduceRight.call(obj, callbackfn); - return testResult; - } finally { - delete Object.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-20.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-20.js index 16d9ea43a..a08f1b962 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-20.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-20.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Array.prototype[2] = 2; var arr = [0, 1]; Object.defineProperty(arr, "2", { @@ -28,10 +24,5 @@ function testcase() { }); arr.reduceRight(callbackfn); - return testResult; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-22.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-22.js index c3d2e698b..0f687743b 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-22.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-22 description: > Array.prototype.reduceRight - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,7 +15,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "2", { set: function () { }, configurable: true @@ -27,11 +23,5 @@ function testcase() { var arr = [0, 1, , ]; arr.reduceRight(callbackfn); - return testResult; - - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-23.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-23.js index dfbd2db0a..bbe19f73d 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-23.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-23.js @@ -6,13 +6,9 @@ es5id: 15.4.4.22-8-b-iii-1-23 description: > Array.prototype.reduceRight - This object is the global object which contains index property -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -20,7 +16,6 @@ function testcase() { } } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 0; fnGlobalObject()[1] = 1; @@ -28,13 +23,5 @@ function testcase() { fnGlobalObject().length = 3; Array.prototype.reduceRight.call(fnGlobalObject(), callbackfn); - return testResult; - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-4.js index b4daf842a..579c346cd 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-4 description: > Array.prototype.reduceRight - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,13 +15,7 @@ function testcase() { } } - try { Array.prototype[2] = "11"; [0, 1, 2].reduceRight(callbackfn); - return testResult; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-6.js index 6195bef8a..34ff8e5b3 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-6 description: > Array.prototype.reduceRight - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,7 +15,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "2"; @@ -26,11 +22,5 @@ function testcase() { configurable: true }); [0, 1, 2].reduceRight(callbackfn); - return testResult; - - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-8.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-8.js index 3d23c6185..2471f3353 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-8.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-8 description: > Array.prototype.reduceRight - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,17 +15,9 @@ function testcase() { } } - try { Array.prototype[0] = 0; Array.prototype[1] = 1; Array.prototype[2] = 2; [, , ,].reduceRight(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - delete Array.prototype[1]; - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-4.js index 9b1d5fb86..2824cfd96 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-4.js @@ -6,21 +6,13 @@ es5id: 15.4.4.22-8-c-4 description: > Array.prototype.reduceRight doesn't throw error when array has no own properties but prototype contains a single property -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [, , , ]; try { Array.prototype[1] = "prototype"; arr.reduceRight(function () { }); - return true; - } catch (ex) { - return false; } finally { delete Array.prototype[1]; } - } -runTestCase(testcase); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-10.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-10.js index 0467957d7..8054929e9 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-10.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-10.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - deleting property of prototype in step 8 causes deleted index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -32,12 +29,8 @@ function testcase() { configurable: true }); - try { Object.prototype[3] = 1; Array.prototype.reduceRight.call(obj, callbackfn); - return testResult && accessed; - } finally { - delete Object.prototype[3]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-11.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-11.js index b8dd5940e..c18b3c552 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-11.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-11.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-11 description: > Array.prototype.reduceRight - deleting property of prototype in step 8 causes deleted index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -30,12 +27,8 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; arr.reduceRight(callbackfn); - return testResult && accessed; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-12.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-12.js index a9d1c2165..883290baa 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-12.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-12.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - deleting own property with prototype property in step 8 causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -30,12 +27,7 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; Array.prototype.reduceRight.call(obj, callbackfn); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-13.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-13.js index 725c3de54..b4617abc1 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-13.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-13.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - deleting own property with prototype property in step 8 causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -29,12 +26,7 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; arr.reduceRight(callbackfn); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-15.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-15.js index 3fe58488a..d2c89fe56 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-15.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-15.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - decreasing length of array with prototype property in step 8 causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -21,7 +18,6 @@ function testcase() { } var arr = [0, 1, 2, 3]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -39,9 +35,4 @@ function testcase() { arr.reduceRight(callbackfn); - return testResult; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-19.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-19.js index 9fc059f06..677fc5218 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-19.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-19.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-19 description: > Array.prototype.reduceRight - properties added to prototype are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -34,11 +31,6 @@ function testcase() { configurable: true }); - try { Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-20.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-20.js index 5d47fd9f1..4a1c7dcc4 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-20.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-20.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-20 description: > Array.prototype.reduceRight - properties added to prototype can be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -34,11 +31,6 @@ function testcase() { configurable: true }); - try { arr.reduceRight(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-23.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-23.js index 33f434433..6ced9a816 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-23.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-23.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - deleting property of prototype causes deleted index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -32,12 +29,8 @@ function testcase() { configurable: true }); - try { Object.prototype[3] = 1; Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); - return testResult && accessed; - } finally { - delete Object.prototype[3]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-24.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-24.js index 0fee30536..218340c5f 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-24.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-24.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-24 description: > Array.prototype.reduceRight - deleting property of prototype causes deleted index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -30,12 +27,8 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; arr.reduceRight(callbackfn, "initialValue"); - return testResult && accessed; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-25.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-25.js index 5234c1958..ab59c0780 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-25.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-25.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - deleting own property with prototype property causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -30,12 +27,7 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-26.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-26.js index 96ecdf625..08231b2e4 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-26.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-26.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-26 description: > Array.prototype.reduceRight - deleting own property with prototype property causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -28,12 +25,7 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; arr.reduceRight(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-28.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-28.js index e77cae365..7c3743976 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-28.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-28.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-28 description: > Array.prototype.reduceRight - decreasing length of array with prototype property causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -20,7 +17,6 @@ function testcase() { } var arr = [0, 1, 2, 3]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -38,9 +34,4 @@ function testcase() { arr.reduceRight(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-6.js index 8f96ac484..db4e3977d 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-6 description: > Array.prototype.reduceRight - properties added to prototype in step 8 visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(preVal, curVal, idx, obj) { @@ -34,11 +31,6 @@ function testcase() { configurable: true }); - try { Array.prototype.reduceRight.call(obj, callbackfn); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-7.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-7.js index c83e459fb..9dd8692bd 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-7.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-7 description: > Array.prototype.reduceRight - properties added to prototype in step 8 visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(preVal, curVal, idx, obj) { @@ -34,11 +31,6 @@ function testcase() { configurable: true }); - try { arr.reduceRight(callbackfn); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-12.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-12.js index d62bfc9d5..495ed1040 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-12.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-12.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Array.prototype[1] = 11; var arr = [0, ,2]; @@ -31,10 +27,5 @@ function testcase() { }); arr.reduceRight(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-14.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-14.js index f9a8c8ada..80e358bc9 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-14.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-14.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "1", { get: function () { return 11; @@ -36,10 +32,5 @@ function testcase() { configurable: true }); arr.reduceRight(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-16.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-16.js index ced9ca9bf..494abf802 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-16.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-16.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-c-i-16 description: > Array.prototype.reduceRight - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,7 +15,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "1", { get: function () { return 1; @@ -29,10 +25,5 @@ function testcase() { var arr = [0, , 2]; arr.reduceRight(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-19.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-19.js index b93bb45e0..a5c367dd8 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-19.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.prototype[1] = 1; var obj = { 0: 0, 2: 2, length: 3 }; @@ -29,10 +25,5 @@ function testcase() { }); Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-20.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-20.js index 0e2c194fa..5a901f843 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-20.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-20.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Array.prototype[1] = 1; var arr = [0, ,2]; Object.defineProperty(arr, "1", { @@ -28,10 +24,5 @@ function testcase() { }); arr.reduceRight(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-22.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-22.js index 2b2062867..256d03072 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-22.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-c-i-22 description: > Array.prototype.reduceRight - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,7 +15,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "1", { set: function () { }, configurable: true @@ -27,11 +23,5 @@ function testcase() { var arr = [0, , 2]; arr.reduceRight(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[1]; - } - - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-23.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-23.js index 2411819ba..854466ce7 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-23.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-23.js @@ -6,13 +6,9 @@ es5id: 15.4.4.22-9-c-i-23 description: > Array.prototype.reduceRight - This object is an global object which contains index property -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -20,7 +16,6 @@ function testcase() { } } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 0; fnGlobalObject()[1] = 1; @@ -28,13 +23,5 @@ function testcase() { fnGlobalObject().length = 3; Array.prototype.reduceRight.call(fnGlobalObject(), callbackfn, "initialValue"); - return testResult; - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-4.js index 6bdad8d75..1021829d7 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-c-i-4 description: > Array.prototype.reduceRight - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,13 +15,7 @@ function testcase() { } } - try { Array.prototype[1] = "11"; [0, 1, 2].reduceRight(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-6.js index d4b4e6f23..80d577ff8 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-c-i-6 description: > Array.prototype.reduceRight - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,7 +15,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "1", { get: function () { return "11"; @@ -26,11 +22,5 @@ function testcase() { configurable: true }); [0, 1, 2].reduceRight(callbackfn, "initialValue"); - return testResult; - - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-8.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-8.js index e961a66b8..bf150824f 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-8.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-c-i-8 description: > Array.prototype.reduceRight - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,17 +15,9 @@ function testcase() { } } - try { Array.prototype[0] = 0; Array.prototype[1] = 1; Array.prototype[2] = 2; [, , , ].reduceRight(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[0]; - delete Array.prototype[1]; - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/slice/15.4.4.10-10-c-ii-1.js b/test/built-ins/Array/prototype/slice/15.4.4.10-10-c-ii-1.js index 1d6502bb0..87c916c8e 100644 --- a/test/built-ins/Array/prototype/slice/15.4.4.10-10-c-ii-1.js +++ b/test/built-ins/Array/prototype/slice/15.4.4.10-10-c-ii-1.js @@ -6,12 +6,10 @@ es5id: 15.4.4.10-10-c-ii-1 description: > Array.prototype.slice will slice a string from start to end when index property (read-only) exists in Array.prototype (Step 10.c.ii) -includes: [runTestCase.js] ---*/ -function testcase() { var arrObj = [1, 2, 3]; - try { + Object.defineProperty(Array.prototype, "0", { value: "test", writable: false, @@ -19,9 +17,7 @@ function testcase() { }); var newArr = arrObj.slice(0, 1); - return newArr.hasOwnProperty("0") && newArr[0] === 1 && typeof newArr[1] === "undefined"; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert(newArr.hasOwnProperty("0"), 'newArr.hasOwnProperty("0") !== true'); +assert.sameValue(newArr[0], 1, 'newArr[0]'); +assert.sameValue(typeof newArr[1], "undefined", 'typeof newArr[1]'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-10.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-10.js index 17802f684..dc3da61b6 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-10.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-10.js @@ -4,21 +4,13 @@ /*--- es5id: 15.4.4.17-1-10 description: Array.prototype.some applied to the Math object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return '[object Math]' === Object.prototype.toString.call(obj); } - try { Math.length = 1; Math[0] = 1; - return Array.prototype.some.call(Math, callbackfn); - } finally { - delete Math[0]; - delete Math.length; - } - } -runTestCase(testcase); + +assert(Array.prototype.some.call(Math, callbackfn), 'Array.prototype.some.call(Math, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-13.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-13.js index 000540c0b..7490883da 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-13.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-13.js @@ -4,21 +4,13 @@ /*--- es5id: 15.4.4.17-1-13 description: Array.prototype.some applied to the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return '[object JSON]' === Object.prototype.toString.call(obj); } - try { JSON.length = 1; JSON[0] = 1; - return Array.prototype.some.call(JSON, callbackfn); - } finally { - delete JSON.length; - delete JSON[0]; - } - } -runTestCase(testcase); + +assert(Array.prototype.some.call(JSON, callbackfn), 'Array.prototype.some.call(JSON, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-3.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-3.js index 170a7a338..7acbd36b9 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-3.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-3.js @@ -4,21 +4,13 @@ /*--- es5id: 15.4.4.17-1-3 description: Array.prototype.some applied to boolean primitive -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return obj instanceof Boolean; } - try { Boolean.prototype[0] = 1; Boolean.prototype.length = 1; - return Array.prototype.some.call(false, callbackfn); - } finally { - delete Boolean.prototype[0]; - delete Boolean.prototype.length; - } - } -runTestCase(testcase); + +assert(Array.prototype.some.call(false, callbackfn), 'Array.prototype.some.call(false, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-5.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-5.js index b1a9aa3c2..bf46fb2e4 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-5.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-5.js @@ -4,22 +4,13 @@ /*--- es5id: 15.4.4.17-1-5 description: Array.prototype.some applied to number primitive -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return obj instanceof Number; } - try { Number.prototype[1] = true; Number.prototype.length = 2; - return Array.prototype.some.call(5, callbackfn); - } finally { - delete Number.prototype[1]; - delete Number.prototype.length; - } - } -runTestCase(testcase); +assert(Array.prototype.some.call(5, callbackfn), 'Array.prototype.some.call(5, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-12.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-12.js index 11cb05fb4..12fd36f0a 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-12.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-12.js @@ -7,10 +7,8 @@ description: > Array.prototype.some - 'length' is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { var accessed = false; function callbackfn(val, idx, obj) { @@ -18,7 +16,6 @@ function testcase() { return val > 10; } - try { Object.defineProperty(Object.prototype, "length", { get: function () { return 2; @@ -32,10 +29,5 @@ function testcase() { configurable: true }); - return !Array.prototype.some.call(obj, callbackfn) && !accessed; - } finally { - delete Object.prototype.length; - } - - } -runTestCase(testcase); +assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-15.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-15.js index 0fd272699..ea05feca4 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-15.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-15.js @@ -4,12 +4,9 @@ /*--- es5id: 15.4.4.17-2-15 description: Array.prototype.some - 'length' is property of the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { function callbackfn1(val, idx, obj) { return val > 10; } @@ -18,19 +15,11 @@ function testcase() { return val > 11; } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 9; fnGlobalObject()[1] = 11; fnGlobalObject()[2] = 12; fnGlobalObject().length = 2; - return Array.prototype.some.call(fnGlobalObject(), callbackfn1) && - !Array.prototype.some.call(fnGlobalObject(), callbackfn2); - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert(Array.prototype.some.call(fnGlobalObject(), callbackfn1), 'Array.prototype.some.call(fnGlobalObject(), callbackfn1) !== true'); +assert.sameValue(Array.prototype.some.call(fnGlobalObject(), callbackfn2), false, 'Array.prototype.some.call(fnGlobalObject(), callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-18.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-18.js index 76fe23861..e219d16d0 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-18.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-18.js @@ -6,10 +6,8 @@ es5id: 15.4.4.17-2-18 description: > Array.prototype.some applied to String object which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn1(val, idx, obj) { return parseInt(val, 10) > 1; } @@ -19,12 +17,8 @@ function testcase() { } var str = new String("12"); - try { + String.prototype[2] = "3"; - return Array.prototype.some.call(str, callbackfn1) && - !Array.prototype.some.call(str, callbackfn2); - } finally { - delete String.prototype[2]; - } - } -runTestCase(testcase); + +assert(Array.prototype.some.call(str, callbackfn1), 'Array.prototype.some.call(str, callbackfn1) !== true'); +assert.sameValue(Array.prototype.some.call(str, callbackfn2), false, 'Array.prototype.some.call(str, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-2.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-2.js index beffb9869..2a2ddb2e6 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-2.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-2.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.17-2-2 description: Array.prototype.some - 'length' is own data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn1(val, idx, obj) { return val > 10; } @@ -16,13 +14,7 @@ function testcase() { return val > 11; } - try { Array.prototype[2] = 12; - return [9, 11].some(callbackfn1) && - ![9, 11].some(callbackfn2); - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert([9, 11].some(callbackfn1), '[9, 11].some(callbackfn1) !== true'); +assert.sameValue([9, 11].some(callbackfn2), false, '[9, 11].some(callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-4.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-4.js index 7a5dc81e8..be0080c1a 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-4.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-4.js @@ -6,10 +6,8 @@ es5id: 15.4.4.17-2-4 description: > Array.prototype.some - 'length' is an own data property that overrides an inherited data property on an array -includes: [runTestCase.js] ---*/ -function testcase() { var arrProtoLen = 0; function callbackfn1(val, idx, obj) { return val > 10; @@ -19,16 +17,9 @@ function testcase() { return val > 11; } - try { arrProtoLen = Array.prototype.length; Array.prototype.length = 0; Array.prototype[2] = 12; - return [9, 11].some(callbackfn1) && - ![9, 11].some(callbackfn2); - } finally { - Array.prototype.length = arrProtoLen; - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert([9, 11].some(callbackfn1), '[9, 11].some(callbackfn1) !== true'); +assert.sameValue([9, 11].some(callbackfn2), false, '[9, 11].some(callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-10.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-10.js index a09079c05..64e1ab5f1 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-10.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-10.js @@ -6,10 +6,8 @@ es5id: 15.4.4.17-7-b-10 description: > Array.prototype.some - deleting property of prototype causes prototype index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { var accessed = false; function callbackfn(val, idx, obj) { accessed = true; @@ -25,11 +23,7 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; - return !Array.prototype.some.call(arr, callbackfn) && accessed; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.some.call(arr, callbackfn), false, 'Array.prototype.some.call(arr, callbackfn)'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-11.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-11.js index d9137ecdd..f17bcee47 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-11.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-11.js @@ -6,10 +6,8 @@ es5id: 15.4.4.17-7-b-11 description: > Array.prototype.some - deleting property of prototype causes prototype index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var accessed = false; function callbackfn(val, idx, obj) { accessed = true; @@ -25,11 +23,7 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; - return !arr.some(callbackfn) && accessed; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-12.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-12.js index c3ac908bc..0081c57f5 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-12.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-12.js @@ -7,10 +7,8 @@ description: > Array.prototype.some - deleting own property with prototype property causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 1) { return true; @@ -28,11 +26,6 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; - return Array.prototype.some.call(arr, callbackfn); - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(Array.prototype.some.call(arr, callbackfn), 'Array.prototype.some.call(arr, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-13.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-13.js index e8ca3bbd2..b8247515d 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-13.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-13.js @@ -6,10 +6,8 @@ es5id: 15.4.4.17-7-b-13 description: > Array.prototype.some - deleting own property with prototype property causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 1) { return true; @@ -27,11 +25,6 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; - return arr.some(callbackfn); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-15.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-15.js index 257b6e61f..16c4c4b10 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-15.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-15.js @@ -6,10 +6,8 @@ es5id: 15.4.4.17-7-b-15 description: > Array.prototype.some - decreasing length of array with prototype property causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 2 && val === "prototype") { return true; @@ -19,7 +17,6 @@ function testcase() { } var arr = [0, 1, 2]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -35,9 +32,4 @@ function testcase() { configurable: true }); - return arr.some(callbackfn); - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-6.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-6.js index 1fab1f9e5..71e74ef6d 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-6.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-6.js @@ -6,10 +6,8 @@ es5id: 15.4.4.17-7-b-6 description: > Array.prototype.some - properties can be added to prototype after current position are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 6.99) { return true; @@ -32,10 +30,4 @@ function testcase() { configurable: true }); - try { - return Array.prototype.some.call(arr, callbackfn); - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); +assert(Array.prototype.some.call(arr, callbackfn), 'Array.prototype.some.call(arr, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-7.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-7.js index 185e67404..2211b41dd 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-7.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-7.js @@ -6,10 +6,8 @@ es5id: 15.4.4.17-7-b-7 description: > Array.prototype.some - properties can be added to prototype after current position are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 6.99) { return true; @@ -32,10 +30,4 @@ function testcase() { configurable: true }); - try { - return arr.some(callbackfn); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-12.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-12.js index 80f0f862a..10383aea3 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-12.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-12.js @@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-12 description: > Array.prototype.some - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = "abc"; function callbackfn(val, idx, obj) { @@ -21,7 +18,7 @@ function testcase() { } var arr = []; - try { + Array.prototype[1] = 100; Object.defineProperty(arr, "1", { get: function () { @@ -30,9 +27,4 @@ function testcase() { configurable: true }); - return arr.some(callbackfn); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-14.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-14.js index 9ec54a9ed..01a680559 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-14.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-14 description: > Array.prototype.some - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = "abc"; function callbackfn(val, idx, obj) { @@ -28,7 +25,6 @@ function testcase() { configurable: true }); - try { Object.defineProperty(Array.prototype, "1", { get: function () { return 10; @@ -36,9 +32,4 @@ function testcase() { configurable: true }); - return arr.some(callbackfn); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-16.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-16.js index fee268da8..da4e0699b 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-16.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-16.js @@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-16 description: > Array.prototype.some - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = "abc"; function callbackfn(val, idx, obj) { @@ -20,7 +17,6 @@ function testcase() { return false; } - try { Object.defineProperty(Array.prototype, "1", { get: function () { return kValue; @@ -28,9 +24,4 @@ function testcase() { configurable: true }); - return [, , ].some(callbackfn); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert([, , ].some(callbackfn), '[, , ].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-19.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-19.js index 9f5825f68..931cf2641 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-19.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.some - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 1) { return typeof val === "undefined"; @@ -24,11 +21,7 @@ function testcase() { set: function () { }, configurable: true }); - try { + Object.prototype[1] = 10; - return Array.prototype.some.call(obj, callbackfn); - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-20.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-20.js index 39b6fabb2..885a59f4e 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-20.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-20.js @@ -7,11 +7,8 @@ description: > Array.prototype.some - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 0) { return typeof val === "undefined"; @@ -26,11 +23,6 @@ function testcase() { configurable: true }); - try { Array.prototype[0] = 100; - return arr.some(callbackfn); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-22.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-22.js index 8d6f5ae8e..f46deb8fc 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-22.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-22 description: > Array.prototype.some - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 0) { return typeof val === "undefined"; @@ -18,16 +15,9 @@ function testcase() { return false; } - try { Object.defineProperty(Array.prototype, "0", { set: function () { }, configurable: true }); - return [, ].some(callbackfn); - } finally { - delete Array.prototype[0]; - } - - } -runTestCase(testcase); +assert([, ].some(callbackfn), '[, ].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-23.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-23.js index 7127d49a2..4c4ec2ab5 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-23.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-23.js @@ -6,13 +6,9 @@ es5id: 15.4.4.17-7-c-i-23 description: > Array.prototype.some - This object is an global object which contains index property -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 0) { return val === 11; @@ -20,14 +16,8 @@ function testcase() { return false; } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 11; fnGlobalObject().length = 1; - return Array.prototype.some.call(fnGlobalObject(), callbackfn); - } finally { - delete fnGlobalObject()[0]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert(Array.prototype.some.call(fnGlobalObject(), callbackfn), 'Array.prototype.some.call(fnGlobalObject(), callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-4.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-4.js index 6d335fabb..f2317b247 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-4.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-4 description: > Array.prototype.some - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = "abc"; function callbackfn(val, idx, obj) { @@ -20,12 +17,6 @@ function testcase() { return false; } - try { Array.prototype[0] = 11; - return [kValue].some(callbackfn); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert([kValue].some(callbackfn), '[kValue].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-6.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-6.js index 36b322b54..237c6c55d 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-6.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-6 description: > Array.prototype.some - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = 1000; function callbackfn(val, idx, obj) { @@ -20,16 +17,11 @@ function testcase() { return false; } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 9; }, configurable: true }); - return [kValue].some(callbackfn); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert([kValue].some(callbackfn), '[kValue].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-8.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-8.js index b97461441..db423ed3b 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-8.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-8 description: > Array.prototype.some - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = {}; function callbackfn(val, idx, obj) { @@ -20,12 +17,6 @@ function testcase() { return false; } - try { Array.prototype[0] = kValue; - return [, ].some(callbackfn); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert([, ].some(callbackfn), '[, ].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/splice/15.4.4.12-9-c-ii-1.js b/test/built-ins/Array/prototype/splice/15.4.4.12-9-c-ii-1.js index 091e20aef..0fd56380b 100644 --- a/test/built-ins/Array/prototype/splice/15.4.4.12-9-c-ii-1.js +++ b/test/built-ins/Array/prototype/splice/15.4.4.12-9-c-ii-1.js @@ -7,11 +7,8 @@ description: > Array.prototype.splice will splice an array even when Array.prototype has index '0' set to read-only and 'fromPresent' less than 'actualDeleteCount (Step 9.c.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - try { var arr = ["a", "b", "c"]; Array.prototype[0] = "test"; var newArr = arr.splice(2, 1, "d"); @@ -35,9 +32,7 @@ function testcase() { delete newArr[0]; verifyConfigurable = newArr.hasOwnProperty("0"); - return verifyValue && !verifyConfigurable && verifyEnumerable && verifyWritable; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(verifyValue, 'verifyValue !== true'); +assert.sameValue(verifyConfigurable, false, 'verifyConfigurable'); +assert(verifyEnumerable, 'verifyEnumerable !== true'); +assert(verifyWritable, 'verifyWritable !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-11-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5-11-1.js index 09ede3a2e..924da6e02 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-11-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-11-1.js @@ -6,19 +6,11 @@ es5id: 15.3.4.5-11-1 description: > Function.prototype.bind - internal property [[Prototype]] of 'F' is set as Function.prototype -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function () { }; - try { + Function.prototype.property = 12; var obj = foo.bind({}); - return obj.property === 12; - } finally { - delete Function.prototype.property; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, 12, 'obj.property'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-6-10.js b/test/built-ins/Function/prototype/bind/15.3.4.5-6-10.js index d881cf202..d4d1b0996 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-6-10.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-6-10.js @@ -6,15 +6,12 @@ es5id: 15.3.4.5-6-10 description: > Function.prototype.bind - F can get own accessor property without a get function that overrides an inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function () { }; var obj = foo.bind({}); - try { + Object.defineProperty(Function.prototype, "property", { get: function () { return 3; @@ -25,9 +22,5 @@ function testcase() { Object.defineProperty(obj, "property", { set: function () { } }); - return typeof (obj.property) === "undefined"; - } finally { - delete Function.prototype.property; - } - } -runTestCase(testcase); + +assert.sameValue(typeof (obj.property), "undefined", 'typeof (obj.property)'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-6-11.js b/test/built-ins/Function/prototype/bind/15.3.4.5-6-11.js index 6713bb383..2f3939817 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-6-11.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-6-11.js @@ -6,22 +6,15 @@ es5id: 15.3.4.5-6-11 description: > Function.prototype.bind - F can get inherited accessor property without a get function -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function () { }; var obj = foo.bind({}); - try { + Object.defineProperty(Function.prototype, "property", { set: function () { }, configurable: true }); - return typeof (obj.property) === "undefined"; - } finally { - delete Function.prototype.property; - } - } -runTestCase(testcase); + +assert.sameValue(typeof (obj.property), "undefined", 'typeof (obj.property)'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-6-2.js b/test/built-ins/Function/prototype/bind/15.3.4.5-6-2.js index 9f717533c..e6718ada4 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-6-2.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-6-2.js @@ -4,19 +4,12 @@ /*--- es5id: 15.3.4.5-6-2 description: Function.prototype.bind - F can get inherited data property -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function () { }; var obj = foo.bind({}); - try { + Function.prototype.property = 12; - return obj.property === 12; - } finally { - delete Function.prototype.property; - } - } -runTestCase(testcase); + +assert.sameValue(obj.property, 12, 'obj.property'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-6-3.js b/test/built-ins/Function/prototype/bind/15.3.4.5-6-3.js index 77b511fad..a3cc6aaac 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-6-3.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-6-3.js @@ -6,21 +6,13 @@ es5id: 15.3.4.5-6-3 description: > Function.prototype.bind - F can get own data property that overrides an inherited data property -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function () { }; var obj = foo.bind({}); - try { Function.prototype.property = 3; obj.property = 12; - return obj.property === 12; - } finally { - delete Function.prototype.property; - } - } -runTestCase(testcase); + +assert.sameValue(obj.property, 12, 'obj.property'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-6-4.js b/test/built-ins/Function/prototype/bind/15.3.4.5-6-4.js index 77077375d..914e18209 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-6-4.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-6-4.js @@ -6,15 +6,12 @@ es5id: 15.3.4.5-6-4 description: > Function.prototype.bind - F can get own data property that overrides an inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function () { }; var obj = foo.bind({}); - try { + Object.defineProperty(Function.prototype, "property", { get: function () { return 3; @@ -26,9 +23,4 @@ function testcase() { value: 12 }); - return obj.property === 12; - } finally { - delete Function.prototype.property; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, 12, 'obj.property'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-6-6.js b/test/built-ins/Function/prototype/bind/15.3.4.5-6-6.js index af0be5005..4abb56c50 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-6-6.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-6-6.js @@ -4,24 +4,17 @@ /*--- es5id: 15.3.4.5-6-6 description: Function.prototype.bind - F can get inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function () { }; var obj = foo.bind({}); - try { + Object.defineProperty(Function.prototype, "property", { get: function () { return 12; }, configurable: true }); - return obj.property === 12; - } finally { - delete Function.prototype.property; - } - } -runTestCase(testcase); + +assert.sameValue(obj.property, 12, 'obj.property'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-6-7.js b/test/built-ins/Function/prototype/bind/15.3.4.5-6-7.js index 794bd4323..7dc8018d1 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-6-7.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-6-7.js @@ -6,24 +6,17 @@ es5id: 15.3.4.5-6-7 description: > Function.prototype.bind - F can get own accessor property that overrides an inherited data property -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function () { }; var obj = foo.bind({}); - try { + Function.prototype.property = 3; Object.defineProperty(obj, "property", { get: function () { return 12; } }); - return obj.property === 12; - } finally { - delete Function.prototype.property; - } - } -runTestCase(testcase); + +assert.sameValue(obj.property, 12, 'obj.property'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-6-8.js b/test/built-ins/Function/prototype/bind/15.3.4.5-6-8.js index fbb52a2c0..65bf83aad 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-6-8.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-6-8.js @@ -6,15 +6,12 @@ es5id: 15.3.4.5-6-8 description: > Function.prototype.bind - F can get own accessor property that overrides an inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function () { }; var obj = foo.bind({}); - try { + Object.defineProperty(Function.prototype, "property", { get: function () { return 3; @@ -27,9 +24,5 @@ function testcase() { return 12; } }); - return obj.property === 12; - } finally { - delete Function.prototype.property; - } - } -runTestCase(testcase); + +assert.sameValue(obj.property, 12, 'obj.property'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-5.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-5.js index 9b3e0f548..1bc2037b5 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-5.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-5.js @@ -6,13 +6,10 @@ es5id: 15.3.4.5.2-4-5 description: > [[Construct]] - length of parameters of 'target' is 0, length of 'boundArgs' is 0, length of 'ExtraArgs' is 0, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; - try { Object.prototype.verifyThis = "verifyThis"; var func = function () { return new Boolean(arguments.length === 0 && Object.prototype.toString.call(this) === "[object Object]" && @@ -23,9 +20,4 @@ function testcase() { var newInstance = new NewFunc(); - return newInstance.valueOf(); - } finally { - delete Object.prototype.verifyThis; - } - } -runTestCase(testcase); +assert(newInstance.valueOf(), 'newInstance.valueOf() !== true'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-10.js b/test/built-ins/Object/create/15.2.3.5-4-10.js index 144db6c9b..b62c3b3c4 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-10.js +++ b/test/built-ins/Object/create/15.2.3.5-4-10.js @@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-10 description: > Object.create - argument 'Properties' is the Math object (15.2.3.7 step 2) -includes: [runTestCase.js] ---*/ -function testcase() { - var result = false; Object.defineProperty(Math, "prop", { get: function () { @@ -21,11 +18,7 @@ function testcase() { configurable: true }); - try { var newObj = Object.create({}, Math); - return result && newObj.hasOwnProperty("prop"); - } finally { - delete Math.prop; - } - } -runTestCase(testcase); + +assert(result, 'result !== true'); +assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-117.js b/test/built-ins/Object/create/15.2.3.5-4-117.js index 346af06db..0def02aaa 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-117.js +++ b/test/built-ins/Object/create/15.2.3.5-4-117.js @@ -7,12 +7,8 @@ description: > Object.create - one property in 'Properties' is the Math object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Math.configurable = true; var newObj = Object.create({}, { @@ -23,9 +19,5 @@ function testcase() { delete newObj.prop; var result2 = newObj.hasOwnProperty("prop"); - return result1 === true && result2 === false; - } finally { - delete Math.configurable; - } - } -runTestCase(testcase); +assert.sameValue(result1, true, 'result1'); +assert.sameValue(result2, false, 'result2'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-120.js b/test/built-ins/Object/create/15.2.3.5-4-120.js index d561bb5d0..0ca99d135 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-120.js +++ b/test/built-ins/Object/create/15.2.3.5-4-120.js @@ -7,12 +7,8 @@ description: > Object.create - one property in 'Properties' is the JSON object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { JSON.configurable = true; var newObj = Object.create({}, { @@ -23,9 +19,5 @@ function testcase() { delete newObj.prop; var result2 = newObj.hasOwnProperty("prop"); - return result1 === true && result2 === false; - } finally { - delete JSON.configurable; - } - } -runTestCase(testcase); +assert.sameValue(result1, true, 'result1'); +assert.sameValue(result2, false, 'result2'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-124.js b/test/built-ins/Object/create/15.2.3.5-4-124.js index e380ba737..d22aee94f 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-124.js +++ b/test/built-ins/Object/create/15.2.3.5-4-124.js @@ -7,14 +7,9 @@ description: > Object.create - one property in 'Properties' is the global object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - - try { fnGlobalObject().configurable = true; var newObj = Object.create({}, { @@ -25,9 +20,5 @@ function testcase() { delete newObj.prop; var result2 = newObj.hasOwnProperty("prop"); - return result1 === true && result2 === false; - } finally { - delete fnGlobalObject().configurable; - } - } -runTestCase(testcase); +assert.sameValue(result1, true, 'result1'); +assert.sameValue(result2, false, 'result2'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-13.js b/test/built-ins/Object/create/15.2.3.5-4-13.js index 6aeabdb62..582f529fd 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-13.js +++ b/test/built-ins/Object/create/15.2.3.5-4-13.js @@ -6,11 +6,8 @@ es5id: 15.2.3.5-4-13 description: > Object.create - argument 'Properties' is the JSON object (15.2.3.7 step 2) -includes: [runTestCase.js] ---*/ -function testcase() { - var result = false; Object.defineProperty(JSON, "prop", { @@ -22,11 +19,7 @@ function testcase() { configurable: true }); - try { var newObj = Object.create({}, JSON); - return result && newObj.hasOwnProperty("prop"); - } finally { - delete JSON.prop; - } - } -runTestCase(testcase); + +assert(result, 'result !== true'); +assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-170.js b/test/built-ins/Object/create/15.2.3.5-4-170.js index 02d511b2f..b3c650792 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-170.js +++ b/test/built-ins/Object/create/15.2.3.5-4-170.js @@ -7,21 +7,12 @@ description: > Object.create - one property in 'Properties' is the Math object that uses Object's [[Get]] method to access the 'value' property (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Math.value = "MathValue"; var newObj = Object.create({}, { prop: Math }); - return newObj.prop === "MathValue"; - } finally { - delete Math.value; - } - } -runTestCase(testcase); +assert.sameValue(newObj.prop, "MathValue", 'newObj.prop'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-173.js b/test/built-ins/Object/create/15.2.3.5-4-173.js index eeb9d7d78..01a704169 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-173.js +++ b/test/built-ins/Object/create/15.2.3.5-4-173.js @@ -7,21 +7,12 @@ description: > Object.create - one property in 'Properties' is the JSON object that uses Object's [[Get]] method to access the 'value' property (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { JSON.value = "JSONValue"; var newObj = Object.create({}, { prop: JSON }); - return newObj.prop === "JSONValue"; - } finally { - delete JSON.value; - } - } -runTestCase(testcase); +assert.sameValue(newObj.prop, "JSONValue", 'newObj.prop'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-177.js b/test/built-ins/Object/create/15.2.3.5-4-177.js index 4fad22f25..d9e835efb 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-177.js +++ b/test/built-ins/Object/create/15.2.3.5-4-177.js @@ -7,23 +7,13 @@ description: > Object.create - one property in 'Properties' is the global object that uses Object's [[Get]] method to access the 'value' property (8.10.5 step 5.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - - try { fnGlobalObject().value = "GlobalValue"; var newObj = Object.create({}, { prop: fnGlobalObject() }); - return newObj.prop === "GlobalValue"; - } finally { - delete fnGlobalObject().value; - } - } -runTestCase(testcase); +assert.sameValue(newObj.prop, "GlobalValue", 'newObj.prop'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-196.js b/test/built-ins/Object/create/15.2.3.5-4-196.js index 6a254ac59..4a10a2d35 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-196.js +++ b/test/built-ins/Object/create/15.2.3.5-4-196.js @@ -7,12 +7,8 @@ description: > Object.create - one property in 'Properties' is the Math object that uses Object's [[Get]] method to access the 'writable' property (8.10.5 step 6.a) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Math.writable = true; var newObj = Object.create({}, { @@ -25,9 +21,5 @@ function testcase() { var afterWrite = (newObj.prop === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete Math.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-199.js b/test/built-ins/Object/create/15.2.3.5-4-199.js index 77afd18ae..b0d111992 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-199.js +++ b/test/built-ins/Object/create/15.2.3.5-4-199.js @@ -7,12 +7,8 @@ description: > Object.create - one property in 'Properties' is the JSON object that uses Object's [[Get]] method to access the 'writable' property (8.10.5 step 6.a) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { JSON.writable = true; var newObj = Object.create({}, { @@ -25,9 +21,5 @@ function testcase() { var afterWrite = (newObj.prop === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete JSON.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-203.js b/test/built-ins/Object/create/15.2.3.5-4-203.js index 99dfdc7b7..013ecb214 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-203.js +++ b/test/built-ins/Object/create/15.2.3.5-4-203.js @@ -7,14 +7,9 @@ description: > Object.create - one property in 'Properties' is the global object that uses Object's [[Get]] method to access the 'writable' property (8.10.5 step 6.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - - try { fnGlobalObject().writable = true; var newObj = Object.create({}, { @@ -27,9 +22,5 @@ function testcase() { var afterWrite = (newObj.prop === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete fnGlobalObject().writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-251.js b/test/built-ins/Object/create/15.2.3.5-4-251.js index 0e151bc1a..eceff600f 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-251.js +++ b/test/built-ins/Object/create/15.2.3.5-4-251.js @@ -7,11 +7,8 @@ description: > Object.create - one property in 'Properties' is the Math object that uses Object's [[Get]] method to access the 'get' property (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Math.get = function () { return "VerifyMathObject"; }; @@ -20,9 +17,4 @@ function testcase() { prop: Math }); - return newObj.prop === "VerifyMathObject"; - } finally { - delete Math.get; - } - } -runTestCase(testcase); +assert.sameValue(newObj.prop, "VerifyMathObject", 'newObj.prop'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-252.js b/test/built-ins/Object/create/15.2.3.5-4-252.js index a83e2bd45..e5cd76b90 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-252.js +++ b/test/built-ins/Object/create/15.2.3.5-4-252.js @@ -7,22 +7,14 @@ description: > Object.create - one property in 'Properties' is the JSON object that uses Object's [[Get]] method to access the 'get' property (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { JSON.get = function () { return "VerifyJSONObject"; }; - try { var newObj = Object.create({}, { prop: JSON }); - return newObj.prop === "VerifyJSONObject"; - } finally { - delete JSON.get; - } - } -runTestCase(testcase); +assert.sameValue(newObj.prop, "VerifyJSONObject", 'newObj.prop'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-256.js b/test/built-ins/Object/create/15.2.3.5-4-256.js index 1d7146537..6f35538fe 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-256.js +++ b/test/built-ins/Object/create/15.2.3.5-4-256.js @@ -7,24 +7,15 @@ description: > Object.create - one property in 'Properties' is the global object that uses Object's [[Get]] method to access the 'get' property (8.10.5 step 7.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { fnGlobalObject().get = function () { return "VerifyGlobalObject"; }; - try { var newObj = Object.create({}, { prop: fnGlobalObject() }); - return newObj.prop === "VerifyGlobalObject"; - } finally { - delete fnGlobalObject().get; - } - } -runTestCase(testcase); +assert.sameValue(newObj.prop, "VerifyGlobalObject", 'newObj.prop'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-284.js b/test/built-ins/Object/create/15.2.3.5-4-284.js index 53769b792..58777acf2 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-284.js +++ b/test/built-ins/Object/create/15.2.3.5-4-284.js @@ -7,13 +7,10 @@ description: > Object.create - one property in 'Properties' is the Math object that uses Object's [[Get]] method to access the 'set' property (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var data = "data"; - try { Math.set = function (value) { data = value; }; @@ -26,9 +23,5 @@ function testcase() { newObj.prop = "overrideData"; - return hasProperty && data === "overrideData"; - } finally { - delete Math.set; - } - } -runTestCase(testcase); +assert(hasProperty, 'hasProperty !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-287.js b/test/built-ins/Object/create/15.2.3.5-4-287.js index baa187b60..6057e68fb 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-287.js +++ b/test/built-ins/Object/create/15.2.3.5-4-287.js @@ -7,13 +7,10 @@ description: > Object.create - one property in 'Properties' is the JSON object that uses Object's [[Get]] method to access the 'set' property (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var data = "data"; - try { JSON.set = function (value) { data = value; }; @@ -26,9 +23,5 @@ function testcase() { newObj.prop = "overrideData"; - return hasProperty && data === "overrideData"; - } finally { - delete JSON.set; - } - } -runTestCase(testcase); +assert(hasProperty, 'hasProperty !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-291.js b/test/built-ins/Object/create/15.2.3.5-4-291.js index 4ffc2d5d3..b5d8d69e6 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-291.js +++ b/test/built-ins/Object/create/15.2.3.5-4-291.js @@ -7,15 +7,11 @@ description: > Object.create - one property in 'Properties' is the global object that uses Object's [[Get]] method to access the 'set' property (8.10.5 step 8.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var data = "data"; - try { fnGlobalObject().set = function (value) { data = value; }; @@ -28,9 +24,5 @@ function testcase() { newObj.prop = "overrideData"; - return hasProperty && data === "overrideData"; - } finally { - delete fnGlobalObject().set; - } - } -runTestCase(testcase); +assert(hasProperty, 'hasProperty !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-33.js b/test/built-ins/Object/create/15.2.3.5-4-33.js index 66d7d0feb..28684d926 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-33.js +++ b/test/built-ins/Object/create/15.2.3.5-4-33.js @@ -7,20 +7,12 @@ description: > Object.create - 'Properties' is the Math object that uses Object's [[Get]] method to access own enumerable property (15.2.3.7 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Math.prop = { value: 12, enumerable: true }; var newObj = Object.create({}, Math); - return newObj.hasOwnProperty("prop"); - } finally { - delete Math.prop; - } - } -runTestCase(testcase); + +assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-36.js b/test/built-ins/Object/create/15.2.3.5-4-36.js index 09a48c2ef..f11823460 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-36.js +++ b/test/built-ins/Object/create/15.2.3.5-4-36.js @@ -7,20 +7,12 @@ description: > Object.create - 'Properties' is the JSON object that uses Object's [[Get]] method to access own enumerable property (15.2.3.7 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { JSON.prop = { value: 12, enumerable: true }; var newObj = Object.create({}, JSON); - return newObj.hasOwnProperty("prop"); - } finally { - delete JSON.prop; - } - } -runTestCase(testcase); + +assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-64.js b/test/built-ins/Object/create/15.2.3.5-4-64.js index 084b73b37..dcb8a6f23 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-64.js +++ b/test/built-ins/Object/create/15.2.3.5-4-64.js @@ -7,14 +7,10 @@ description: > Object.create - one property in 'Properties' is the Math object that uses Object's [[Get]] method to access the 'enumerable' property (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; - try { Math.enumerable = true; var newObj = Object.create({}, { @@ -25,9 +21,5 @@ function testcase() { accessed = true; } } - return accessed; - } finally { - delete Math.enumerable; - } - } -runTestCase(testcase); + +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-67.js b/test/built-ins/Object/create/15.2.3.5-4-67.js index ba562de19..c9daddf94 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-67.js +++ b/test/built-ins/Object/create/15.2.3.5-4-67.js @@ -7,14 +7,10 @@ description: > Object.create - one property in 'Properties' is the JSON object that uses Object's [[Get]] method to access the 'enumerable' property (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; - try { JSON.enumerable = true; var newObj = Object.create({}, { @@ -25,9 +21,5 @@ function testcase() { accessed = true; } } - return accessed; - } finally { - delete JSON.enumerable; - } - } -runTestCase(testcase); + +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-71.js b/test/built-ins/Object/create/15.2.3.5-4-71.js index c95e3f3c4..9d7dc1fcc 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-71.js +++ b/test/built-ins/Object/create/15.2.3.5-4-71.js @@ -7,16 +7,11 @@ description: > Object.create - one property in 'Properties' is the global object that uses Object's [[Get]] method to access the 'enumerable' property (8.10.5 step 3.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var accessed = false; - try { fnGlobalObject().enumerable = true; var newObj = Object.create({}, { @@ -27,9 +22,5 @@ function testcase() { accessed = true; } } - return accessed; - } finally { - delete fnGlobalObject().enumerable; - } - } -runTestCase(testcase); + +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-2-11.js b/test/built-ins/Object/defineProperties/15.2.3.7-2-11.js index f80dde265..49e5f4208 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-2-11.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-2-11.js @@ -4,15 +4,11 @@ /*--- es5id: 15.2.3.7-2-11 description: Object.defineProperties - argument 'Properties' is the Math object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; var result = false; - - try { + Object.defineProperty(Math, "prop", { get: function () { result = (this === Math); @@ -23,9 +19,5 @@ function testcase() { }); Object.defineProperties(obj, Math); - return result; - } finally { - delete Math.prop; - } - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-2-14.js b/test/built-ins/Object/defineProperties/15.2.3.7-2-14.js index bb72313cf..4cb5a056a 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-2-14.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-2-14.js @@ -4,15 +4,11 @@ /*--- es5id: 15.2.3.7-2-14 description: Object.defineProperties - argument 'Properties' is the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; var result = false; - try { Object.defineProperty(JSON, "prop", { get: function () { result = (this === JSON); @@ -23,9 +19,5 @@ function testcase() { }); Object.defineProperties(obj, JSON); - return result; - } finally { - delete JSON.prop; - } - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-2-18.js b/test/built-ins/Object/defineProperties/15.2.3.7-2-18.js index afd10e3f1..54d63f93e 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-2-18.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-2-18.js @@ -6,13 +6,9 @@ es5id: 15.2.3.7-2-18 description: > Object.defineProperties - argument 'Properties' is the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var obj = {}; var result = false; @@ -27,11 +23,11 @@ function testcase() { }); Object.defineProperties(obj, fnGlobalObject()); - return result; } catch (e) { - return (e instanceof TypeError); + if (!(e instanceof TypeError)) throw e; + result = true; } finally { delete fnGlobalObject().prop; } - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-a-12.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-a-12.js index 22d61ff94..f13acf2b5 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-a-12.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-a-12.js @@ -6,22 +6,14 @@ es5id: 15.2.3.7-5-a-12 description: > Object.defineProperties - 'Properties' is the Math object which implements its own [[Get]] method to get enumerable own property -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; - try { Math.prop = { value: 12 }; Object.defineProperties(obj, Math); - return obj.hasOwnProperty("prop") && obj.prop === 12; - } finally { - delete Math.prop; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true'); +assert.sameValue(obj.prop, 12, 'obj.prop'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-a-15.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-a-15.js index 910a260ec..07dc678c4 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-a-15.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-a-15.js @@ -6,21 +6,14 @@ es5id: 15.2.3.7-5-a-15 description: > Object.defineProperties - 'Properties' is the JSON object which implements its own [[Get]] method to get enumerable own property -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { JSON.prop = { value: 15 }; Object.defineProperties(obj, JSON); - return obj.hasOwnProperty("prop") && obj.prop === 15; - } finally { - delete JSON.prop; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true'); +assert.sameValue(obj.prop, 15, 'obj.prop'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-130.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-130.js index 93b8a9561..75eb5a7de 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-130.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-130.js @@ -7,22 +7,14 @@ description: > Object.defineProperties - 'descObj' is the Math object which implements its own [[Get]] method to get 'value' property (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Math.value = "Math"; Object.defineProperties(obj, { property: Math }); - return obj.property === "Math"; - } finally { - delete Math.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "Math", 'obj.property'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-133.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-133.js index 809669eb3..75d124af0 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-133.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-133.js @@ -7,22 +7,14 @@ description: > Object.defineProperties - 'descObj' is the JSON object which implements its own [[Get]] method to get 'value' property (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { JSON.value = "JSON"; Object.defineProperties(obj, { property: JSON }); - return obj.property === "JSON"; - } finally { - delete JSON.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "JSON", 'obj.property'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-137.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-137.js index a48e632b2..00afd773f 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-137.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-137.js @@ -7,24 +7,15 @@ description: > Object.defineProperties - 'descObj' is the global object which implements its own [[Get]] method to get 'value' property (8.10.5 step 5.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var obj = {}; - try { fnGlobalObject().value = "global"; Object.defineProperties(obj, { property: fnGlobalObject() }); - return obj.property === "global"; - } finally { - delete fnGlobalObject().value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "global", 'obj.property'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-156.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-156.js index 107e823c3..c578ae4f7 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-156.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-156.js @@ -13,7 +13,6 @@ includes: [propertyHelper.js] var obj = {}; -try { Math.writable = false; Object.defineProperties(obj, { @@ -22,7 +21,3 @@ try { assert(obj.hasOwnProperty("property")); verifyNotWritable(obj, "property"); - -} finally { - delete Math.writable; -} diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-159.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-159.js index c7d08c0a2..9bd06f4ef 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-159.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-159.js @@ -12,7 +12,6 @@ includes: [propertyHelper.js] var obj = {}; -try { JSON.writable = false; Object.defineProperties(obj, { @@ -21,8 +20,3 @@ try { assert(obj.hasOwnProperty("property")); verifyNotWritable(obj, "property"); - -} finally { - delete JSON.writable; -} - diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-163.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-163.js index 9806652a9..c508455ca 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-163.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-163.js @@ -15,7 +15,6 @@ includes: var obj = {}; -try { fnGlobalObject().writable = false; Object.defineProperties(obj, { @@ -24,9 +23,3 @@ try { assert(obj.hasOwnProperty("property")); verifyNotWritable(obj, "property"); - -} finally { - delete fnGlobalObject().writable; -} - - diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-209.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-209.js index 1cd1a9b68..a4dec6de0 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-209.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-209.js @@ -7,14 +7,10 @@ description: > Object.defineProperties - 'descObj' is the Math object which implements its own [[Get]] method to get 'get' property (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; - try { Math.get = function () { return "Math"; }; @@ -23,9 +19,4 @@ function testcase() { property: Math }); - return obj.property === "Math"; - } finally { - delete Math.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "Math", 'obj.property'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-212.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-212.js index 12cb398e1..75f7d4a49 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-212.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-212.js @@ -7,14 +7,10 @@ description: > Object.defineProperties - 'descObj' is the JSON object which implements its own [[Get]] method to get 'get' property (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; - try { JSON.get = function () { return "JSON"; }; @@ -23,9 +19,4 @@ function testcase() { property: JSON }); - return obj.property === "JSON"; - } finally { - delete JSON.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "JSON", 'obj.property'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-216.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-216.js index eb919238e..c68a95226 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-216.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-216.js @@ -7,16 +7,11 @@ description: > Object.defineProperties - 'descObj' is the global object which implements its own [[Get]] method to get 'get' property (8.10.5 step 7.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var obj = {}; - try { fnGlobalObject().get = function () { return "global"; }; @@ -25,9 +20,4 @@ function testcase() { property: fnGlobalObject() }); - return obj.property === "global"; - } finally { - delete fnGlobalObject().get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "global", 'obj.property'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-24.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-24.js index fd15eac75..bab103cc6 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-24.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-24.js @@ -7,15 +7,11 @@ description: > Object.defineProperties - 'descObj' is the Math object which implements its own [[Get]] method to get 'enumerable' property (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; var accessed = false; - try { Math.enumerable = true; Object.defineProperties(obj, { @@ -26,9 +22,5 @@ function testcase() { accessed = true; } } - return accessed; - } finally { - delete Math.enumerable; - } - } -runTestCase(testcase); + +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-244.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-244.js index e002547ee..5324d0334 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-244.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-244.js @@ -7,16 +7,13 @@ description: > Object.defineProperties - 'descObj' is the Math object which implements its own [[Get]] method to get 'set' property (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var data = "data"; var setFun = function (value) { data = value; }; - try { + Math.prop = { set: setFun }; @@ -24,9 +21,6 @@ function testcase() { var obj = {}; Object.defineProperties(obj, Math); obj.prop = "mathData"; - return obj.hasOwnProperty("prop") && data === "mathData"; - } finally { - delete Math.prop; - } - } -runTestCase(testcase); + +assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true'); +assert.sameValue(data, "mathData", 'data'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-247.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-247.js index b43663fa1..c0815c7b0 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-247.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-247.js @@ -7,16 +7,13 @@ description: > Object.defineProperties - 'descObj' is the JSON object which implements its own [[Get]] method to get 'set' property (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var data = "data"; var setFun = function (value) { data = value; }; - try { + JSON.prop = { set: setFun }; @@ -24,9 +21,6 @@ function testcase() { var obj = {}; Object.defineProperties(obj, JSON); obj.prop = "JSONData"; - return obj.hasOwnProperty("prop") && data === "JSONData"; - } finally { - delete JSON.prop; - } - } -runTestCase(testcase); + +assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true'); +assert.sameValue(data, "JSONData", 'data'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-27.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-27.js index 7c99c4277..900b3b090 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-27.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-27.js @@ -7,15 +7,11 @@ description: > Object.defineProperties - 'descObj' is the JSON object which implements its own [[Get]] method to get 'enumerable' property (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; var accessed = false; - try { JSON.enumerable = true; Object.defineProperties(obj, { @@ -26,9 +22,5 @@ function testcase() { accessed = true; } } - return accessed; - } finally { - delete JSON.enumerable; - } - } -runTestCase(testcase); + +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-31.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-31.js index bead27b7f..7c1a48bc1 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-31.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-31.js @@ -7,17 +7,12 @@ description: > Object.defineProperties - 'descObj' is the global object which implements its own [[Get]] method to get 'enumerable' property (8.10.5 step 3.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var obj = {}; var accessed = false; - try { fnGlobalObject().enumerable = true; Object.defineProperties(obj, { @@ -28,9 +23,5 @@ function testcase() { accessed = true; } } - return accessed; - } finally { - delete fnGlobalObject().enumerable; - } - } -runTestCase(testcase); + +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-77.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-77.js index f3794aa35..44f498425 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-77.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-77.js @@ -7,14 +7,10 @@ description: > Object.defineProperties - 'descObj' is the Math object which implements its own [[Get]] method to get 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; - try { Math.configurable = true; Object.defineProperties(obj, { @@ -25,9 +21,5 @@ function testcase() { delete obj.prop; var result2 = obj.hasOwnProperty("prop"); - return result1 === true && result2 === false; - } finally { - delete Math.configurable; - } - } -runTestCase(testcase); +assert.sameValue(result1, true, 'result1'); +assert.sameValue(result2, false, 'result2'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-80.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-80.js index a37654d68..99ab9c525 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-80.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-80.js @@ -7,14 +7,10 @@ description: > Object.defineProperties - 'descObj' is the JSON object which implements its own [[Get]] method to get 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; - try { JSON.configurable = true; Object.defineProperties(obj, { @@ -25,9 +21,5 @@ function testcase() { delete obj.prop; var result2 = obj.hasOwnProperty("prop"); - return result1 === true && result2 === false; - } finally { - delete JSON.configurable; - } - } -runTestCase(testcase); +assert.sameValue(result1, true, 'result1'); +assert.sameValue(result2, false, 'result2'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-84.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-84.js index ceafc60be..e0babbe9d 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-84.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-84.js @@ -7,16 +7,11 @@ description: > Object.defineProperties - 'descObj' is the global object which implements its own [[Get]] method to get 'configurable' property (8.10.5 step 4.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var obj = {}; - try { fnGlobalObject().configurable = true; Object.defineProperties(obj, { @@ -27,9 +22,5 @@ function testcase() { delete obj.prop; var result2 = obj.hasOwnProperty("prop"); - return result1 === true && result2 === false; - } finally { - delete fnGlobalObject().configurable; - } - } -runTestCase(testcase); +assert.sameValue(result1, true, 'result1'); +assert.sameValue(result2, false, 'result2'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-113.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-113.js index bad68510e..e9286e341 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-113.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-113.js @@ -7,14 +7,12 @@ description: > Object.defineProperties - 'O' is an Array, test the length property of 'O' is own data property that overrides an inherited data property (15.4.5.1 step 1) -includes: [runTestCase.js] ---*/ -function testcase() { - var arrProtoLen; var arr = [0, 1, 2]; - try { + +assert.throws(TypeError, function() { arrProtoLen = Array.prototype.length; Array.prototype.length = 0; @@ -25,14 +23,10 @@ function testcase() { Object.defineProperties(arr, { length: { value: 1 } }); - return false; - } catch (e) { - var desc = Object.getOwnPropertyDescriptor(arr, "length"); +}); - return e instanceof TypeError && desc.value === 3 && - desc.writable && !desc.enumerable && !desc.configurable; - } finally { - Array.prototype.length = arrProtoLen; - } - } -runTestCase(testcase); +var desc = Object.getOwnPropertyDescriptor(arr, "length"); +assert.sameValue(desc.value, 3, 'desc.value'); +assert(desc.writable, 'desc.writable !== true'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); +assert.sameValue(desc.configurable, false, 'desc.configurable'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-167.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-167.js index b92b05178..ac2bf4417 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-167.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-167.js @@ -9,13 +9,10 @@ description: > of the length property, test the [[Configurable]] attribute of inherited data property with large index named in 'O' can't stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 1]; - try { + Array.prototype[1] = 2; //we are not allowed to set the [[Configurable]] attribute of property "1" to false here, since Array.prototype is a global object, and non-configurbale property can't revert to configurable Object.defineProperties(arr, { @@ -24,9 +21,7 @@ function testcase() { } }); - return arr.length === 1 && !arr.hasOwnProperty("1") && arr[0] === 0 && Array.prototype[1] === 2; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(arr.length, 1, 'arr.length'); +assert.sameValue(arr.hasOwnProperty("1"), false, 'arr.hasOwnProperty("1")'); +assert.sameValue(arr[0], 0, 'arr[0]'); +assert.sameValue(Array.prototype[1], 2, 'Array.prototype[1]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-168.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-168.js index 98fb79d5b..c93f4a78e 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-168.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-168.js @@ -10,13 +10,11 @@ description: > own data property with large index named in 'O' that overrides inherited data property can stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 1]; - try { + +assert.throws(TypeError, function() { Object.defineProperty(arr, "1", { configurable: false }); @@ -28,12 +26,8 @@ function testcase() { value: 1 } }); - return false; - } catch (e) { - return e instanceof TypeError && arr.length === 2 && - arr.hasOwnProperty("1") && arr[0] === 0 && arr[1] === 1; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +}); +assert.sameValue(arr.length, 2, 'arr.length'); +assert(arr.hasOwnProperty("1"), 'arr.hasOwnProperty("1") !== true'); +assert.sameValue(arr[0], 0, 'arr[0]'); +assert.sameValue(arr[1], 1, 'arr[1]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-169.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-169.js index 0f956d96d..0b72ac3d6 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-169.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-169.js @@ -10,13 +10,11 @@ description: > own data property with large index named in 'O' that overrides inherited accessor property can stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 1]; - try { + +assert.throws(TypeError, function() { Object.defineProperty(arr, "1", { configurable: false }); @@ -33,13 +31,9 @@ function testcase() { value: 1 } }); - - return false; - } catch (e) { - return e instanceof TypeError && arr.length === 2 && arr.hasOwnProperty("1") && - arr[0] === 0 && arr[1] === 1 && Array.prototype[1] === 2; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +}); +assert.sameValue(arr.length, 2, 'arr.length'); +assert(arr.hasOwnProperty("1"), 'arr.hasOwnProperty("1") !== true'); +assert.sameValue(arr[0], 0, 'arr[0]'); +assert.sameValue(arr[1], 1, 'arr[1]'); +assert.sameValue(Array.prototype[1], 2, 'Array.prototype[1]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-17.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-17.js index c50f5a999..43bc0511b 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-17.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-17.js @@ -6,12 +6,8 @@ es5id: 15.2.3.7-6-a-17 description: > Object.defineProperties - 'O' is the Math object which implements its own [[GetOwnProperty]] method to get 'P' (8.12.9 step 1 ) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.defineProperty(Math, "prop", { value: 11, writable: true, @@ -24,9 +20,6 @@ function testcase() { value: 12 } }); - return hasProperty && Math.prop === 12; - } finally { - delete Math.prop; - } - } -runTestCase(testcase); + +assert(hasProperty, 'hasProperty !== true'); +assert.sameValue(Math.prop, 12, 'Math.prop'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-171.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-171.js index f18a60dc6..ca3db2cb9 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-171.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-171.js @@ -9,13 +9,10 @@ description: > of the length property, test the [[Configurable]] attribute of inherited accessor property with large index named in 'O' can't stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 1]; - try { + Object.defineProperty(Array.prototype, "1", { get: function () { return 1; @@ -29,9 +26,7 @@ function testcase() { } }); - return arr.length === 1 && !arr.hasOwnProperty("1") && arr[0] === 0 && Array.prototype[1] === 1; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(arr.length, 1, 'arr.length'); +assert.sameValue(arr.hasOwnProperty("1"), false, 'arr.hasOwnProperty("1")'); +assert.sameValue(arr[0], 0, 'arr[0]'); +assert.sameValue(Array.prototype[1], 1, 'Array.prototype[1]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-172.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-172.js index cc9e90c15..938699559 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-172.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-172.js @@ -10,13 +10,11 @@ description: > own accessor property with large index named in 'O' that overrides inherited data property can stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 1]; - try { + +assert.throws(TypeError, function() { Object.defineProperty(arr, "1", { get: function () { return 2; @@ -31,12 +29,8 @@ function testcase() { value: 1 } }); - return false; - } catch (e) { - return e instanceof TypeError && arr.length === 2 && - arr.hasOwnProperty("1") && arr[0] === 0 && arr[1] === 2; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +}); +assert.sameValue(arr.length, 2, 'arr.length'); +assert(arr.hasOwnProperty("1"), 'arr.hasOwnProperty("1") !== true'); +assert.sameValue(arr[0], 0, 'arr[0]'); +assert.sameValue(arr[1], 2, 'arr[1]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-173.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-173.js index 84fba667a..0664450db 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-173.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-173.js @@ -10,13 +10,11 @@ description: > own accessor property with large index named in 'O' that overrides inherited accessor property can stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 1]; - try { + +assert.throws(TypeError, function() { Object.defineProperty(arr, "1", { get: function () { return 1; @@ -36,12 +34,9 @@ function testcase() { value: 1 } }); - return false; - } catch (e) { - return e instanceof TypeError && arr.length === 2 && arr.hasOwnProperty("1") && - arr[0] === 0 && arr[1] === 1 && Array.prototype[1] === 2; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +}); +assert.sameValue(arr.length, 2, 'arr.length'); +assert(arr.hasOwnProperty("1"), 'arr.hasOwnProperty("1") !== true'); +assert.sameValue(arr[0], 0, 'arr[0]'); +assert.sameValue(arr[1], 1, 'arr[1]'); +assert.sameValue(Array.prototype[1], 2, 'Array.prototype[1]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-187.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-187.js index 565775b9a..239da3b32 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-187.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-187.js @@ -6,11 +6,8 @@ es5id: 15.2.3.7-6-a-187 description: > Object.defineProperties - 'O' is an Array, 'P' is an array index named property, 'P' is inherited data property (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { value: 11, configurable: true @@ -23,9 +20,7 @@ function testcase() { configurable: false } }); - return arr.hasOwnProperty("0") && typeof arr[0] === "undefined" && Array.prototype[0] === 11; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert(arr.hasOwnProperty("0"), 'arr.hasOwnProperty("0") !== true'); +assert.sameValue(typeof arr[0], "undefined", 'typeof arr[0]'); +assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-188.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-188.js index 604d12717..a5895c270 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-188.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-188.js @@ -7,17 +7,16 @@ description: > Object.defineProperties - 'O' is an Array, 'P' is an array index named property, 'P' is own data property that overrides an inherited data property (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { - try { +var arr = []; + +assert.throws(TypeError, function() { Object.defineProperty(Array.prototype, "0", { value: 11, configurable: true }); - var arr = []; Object.defineProperty(arr, "0", { value: 12, configurable: false @@ -28,11 +27,6 @@ function testcase() { configurable: true } }); - return false; - } catch (e) { - return e instanceof TypeError && arr[0] === 12 && Array.prototype[0] === 11; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +}); +assert.sameValue(arr[0], 12, 'arr[0]'); +assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-189.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-189.js index 4828ac6a6..43dcd4991 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-189.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-189.js @@ -7,11 +7,11 @@ description: > Object.defineProperties - 'O' is an Array, 'P' is an array index named property, 'P' is own data property that overrides an inherited accessor property (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { - try { +var arr = []; + +assert.throws(TypeError, function() { Object.defineProperty(Array.prototype, "0", { get: function () { return 11; @@ -19,7 +19,6 @@ function testcase() { configurable: true }); - var arr = []; Object.defineProperty(arr, "0", { value: 12, configurable: false @@ -30,11 +29,6 @@ function testcase() { configurable: true } }); - return false; - } catch (e) { - return e instanceof TypeError && arr[0] === 12 && Array.prototype[0] === 11; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +}); +assert.sameValue(arr[0], 12, 'arr[0]'); +assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-191.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-191.js index 7a43741be..c074029e5 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-191.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-191.js @@ -6,11 +6,8 @@ es5id: 15.2.3.7-6-a-191 description: > Object.defineProperties - 'O' is an Array, 'P' is an array index property, 'P' is inherited accessor property (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 11; @@ -28,9 +25,7 @@ function testcase() { configurable: false } }); - return arr.hasOwnProperty("0") && arr[0] === 12 && Array.prototype[0] === 11; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert(arr.hasOwnProperty("0"), 'arr.hasOwnProperty("0") !== true'); +assert.sameValue(arr[0], 12, 'arr[0]'); +assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-192.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-192.js index 38fdf6243..5c064cd64 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-192.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-192.js @@ -7,17 +7,16 @@ description: > Object.defineProperties - 'O' is an Array, 'P' is an array index named property, 'P' is own accessor property that overrides an inherited data property (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { - try { +var arr = []; + +assert.throws(TypeError, function() { Object.defineProperty(Array.prototype, "0", { value: 11, configurable: true }); - var arr = []; Object.defineProperty(arr, "0", { get: function () { return 12; @@ -30,11 +29,6 @@ function testcase() { configurable: true } }); - return false; - } catch (e) { - return e instanceof TypeError && arr[0] === 12 && Array.prototype[0] === 11; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +}); +assert.sameValue(arr[0], 12, 'arr[0]'); +assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-193.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-193.js index ec9694038..1f6f92161 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-193.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-193.js @@ -7,11 +7,11 @@ description: > Object.defineProperties - 'O' is an Array, 'P' is an array index named property, 'P' is own accessor property that overrides an inherited accessor property (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { - try { +var arr = []; + +assert.throws(TypeError, function() { Object.defineProperty(Array.prototype, "0", { get: function () { return 11; @@ -19,7 +19,6 @@ function testcase() { configurable: true }); - var arr = []; Object.defineProperty(arr, "0", { get: function () { return 12; @@ -32,11 +31,6 @@ function testcase() { configurable: true } }); - return false; - } catch (e) { - return e instanceof TypeError && arr[0] === 12 && Array.prototype[0] === 11; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +}); +assert.sameValue(arr[0], 12, 'arr[0]'); +assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-20.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-20.js index 6cba1a9c3..c6256b2e2 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-20.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-20.js @@ -6,12 +6,8 @@ es5id: 15.2.3.7-6-a-20 description: > Object.defineProperties - 'O' is a JSON object which implements its own [[GetOwnProperty]] method to get 'P' (8.12.9 step 1 ) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.defineProperty(JSON, "prop", { value: 11, writable: true, @@ -23,9 +19,6 @@ function testcase() { value: 12 } }); - return hasProperty && JSON.prop === 12; - } finally { - delete JSON.prop; - } - } -runTestCase(testcase); + +assert(hasProperty, 'hasProperty !== true'); +assert.sameValue(JSON.prop, 12, 'JSON.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-139-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-139-1.js index 55e12b421..dc4bb72be 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-139-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-139-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Function object which implements its own [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Function.prototype.value = "Function"; var funObj = function (a, b) { return a + b; @@ -20,9 +18,4 @@ function testcase() { Object.defineProperty(obj, "property", funObj); - return obj.property === "Function"; - } finally { - delete Function.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "Function", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-140-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-140-1.js index 8ee35ecef..2427bce09 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-140-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-140-1.js @@ -7,20 +7,13 @@ description: > Object.defineProperty - 'Attributes' is an Array object that uses Object's [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Array.prototype.value = "Array"; var arrObj = [1, 2, 3]; Object.defineProperty(obj, "property", arrObj); - return obj.property === "Array"; - } finally { - delete Array.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "Array", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-141-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-141-1.js index 0f3044492..7168b9b07 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-141-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-141-1.js @@ -7,20 +7,13 @@ description: > Object.defineProperty - 'Attributes' is a String object that uses Object's [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + String.prototype.value = "String"; var strObj = new String("abc"); Object.defineProperty(obj, "property", strObj); - return obj.property === "String"; - } finally { - delete String.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "String", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-142-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-142-1.js index c5f7def07..b7c70877d 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-142-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-142-1.js @@ -7,20 +7,13 @@ description: > Object.defineProperty - 'Attributes' is a Boolean object that uses Object's [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Boolean.prototype.value = "Boolean"; var boolObj = new Boolean(true); Object.defineProperty(obj, "property", boolObj); - return obj.property === "Boolean"; - } finally { - delete Boolean.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "Boolean", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-143-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-143-1.js index 0e69a8849..855177b2c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-143-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-143-1.js @@ -7,20 +7,13 @@ description: > Object.defineProperty - 'Attributes' is a Number object that uses Object's [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Number.prototype.value = "Number"; var numObj = new Number(-2); Object.defineProperty(obj, "property", numObj); - return obj.property === "Number"; - } finally { - delete Number.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "Number", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-144-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-144-1.js index 96bf1f211..2d38e639f 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-144-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-144-1.js @@ -7,20 +7,12 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Object.prototype.value = "Math"; Object.defineProperty(obj, "property", Math); - return obj.property === "Math"; - } finally { - delete Object.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "Math", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-144.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-144.js index 458e7457f..5a243de1c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-144.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-144.js @@ -7,20 +7,12 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'value' property (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Math.value = "Math"; Object.defineProperty(obj, "property", Math); - return obj.property === "Math"; - } finally { - delete Math.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "Math", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-145-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-145-1.js index 7c09699cf..738ae2d0e 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-145-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-145-1.js @@ -7,20 +7,13 @@ description: > Object.defineProperty - 'Attributes' is a Date object that uses Object's [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Date.prototype.value = "Date"; var dateObj = new Date(); Object.defineProperty(obj, "property", dateObj); - return obj.property === "Date"; - } finally { - delete Date.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "Date", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-146-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-146-1.js index 4f34ea230..28fd27b9d 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-146-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-146-1.js @@ -7,20 +7,13 @@ description: > Object.defineProperty - 'Attributes' is a RegExp object that uses Object's [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + RegExp.prototype.value = "RegExp"; var regObj = new RegExp(); Object.defineProperty(obj, "property", regObj); - return obj.property === "RegExp"; - } finally { - delete RegExp.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "RegExp", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-147-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-147-1.js index e0809ac44..2a28c6b51 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-147-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-147-1.js @@ -7,20 +7,12 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Object.prototype.value = "JSON"; Object.defineProperty(obj, "property", JSON); - return obj.property === "JSON"; - } finally { - delete Object.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "JSON", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-147.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-147.js index 89985336f..5974a207b 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-147.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-147.js @@ -7,20 +7,12 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'value' property (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { JSON.value = "JSON"; Object.defineProperty(obj, "property", JSON); - return obj.property === "JSON"; - } finally { - delete JSON.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "JSON", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-148-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-148-1.js index b891ea143..516717351 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-148-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-148-1.js @@ -7,20 +7,13 @@ description: > Object.defineProperty - 'Attributes' is an Error object that uses Object's [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Error.prototype.value = "Error"; var errObj = new Error(); Object.defineProperty(obj, "property", errObj); - return obj.property === "Error"; - } finally { - delete Error.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "Error", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-149-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-149-1.js index 94bae2563..7ce7e83e2 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-149-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-149-1.js @@ -7,21 +7,14 @@ description: > Object.defineProperty - 'Attributes' is an Arguments object which implements its own [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Object.prototype.value = "arguments"; var argObj = (function () { return arguments; })(); Object.defineProperty(obj, "property", argObj); - return obj.property === "arguments"; - } finally { - delete Object.prototype.value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "arguments", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-151.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-151.js index ea7a65b54..13f2ce89d 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-151.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-151.js @@ -7,22 +7,13 @@ description: > Object.defineProperty - 'Attributes' is the global object that uses Object's [[Get]] method to access the 'value' property (8.10.5 step 5.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var obj = {}; - try { fnGlobalObject().value = "global"; Object.defineProperty(obj, "property", fnGlobalObject()); - return obj.property === "global"; - } finally { - delete fnGlobalObject().value; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "global", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-165-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-165-1.js index 9ca90dfff..2daa9523d 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-165-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-165-1.js @@ -7,13 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Function object which implements its own [[Get]] method to access the 'writable' property of prototype object (8.10.5 step 6.b) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Function.prototype.writable = true; var funObj = function (a, b) { return a + b; @@ -27,9 +24,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete Function.prototype.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-166-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-166-1.js index 6dc54828a..66bc45603 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-166-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-166-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is an Array object that uses Object's [[Get]] method to access the 'writable' property of prototype object (8.10.5 step 6.b) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Array.prototype.writable = true; var arrObj = [1, 2, 3]; @@ -24,9 +22,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete Array.prototype.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-167-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-167-1.js index 5c2aff8b2..e5227ee79 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-167-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-167-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a String object that uses Object's [[Get]] method to access the 'writable' property of prototype object (8.10.5 step 6.b) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + String.prototype.writable = true; var strObj = new String("abc"); @@ -24,9 +22,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete String.prototype.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-168-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-168-1.js index 5870b54ae..347024234 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-168-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-168-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Boolean object that uses Object's [[Get]] method to access the 'writable' property of prototype object (8.10.5 step 6.b) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Boolean.prototype.writable = true; var boolObj = new Boolean(true); @@ -24,9 +22,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete Boolean.prototype.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-169-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-169-1.js index b4a10345a..431adb9f6 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-169-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-169-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Number object that uses Object's [[Get]] method to access the 'writable' property of prototype object (8.10.5 step 6.b) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Number.prototype.writable = true; var numObj = new Number(-2); @@ -24,9 +22,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete Number.prototype.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-170-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-170-1.js index 0ac85bc90..bd586b4b1 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-170-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-170-1.js @@ -7,13 +7,10 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'writable' property of prototype object (8.10.5 step 6.b) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Object.prototype.writable = true; Object.defineProperty(obj, "property", Math); @@ -24,9 +21,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete Object.prototype.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-170.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-170.js index 38bdebca8..d0d86774f 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-170.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-170.js @@ -7,13 +7,10 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'writable' property (8.10.5 step 6.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Math.writable = true; Object.defineProperty(obj, "property", Math); @@ -24,9 +21,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete Math.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-172-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-172-1.js index 444791cf8..abcd93fc0 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-172-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-172-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a RegExp object that uses Object's [[Get]] method to access the 'writable' property of prototype object (8.10.5 step 6.b) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + RegExp.prototype.writable = true; var regObj = new RegExp(); @@ -25,9 +23,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete RegExp.prototype.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-173-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-173-1.js index 170c0bed6..78f95f7d2 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-173-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-173-1.js @@ -7,13 +7,10 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'writable' property of prototype object (8.10.5 step 6.b) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Object.prototype.writable = true; Object.defineProperty(obj, "property", JSON); @@ -24,9 +21,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete Object.prototype.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-173.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-173.js index b488a8262..cb368f7d0 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-173.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-173.js @@ -7,13 +7,10 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'writable' property (8.10.5 step 6.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { JSON.writable = true; Object.defineProperty(obj, "property", JSON); @@ -24,9 +21,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete JSON.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-174-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-174-1.js index b17e2fcbd..073df7987 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-174-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-174-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is an Error object that uses Object's [[Get]] method to access the 'writable' property of prototype object (8.10.5 step 6.b) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Error.prototype.writable = true; var errObj = new Error(); @@ -25,9 +23,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete Error.prototype.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-175-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-175-1.js index 7a75d3321..cc32ea6b4 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-175-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-175-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is an Arguments object which implements its own [[Get]] method to access the 'writable' property of prototype object (8.10.5 step 6.b) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Object.prototype.writable = true; var argObj = (function () { return arguments; })(); @@ -25,9 +23,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete Object.prototype.writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-177.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-177.js index 2452d47fc..dc5a0e6dd 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-177.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-177.js @@ -7,15 +7,11 @@ description: > Object.defineProperty - 'Attributes' is the global object that uses Object's [[Get]] method to access the 'writable' property (8.10.5 step 6.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var obj = {}; - try { fnGlobalObject().writable = true; Object.defineProperty(obj, "property", fnGlobalObject()); @@ -26,9 +22,5 @@ function testcase() { var afterWrite = (obj.property === "isWritable"); - return beforeWrite === true && afterWrite === true; - } finally { - delete fnGlobalObject().writable; - } - } -runTestCase(testcase); +assert.sameValue(beforeWrite, true, 'beforeWrite'); +assert.sameValue(afterWrite, true, 'afterWrite'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-218-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-218-1.js index 7fd8a49ab..af3ba07d2 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-218-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-218-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Function object which implements its own [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Function.prototype.get = function () { return "functionGetProperty"; }; @@ -20,9 +18,4 @@ function testcase() { Object.defineProperty(obj, "property", funObj); - return obj.property === "functionGetProperty"; - } finally { - delete Function.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "functionGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-219-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-219-1.js index 33c27f263..777e4b1e1 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-219-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-219-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is an Array object that uses Object's [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Array.prototype.get = function () { return "arrayGetProperty"; }; @@ -20,9 +18,4 @@ function testcase() { Object.defineProperty(obj, "property", arrObj); - return obj.property === "arrayGetProperty"; - } finally { - delete Array.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "arrayGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-220-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-220-1.js index af410bfe6..12816889e 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-220-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-220-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a String object that uses Object's [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + String.prototype.get = function () { return "stringGetProperty"; }; @@ -20,9 +18,4 @@ function testcase() { Object.defineProperty(obj, "property", strObj); - return obj.property === "stringGetProperty"; - } finally { - delete String.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "stringGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-221-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-221-1.js index 0d1f65127..5984602a4 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-221-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-221-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Boolean object that uses Object's [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Boolean.prototype.get = function () { return "booleanGetProperty"; }; @@ -20,9 +18,4 @@ function testcase() { Object.defineProperty(obj, "property", boolObj); - return obj.property === "booleanGetProperty"; - } finally { - delete Boolean.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "booleanGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-222-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-222-1.js index 73dd3b73f..2782d5443 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-222-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-222-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Number object that uses Object's [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Number.prototype.get = function () { return "numberGetProperty"; }; @@ -20,9 +18,4 @@ function testcase() { Object.defineProperty(obj, "property", numObj); - return obj.property === "numberGetProperty"; - } finally { - delete Number.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "numberGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-223-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-223-1.js index 4b2dc0f76..cb7c01393 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-223-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-223-1.js @@ -7,22 +7,14 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Object.prototype.get = function () { return "mathGetProperty"; }; Object.defineProperty(obj, "property", Math); - return obj.property === "mathGetProperty"; - } finally { - delete Object.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "mathGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-223.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-223.js index 2db97c35f..165f297a7 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-223.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-223.js @@ -7,22 +7,14 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'get' property (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Math.get = function () { return "mathGetProperty"; }; Object.defineProperty(obj, "property", Math); - return obj.property === "mathGetProperty"; - } finally { - delete Math.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "mathGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-224-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-224-1.js index cdf29528e..4e2957df9 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-224-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-224-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Date object that uses Object's [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Date.prototype.get = function () { return "dateGetProperty"; }; @@ -20,9 +18,4 @@ function testcase() { Object.defineProperty(obj, "property", dateObj); - return obj.property === "dateGetProperty"; - } finally { - delete Date.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "dateGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-225-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-225-1.js index c8caf8bec..cac536761 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-225-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-225-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a RegExp object that uses Object's [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + RegExp.prototype.get = function () { return "regExpGetProperty"; }; @@ -21,9 +19,4 @@ function testcase() { Object.defineProperty(obj, "property", regObj); - return obj.property === "regExpGetProperty"; - } finally { - delete RegExp.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "regExpGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-226-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-226-1.js index 910c8d443..63ccc8a3a 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-226-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-226-1.js @@ -7,22 +7,14 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Object.prototype.get = function () { return "jsonGetProperty"; }; Object.defineProperty(obj, "property", JSON); - return obj.property === "jsonGetProperty"; - } finally { - delete Object.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "jsonGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-226.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-226.js index 982a66756..404626ea1 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-226.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-226.js @@ -7,22 +7,14 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'get' property (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { JSON.get = function () { return "jsonGetProperty"; }; Object.defineProperty(obj, "property", JSON); - return obj.property === "jsonGetProperty"; - } finally { - delete JSON.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "jsonGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-227-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-227-1.js index a512eb5b2..3b694afa2 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-227-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-227-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is an Error object that uses Object's [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Error.prototype.get = function () { return "errorGetProperty"; }; @@ -20,9 +18,4 @@ function testcase() { Object.defineProperty(obj, "property", errObj); - return obj.property === "errorGetProperty"; - } finally { - delete Error.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "errorGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-228-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-228-1.js index 602bd59f2..89b7ba7df 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-228-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-228-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is an Arguments object which implements its own [[Get]] method to access the 'get' property of prototype object (8.10.5 step 7.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Object.prototype.get = function () { return "argumentGetProperty"; }; @@ -20,9 +18,4 @@ function testcase() { Object.defineProperty(obj, "property", argObj); - return obj.property === "argumentGetProperty"; - } finally { - delete Object.prototype.get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "argumentGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-230.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-230.js index e5e6e3a49..a7dbfae0a 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-230.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-230.js @@ -7,24 +7,15 @@ description: > Object.defineProperty - 'Attributes' is the global object that uses Object's [[Get]] method to access the 'get' property (8.10.5 step 7.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var obj = {}; - try { fnGlobalObject().get = function () { return "globalGetProperty"; }; Object.defineProperty(obj, "property", fnGlobalObject()); - return obj.property === "globalGetProperty"; - } finally { - delete fnGlobalObject().get; - } - } -runTestCase(testcase); +assert.sameValue(obj.property, "globalGetProperty", 'obj.property'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-248-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-248-1.js index d346c55d7..4ff3487ad 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-248-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-248-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is a Function object which implements its own [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { + Function.prototype.set = function (value) { data = value; }; @@ -22,9 +20,5 @@ function testcase() { Object.defineProperty(obj, "property", funObj); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete Function.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-249-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-249-1.js index 6c1c71c29..12f19e894 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-249-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-249-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is an Array object that uses Object's [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { + Array.prototype.set = function (value) { data = value; }; @@ -22,9 +20,5 @@ function testcase() { Object.defineProperty(obj, "property", arrObj); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete Array.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-250-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-250-1.js index c61187c53..10055b5c8 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-250-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-250-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a String object that uses Object's [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + String.prototype.set = function (value) { data = value; }; @@ -22,9 +20,5 @@ function testcase() { Object.defineProperty(obj, "property", strObj); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete String.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-251-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-251-1.js index c28602cd3..6ea5a518d 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-251-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-251-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is a Boolean object that uses Object's [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { + Boolean.prototype.set = function (value) { data = value; }; @@ -22,9 +20,5 @@ function testcase() { Object.defineProperty(obj, "property", boolObj); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete Boolean.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-252-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-252-1.js index 1961cbddc..749f8bc33 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-252-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-252-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is a Number object that uses Object's [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { + Number.prototype.set = function (value) { data = value; }; @@ -22,9 +20,5 @@ function testcase() { Object.defineProperty(obj, "property", numObj); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete Number.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-253-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-253-1.js index acf887909..96622fe50 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-253-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-253-1.js @@ -7,14 +7,11 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { Object.prototype.set = function (value) { data = value; }; @@ -22,9 +19,5 @@ function testcase() { Object.defineProperty(obj, "property", Math); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete Object.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-253.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-253.js index d9e66b08f..322dfe1f0 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-253.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-253.js @@ -7,14 +7,11 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'set' property (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { Math.set = function (value) { data = value; }; @@ -22,9 +19,5 @@ function testcase() { Object.defineProperty(obj, "property", Math); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete Math.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-254-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-254-1.js index 33b696c2a..9b3a47fe4 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-254-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-254-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is a Date object that uses Object's [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { + Date.prototype.set = function (value) { data = value; }; @@ -22,9 +20,5 @@ function testcase() { Object.defineProperty(obj, "property", dateObj); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete Date.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-255-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-255-1.js index 7d9ae4742..15c2b421e 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-255-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-255-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is a RegExp object that uses Object's [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { + RegExp.prototype.set = function (value) { data = value; }; @@ -22,9 +20,5 @@ function testcase() { Object.defineProperty(obj, "property", regObj); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete RegExp.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-256-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-256-1.js index 1512bc1f7..86747c4b8 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-256-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-256-1.js @@ -7,14 +7,11 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { Object.prototype.set = function (value) { data = value; }; @@ -22,9 +19,5 @@ function testcase() { Object.defineProperty(obj, "property", JSON); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete Object.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-256.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-256.js index da7043199..67353422e 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-256.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-256.js @@ -7,14 +7,11 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'set' property (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { JSON.set = function (value) { data = value; }; @@ -22,9 +19,5 @@ function testcase() { Object.defineProperty(obj, "property", JSON); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete JSON.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-257-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-257-1.js index 037898c4c..a0fe03339 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-257-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-257-1.js @@ -7,14 +7,11 @@ description: > Object.defineProperty - 'Attributes' is an Error object that uses Object's [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { Error.prototype.set = function (value) { data = value; }; @@ -23,9 +20,5 @@ function testcase() { Object.defineProperty(obj, "property", errObj); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete Error.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-258-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-258-1.js index 0d2215471..0b250f10f 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-258-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-258-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is an Arguments object which implements its own [[Get]] method to access the 'set' property of prototype object (8.10.5 step 8.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { + Object.prototype.set = function (value) { data = value; }; @@ -22,9 +20,5 @@ function testcase() { Object.defineProperty(obj, "property", argObj); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete Object.prototype.set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-260.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-260.js index 24c3df67f..ce66181c2 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-260.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-260.js @@ -7,16 +7,12 @@ description: > Object.defineProperty - 'Attributes' is the global object that uses Object's [[Get]] method to access the 'set' property (8.10.5 step 8.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var obj = {}; var data = "data"; - try { fnGlobalObject().set = function (value) { data = value; }; @@ -24,9 +20,5 @@ function testcase() { Object.defineProperty(obj, "property", fnGlobalObject()); obj.property = "overrideData"; - return obj.hasOwnProperty("property") && data === "overrideData"; - } finally { - delete fnGlobalObject().set; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(data, "overrideData", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-33-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-33-1.js index 74181ef23..17f152928 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-33-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-33-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is a Function object which implements its own [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { + Function.prototype.enumerable = true; var fun = function () { }; @@ -25,9 +23,4 @@ function testcase() { } } - return accessed; - } finally { - delete Function.prototype.enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-34-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-34-1.js index b41c1fbb6..6a54cf172 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-34-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-34-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is an Array object that uses Object's [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { + Array.prototype.enumerable = true; var arrObj = []; @@ -25,9 +23,4 @@ function testcase() { } } - return accessed; - } finally { - delete Array.prototype.enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-35-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-35-1.js index 867bc4412..908e603b1 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-35-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-35-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is a String object that uses Object's [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { + String.prototype.enumerable = true; var strObj = new String(); @@ -25,9 +23,4 @@ function testcase() { } } - return accessed; - } finally { - delete String.prototype.enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-36-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-36-1.js index f62fc229e..a385748a7 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-36-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-36-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is a Boolean object that uses Object's [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { + Boolean.prototype.enumerable = true; var boolObj = new Boolean(true); @@ -25,9 +23,4 @@ function testcase() { } } - return accessed; - } finally { - delete Boolean.prototype.enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-37-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-37-1.js index 8452d007f..d9e83be1f 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-37-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-37-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is a Number object that uses Object's [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { + Number.prototype.enumerable = true; var numObj = new Number(-2); @@ -25,9 +23,4 @@ function testcase() { } } - return accessed; - } finally { - delete Number.prototype.enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-38-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-38-1.js index eddd64c11..c49dc19dc 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-38-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-38-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { + Object.prototype.enumerable = true; Object.defineProperty(obj, "property", Math); @@ -23,9 +21,5 @@ function testcase() { accessed = true; } } - return accessed; - } finally { - delete Object.prototype.enumerable; - } - } -runTestCase(testcase); + +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-38.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-38.js index 65bad194f..ea7b3809f 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-38.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-38.js @@ -7,14 +7,11 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'enumerable' property (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { Math.enumerable = true; Object.defineProperty(obj, "property", Math); @@ -24,9 +21,5 @@ function testcase() { accessed = true; } } - return accessed; - } finally { - delete Math.enumerable; - } - } -runTestCase(testcase); + +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-39-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-39-1.js index ac30e2ab2..54bc49d18 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-39-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-39-1.js @@ -7,14 +7,11 @@ description: > Object.defineProperty - 'Attributes' is a Date object that uses Object's [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { Date.prototype.enumerable = true; var dateObj = new Date(); @@ -25,9 +22,5 @@ function testcase() { accessed = true; } } - return accessed; - } finally { - delete Date.prototype.enumerable; - } - } -runTestCase(testcase); + +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-40-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-40-1.js index 697f697f0..6f2548ffd 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-40-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-40-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is an RegExp object that uses Object's [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { + RegExp.prototype.enumerable = true; var regObj = new RegExp(); @@ -25,9 +23,4 @@ function testcase() { } } - return accessed; - } finally { - delete RegExp.prototype.enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-41-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-41-1.js index c871601d6..c53c41840 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-41-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-41-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { + Object.prototype.enumerable = true; Object.defineProperty(obj, "property", JSON); @@ -24,9 +22,4 @@ function testcase() { } } - return accessed; - } finally { - delete Object.prototype.enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-41.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-41.js index 381fb50bd..6475a5ceb 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-41.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-41.js @@ -7,14 +7,11 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'enumerable' property (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { JSON.enumerable = true; Object.defineProperty(obj, "property", JSON); @@ -25,9 +22,4 @@ function testcase() { } } - return accessed; - } finally { - delete JSON.enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-42-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-42-1.js index 4ce09b5e3..41e13499f 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-42-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-42-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is an Error object that uses Object's [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { + Error.prototype.enumerable = true; var errObj = new Error(); @@ -25,9 +23,4 @@ function testcase() { } } - return accessed; - } finally { - delete Error.prototype.enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-43-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-43-1.js index 7e0325f17..7a799db39 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-43-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-43-1.js @@ -7,13 +7,11 @@ description: > Object.defineProperty - 'Attributes' is an Arguments object which implements its own [[Get]] method to access the 'enumerable' property of prototype object (8.10.5 step 3.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { + Object.prototype.enumerable = true; var argObj = (function () { return arguments; })(); @@ -25,9 +23,4 @@ function testcase() { } } - return accessed; - } finally { - delete Object.prototype.enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-45.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-45.js index ed034969f..114fcde60 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-45.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-45.js @@ -7,16 +7,12 @@ description: > Object.defineProperty - 'Attributes' is the global object that uses Object's [[Get]] method to access the 'enumerable' property (8.10.5 step 3.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var obj = {}; var accessed = false; - try { fnGlobalObject().enumerable = true; Object.defineProperty(obj, "property", fnGlobalObject()); @@ -27,9 +23,4 @@ function testcase() { } } - return accessed; - } finally { - delete fnGlobalObject().enumerable; - } - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-86-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-86-1.js index 894f753f5..016698c0e 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-86-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-86-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Function object which implements its own [[Get]] method to access the 'configurable' property of prototype object (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Function.prototype.configurable = true; var funObj = function (a, b) { return a + b; @@ -26,9 +24,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete Function.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-87-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-87-1.js index 2b22af147..b28cb6881 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-87-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-87-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is an Array object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Array.prototype.configurable = true; var arrObj = [1, 2, 3]; @@ -24,9 +22,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete Array.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-88-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-88-1.js index 374e43db0..c0708bbe1 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-88-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-88-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a String object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + String.prototype.configurable = true; var strObj = new String("abc"); @@ -24,9 +22,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete String.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-89-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-89-1.js index d5b1212f6..2ee6e1792 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-89-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-89-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Boolean object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Boolean.prototype.configurable = true; var boolObj = new Boolean(true); @@ -24,9 +22,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete Boolean.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-90-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-90-1.js index 4d9174d19..d867abbc6 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-90-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-90-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Number object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Number.prototype.configurable = true; var numObj = new Number(-2); @@ -24,9 +22,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete Number.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-91-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-91-1.js index 29f44fddc..2191b771e 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-91-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-91-1.js @@ -7,13 +7,10 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Object.prototype.configurable = true; Object.defineProperty(obj, "property", Math); @@ -24,9 +21,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete Object.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-91.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-91.js index 9eb1e64dd..e87007a5a 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-91.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-91.js @@ -7,13 +7,10 @@ description: > Object.defineProperty - 'Attributes' is the Math object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Math.configurable = true; Object.defineProperty(obj, "property", Math); @@ -24,9 +21,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete Math.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-92-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-92-1.js index 4a25c26e6..8665effb5 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-92-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-92-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is a Date object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Date.prototype.configurable = true; var dateObj = new Date(); @@ -24,9 +22,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete Date.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-93-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-93-1.js index aed55e537..b34879406 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-93-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-93-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is an RegExp object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + RegExp.prototype.configurable = true; var regObj = new RegExp(); @@ -24,9 +22,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete RegExp.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-94-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-94-1.js index e382a33f6..293602b42 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-94-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-94-1.js @@ -7,13 +7,10 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Object.prototype.configurable = true; Object.defineProperty(obj, "property", JSON); @@ -24,9 +21,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete Object.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-94.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-94.js index ef9206b3d..f7cd3d9aa 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-94.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-94.js @@ -7,13 +7,10 @@ description: > Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { JSON.configurable = true; Object.defineProperty(obj, "property", JSON); @@ -24,9 +21,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete JSON.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-95-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-95-1.js index 8947f2118..28d5de387 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-95-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-95-1.js @@ -7,12 +7,10 @@ description: > Object.defineProperty - 'Attributes' is an Error object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { + Error.prototype.configurable = true; var errObj = new Error(); @@ -24,9 +22,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete Error.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-96-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-96-1.js index 743adb650..53a448dd0 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-96-1.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-96-1.js @@ -7,13 +7,10 @@ description: > Object.defineProperty - 'Attributes' is an Arguments object which implements its own [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; - try { Object.prototype.configurable = true; var argObj = (function () { return arguments; })(); @@ -25,9 +22,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete Object.prototype.configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-3-98.js b/test/built-ins/Object/defineProperty/15.2.3.6-3-98.js index 79c8a99e0..1bc8fe297 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-3-98.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-3-98.js @@ -7,15 +7,11 @@ description: > Object.defineProperty - 'Attributes' is the global object that uses Object's [[Get]] method to access the 'configurable' property (8.10.5 step 4.a) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var obj = {}; - try { fnGlobalObject().configurable = true; Object.defineProperty(obj, "property", fnGlobalObject()); @@ -26,9 +22,5 @@ function testcase() { var afterDeleted = obj.hasOwnProperty("property"); - return beforeDeleted === true && afterDeleted === false; - } finally { - delete fnGlobalObject().configurable; - } - } -runTestCase(testcase); +assert.sameValue(beforeDeleted, true, 'beforeDeleted'); +assert.sameValue(afterDeleted, false, 'afterDeleted'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-117.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-117.js index f80cb5718..2fd599c0b 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-117.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-117.js @@ -7,14 +7,12 @@ description: > Object.defineProperty - 'O' is an Array, test the length property of 'O' is own data property that overrides an inherited data property (15.4.5.1 step 1) -includes: [runTestCase.js] ---*/ -function testcase() { var arrObj = [0, 1, 2]; var arrProtoLen; - try { +assert.throws(TypeError, function() { arrProtoLen = Array.prototype.length; Array.prototype.length = 0; @@ -26,11 +24,6 @@ function testcase() { Object.defineProperty(arrObj, "length", { value: 1 }); - return false; - } catch (e) { - return e instanceof TypeError && arrObj.length === 3 && Array.prototype.length === 0; - } finally { - Array.prototype.length = arrProtoLen; - } - } -runTestCase(testcase); +}); +assert.sameValue(arrObj.length, 3, 'arrObj.length'); +assert.sameValue(Array.prototype.length, 0, 'Array.prototype.length'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-171.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-171.js index b3c686930..29cef1594 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-171.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-171.js @@ -9,20 +9,14 @@ description: > of the length property, test the [[Configurable]] attribute of an inherited data property with large index named in 'O' can't stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arrObj = [0, 1]; - try { + Array.prototype[1] = 2; // Not setting the [[Configurable]] attribute of property "1" to false here, since Array.prototype is a global object, and non-configurbale property can't revert to configurable Object.defineProperty(arrObj, "length", { value: 1 }); - return arrObj.length === 1 && !arrObj.hasOwnProperty("1"); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(arrObj.length, 1, 'arrObj.length'); +assert.sameValue(arrObj.hasOwnProperty("1"), false, 'arrObj.hasOwnProperty("1")'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-172.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-172.js index 94ee183d5..11e3ff7ff 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-172.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-172.js @@ -10,13 +10,11 @@ description: > own data property with large index named in 'O' that overrides an inherited data property can stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arrObj = [0, 1]; - try { + +assert.throws(TypeError, function() { Object.defineProperty(arrObj, "1", { configurable: false }); @@ -25,11 +23,6 @@ function testcase() { Object.defineProperty(arrObj, "length", { value: 1 }); - return false; - } catch (e) { - return e instanceof TypeError && arrObj.length === 2 && arrObj.hasOwnProperty("1"); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +}); +assert.sameValue(arrObj.length, 2, 'arrObj.length'); +assert(arrObj.hasOwnProperty("1"), 'arrObj.hasOwnProperty("1") !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-173.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-173.js index ed42fe598..27a85d434 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-173.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-173.js @@ -10,13 +10,11 @@ description: > own data property with large index named in 'O' that overrides an inherited accessor property can stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arrObj = [0, 1]; - try { + +assert.throws(TypeError, function() { Object.defineProperty(arrObj, "1", { configurable: false }); @@ -31,12 +29,6 @@ function testcase() { Object.defineProperty(arrObj, "length", { value: 1 }); - - return false; - } catch (e) { - return e instanceof TypeError && arrObj.length === 2 && arrObj.hasOwnProperty("1"); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +}); +assert.sameValue(arrObj.length, 2, 'arrObj.length'); +assert(arrObj.hasOwnProperty("1"), 'arrObj.hasOwnProperty("1") !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-175.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-175.js index 79b35f0d3..4e7d05ceb 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-175.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-175.js @@ -9,13 +9,10 @@ description: > of the length property, test the [[Configurable]] attribute of an inherited accessor property with large index named in 'O' can't stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arrObj = [0, 1]; - try { + Object.defineProperty(Array.prototype, "1", { get: function () { return 1; @@ -27,9 +24,5 @@ function testcase() { value: 1 }); - return arrObj.length === 1 && !arrObj.hasOwnProperty("1"); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(arrObj.length, 1, 'arrObj.length'); +assert.sameValue(arrObj.hasOwnProperty("1"), false, 'arrObj.hasOwnProperty("1")'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-176.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-176.js index 17dd6a3e4..4d1d9ac03 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-176.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-176.js @@ -10,13 +10,11 @@ description: > own accessor property with large index named in 'O' that overrides an inherited data property can stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arrObj = [0, 1]; - try { + +assert.throws(TypeError, function() { Object.defineProperty(arrObj, "1", { get: function () { return 2; @@ -28,11 +26,6 @@ function testcase() { Object.defineProperty(arrObj, "length", { value: 1 }); - return false; - } catch (e) { - return e instanceof TypeError && arrObj.length === 2 && arrObj.hasOwnProperty("1"); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +}); +assert.sameValue(arrObj.length, 2, 'arrObj.length'); +assert(arrObj.hasOwnProperty("1"), 'arrObj.hasOwnProperty("1") !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-177.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-177.js index f3cef92f5..f9c666b27 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-177.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-177.js @@ -10,13 +10,11 @@ description: > own accessor property with large index named in 'O' that overrides an inherited accessor property can stop deleting index named properties (15.4.5.1 step 3.l.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - var arrObj = [0, 1]; - try { + +assert.throws(TypeError, function() { Object.defineProperty(arrObj, "1", { get: function () { return 1; @@ -34,11 +32,6 @@ function testcase() { Object.defineProperty(arrObj, "length", { value: 1 }); - return false; - } catch (e) { - return e instanceof TypeError && arrObj.length === 2 && arrObj.hasOwnProperty("1"); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +}); +assert.sameValue(arrObj.length, 2, 'arrObj.length'); +assert(arrObj.hasOwnProperty("1"), 'arrObj.hasOwnProperty("1") !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-192.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-192.js index c99967e9f..5e28dc2d3 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-192.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-192.js @@ -8,17 +8,16 @@ description: > named property, 'name' is own data property that overrides an inherited data property, test TypeError is thrown on updating the [[Configurable]] attribute from false to true (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { - try { +var arrObj = []; + +assert.throws(TypeError, function() { Object.defineProperty(Array.prototype, "0", { value: 11, configurable: true }); - var arrObj = []; Object.defineProperty(arrObj, "0", { value: 12, configurable: false @@ -27,11 +26,6 @@ function testcase() { Object.defineProperty(arrObj, "0", { configurable: true }); - return false; - } catch (e) { - return e instanceof TypeError && Array.prototype[0] === 11 && arrObj[0] === 12; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +}); +assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]'); +assert.sameValue(arrObj[0], 12, 'arrObj[0]'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-193.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-193.js index c7ea6830d..03c38b4db 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-193.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-193.js @@ -10,11 +10,11 @@ description: > the [[Configurable]] attribute to true and value of [[Configurable]] attribute of original is false (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { - try { +var arrObj = []; + +assert.throws(TypeError, function() { Object.defineProperty(Array.prototype, "0", { get: function () { return 11; @@ -22,7 +22,6 @@ function testcase() { configurable: true }); - var arrObj = []; Object.defineProperty(arrObj, "0", { value: 12, configurable: false @@ -31,11 +30,6 @@ function testcase() { Object.defineProperty(arrObj, "0", { configurable: true }); - return false; - } catch (e) { - return e instanceof TypeError && Array.prototype[0] === 11 && arrObj[0] === 12; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +}); +assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]'); +assert.sameValue(arrObj[0], 12, 'arrObj[0]'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-196.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-196.js index f6ee1a4cc..7ddb2e1dd 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-196.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-196.js @@ -7,11 +7,10 @@ description: > Object.defineProperty - 'O' is an Array, 'name' is an array index named property, 'name' is own accessor property that overrides an inherited data property (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { - try { + +assert.throws(TypeError, function() { Object.defineProperty(Array.prototype, "0", { value: 11, configurable: true @@ -26,11 +25,4 @@ function testcase() { Object.defineProperty(arrObj, "0", { configurable: true }); - return false; - } catch (e) { - return e instanceof TypeError; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-197.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-197.js index 0dfdf81c9..4fc4f1e83 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-197.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-197.js @@ -7,11 +7,10 @@ description: > Object.defineProperty - 'O' is an Array, 'name' is an array index named property, 'name' is own accessor property that overrides an inherited accessor property (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { - try { + +assert.throws(TypeError, function() { Object.defineProperty(Array.prototype, "0", { get: function () { }, configurable: true @@ -26,11 +25,4 @@ function testcase() { Object.defineProperty(arrObj, "0", { configurable: true }); - return false; - } catch (e) { - return e instanceof TypeError; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-354-8.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-354-8.js index fd80a39e1..af11b7433 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-354-8.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-354-8.js @@ -13,7 +13,7 @@ includes: ---*/ var obj = fnGlobalObject(); -try { + Object.defineProperty(obj, "prop", { value: 2010, writable: false, @@ -24,7 +24,3 @@ try { assert.sameValue(obj.prop, 2010); verifyNotWritable(obj, "prop"); assert.sameValue(obj.prop, 2010); -} finally { - delete obj.prop; -} - diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-360-3.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-360-3.js index 1aa14ab70..b1cdb7890 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-360-3.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-360-3.js @@ -14,7 +14,7 @@ includes: ---*/ var obj = fnGlobalObject(); -try { + Object.defineProperty(obj, "prop", { value: 2010, writable: false, @@ -38,6 +38,3 @@ try { assert.sameValue(obj.prop, 20); assert.sameValue(typeof desc2.set, "undefined"); assert.sameValue(desc2.get, getFunc); -} finally { - delete obj.prop; -} diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-402.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-402.js index 976842919..1ef35f2bc 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-402.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-402.js @@ -6,11 +6,8 @@ es5id: 15.2.3.6-4-402 description: > ES5 Attributes - [[Value]] attribute of inherited property of [[Prototype]] internal property is correct (String instance) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(String.prototype, "prop", { value: 1001, writable: true, @@ -19,9 +16,5 @@ function testcase() { }); var strObj = new String(); - return !strObj.hasOwnProperty("prop") && strObj.prop === 1001; - } finally { - delete String.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(strObj.hasOwnProperty("prop"), false, 'strObj.hasOwnProperty("prop")'); +assert.sameValue(strObj.prop, 1001, 'strObj.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-403.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-403.js index c19ec0616..989f5d5e9 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-403.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-403.js @@ -7,11 +7,8 @@ description: > ES5 Attributes - Successfully add a property to an object when the object's prototype has a property with same name and [[Writable]] attribute is set to true (Array instance) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "prop", { value: 1001, writable: true, @@ -21,9 +18,5 @@ function testcase() { var arrObj = []; arrObj.prop = 1002; - return arrObj.hasOwnProperty("prop") && arrObj.prop === 1002; - } finally { - delete Array.prototype.prop; - } - } -runTestCase(testcase); +assert(arrObj.hasOwnProperty("prop"), 'arrObj.hasOwnProperty("prop") !== true'); +assert.sameValue(arrObj.prop, 1002, 'arrObj.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-404.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-404.js index c65cd138d..5cd579892 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-404.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-404.js @@ -6,11 +6,8 @@ es5id: 15.2.3.6-4-404 description: > ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to true is enumerable (Boolean instance) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Boolean.prototype, "prop", { value: 1001, writable: true, @@ -26,9 +23,5 @@ function testcase() { } } - return !boolObj.hasOwnProperty("prop") && verifyEnumerable; - } finally { - delete Boolean.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(boolObj.hasOwnProperty("prop"), false, 'boolObj.hasOwnProperty("prop")'); +assert(verifyEnumerable, 'verifyEnumerable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-405.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-405.js index 7ff234090..3f7a50438 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-405.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-405.js @@ -10,7 +10,6 @@ description: > includes: [propertyHelper.js] ---*/ -try { Object.defineProperty(Number.prototype, "prop", { value: 1001, writable: false, @@ -22,7 +21,3 @@ try { assert(!numObj.hasOwnProperty("prop")); verifyNotWritable(numObj, "prop", "noCheckOwnProp"); -} finally { - delete Number.prototype.prop; -} - diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-406.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-406.js index cd6ece4e6..25ede11d5 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-406.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-406.js @@ -6,11 +6,8 @@ es5id: 15.2.3.6-4-406 description: > ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to false is non-enumerable (Function instance) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Function.prototype, "prop", { value: 1001, writable: false, @@ -26,9 +23,5 @@ function testcase() { } } - return !funObj.hasOwnProperty("prop") && !verifyEnumerable; - } finally { - delete Function.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(funObj.hasOwnProperty("prop"), false, 'funObj.hasOwnProperty("prop")'); +assert.sameValue(verifyEnumerable, false, 'verifyEnumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-407.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-407.js index 4e4f2555b..eeabd495e 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-407.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-407.js @@ -6,11 +6,8 @@ es5id: 15.2.3.6-4-407 description: > ES5 Attributes - [[Value]] attribute of inherited property of [[Prototype]] internal property is correct (Error Instance) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Error.prototype, "prop", { value: 1001, writable: true, @@ -19,9 +16,5 @@ function testcase() { }); var errObj = new Error(); - return !errObj.hasOwnProperty("prop") && errObj.prop === 1001; - } finally { - delete Error.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(errObj.hasOwnProperty("prop"), false, 'errObj.hasOwnProperty("prop")'); +assert.sameValue(errObj.prop, 1001, 'errObj.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-408.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-408.js index f25895f32..c1223a55c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-408.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-408.js @@ -7,11 +7,8 @@ description: > ES5 Attributes - Successfully add a property to an object when the object's prototype has a property with same name and [[Writable]] attribute is set to true (Date instance) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Date.prototype, "prop", { value: 1001, writable: true, @@ -21,9 +18,5 @@ function testcase() { var dateObj = new Date(); dateObj.prop = 1002; - return dateObj.hasOwnProperty("prop") && dateObj.prop === 1002; - } finally { - delete Date.prototype.prop; - } - } -runTestCase(testcase); +assert(dateObj.hasOwnProperty("prop"), 'dateObj.hasOwnProperty("prop") !== true'); +assert.sameValue(dateObj.prop, 1002, 'dateObj.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-409.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-409.js index 2b48ac1e0..8dd96da0b 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-409.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-409.js @@ -6,11 +6,8 @@ es5id: 15.2.3.6-4-409 description: > ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to false is enumerable (RegExp instance) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(RegExp.prototype, "prop", { value: 1001, writable: true, @@ -26,9 +23,5 @@ function testcase() { } } - return !regObj.hasOwnProperty("prop") && verifyEnumerable; - } finally { - delete RegExp.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(regObj.hasOwnProperty("prop"), false, 'regObj.hasOwnProperty("prop")'); +assert(verifyEnumerable, 'verifyEnumerable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-410.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-410.js index be87243a7..7c7a84256 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-410.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-410.js @@ -10,7 +10,6 @@ description: > includes: [propertyHelper.js] ---*/ -try { Object.defineProperty(Object.prototype, "prop", { value: 1001, writable: false, @@ -21,8 +20,3 @@ try { assert(!JSON.hasOwnProperty("prop")); verifyNotWritable(JSON, "prop", "noCheckOwnProp"); assert.sameValue(JSON.prop, 1001); - -} finally { - delete Object.prototype.prop; -} - diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-411.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-411.js index c22e5c0f3..b8d82ce40 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-411.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-411.js @@ -6,11 +6,8 @@ es5id: 15.2.3.6-4-411 description: > ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to false is non-enumerable (Math) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Object.prototype, "prop", { value: 1001, writable: false, @@ -25,9 +22,5 @@ function testcase() { } } - return !Math.hasOwnProperty("prop") && !verifyEnumerable; - } finally { - delete Object.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(Math.hasOwnProperty("prop"), false, 'Math.hasOwnProperty("prop")'); +assert.sameValue(verifyEnumerable, false, 'verifyEnumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-417.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-417.js index 15fc5c5a5..6df596d40 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-417.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-417.js @@ -6,12 +6,10 @@ es5id: 15.2.3.6-4-417 description: > ES5 Attributes - [[Value]] attribute of inherited property of [[Prototype]] internal property is correct(Function.prototype.bind) -includes: [runTestCase.js] ---*/ -function testcase() { var foo = function () { }; - try { + Object.defineProperty(Function.prototype, "prop", { value: 1001, writable: true, @@ -21,9 +19,5 @@ function testcase() { var obj = foo.bind({}); - return !obj.hasOwnProperty("prop") && obj.prop === 1001; - } finally { - delete Function.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(obj.hasOwnProperty("prop"), false, 'obj.hasOwnProperty("prop")'); +assert.sameValue(obj.prop, 1001, 'obj.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-418.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-418.js index 4e04e0352..d2c0ab532 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-418.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-418.js @@ -7,12 +7,10 @@ description: > ES5 Attributes - Successfully add a property to an object when the object's prototype has a property with the same name and [[Writable]] set to true (Function.prototype.bind) -includes: [runTestCase.js] ---*/ -function testcase() { var foo = function () { }; - try { + Object.defineProperty(Function.prototype, "prop", { value: 1001, writable: true, @@ -23,9 +21,5 @@ function testcase() { var obj = foo.bind({}); obj.prop = 1002; - return obj.hasOwnProperty("prop") && obj.prop === 1002; - } finally { - delete Function.prototype.prop; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true'); +assert.sameValue(obj.prop, 1002, 'obj.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-419.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-419.js index 5a707bcc0..e175d090f 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-419.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-419.js @@ -6,12 +6,10 @@ es5id: 15.2.3.6-4-419 description: > ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to true is enumerable (Function.prototype.bind) -includes: [runTestCase.js] ---*/ -function testcase() { var foo = function () { }; - try { + Object.defineProperty(Function.prototype, "prop", { value: 1001, writable: true, @@ -27,9 +25,5 @@ function testcase() { } } - return !obj.hasOwnProperty("prop") && verifyEnumerable; - } finally { - delete Function.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(obj.hasOwnProperty("prop"), false, 'obj.hasOwnProperty("prop")'); +assert(verifyEnumerable, 'verifyEnumerable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-420.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-420.js index 9c192fd4b..f403f9b34 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-420.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-420.js @@ -11,7 +11,7 @@ includes: [propertyHelper.js] ---*/ var foo = function () { }; -try { + Object.defineProperty(Function.prototype, "prop", { value: 1001, writable: false, @@ -22,7 +22,3 @@ try { var obj = foo.bind({}); assert(!obj.hasOwnProperty("prop")); verifyNotWritable(foo, "prop", "noCheckOwnProp"); -} finally { - delete Function.prototype.prop; -} - diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-421.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-421.js index adb3af773..120ffe0fd 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-421.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-421.js @@ -6,12 +6,10 @@ es5id: 15.2.3.6-4-421 description: > ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to false is non-enumerable (Function.prototype.bind) -includes: [runTestCase.js] ---*/ -function testcase() { var foo = function () { }; - try { + Object.defineProperty(Function.prototype, "prop", { value: 1001, writable: false, @@ -27,9 +25,5 @@ function testcase() { } } - return !obj.hasOwnProperty("prop") && !verifyEnumerable; - } finally { - delete Function.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(obj.hasOwnProperty("prop"), false, 'obj.hasOwnProperty("prop")'); +assert.sameValue(verifyEnumerable, false, 'verifyEnumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-531-17.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-531-17.js index 84835f3ca..84b8696dc 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-531-17.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-531-17.js @@ -7,14 +7,11 @@ description: > ES5 Attributes - Updating an indexed accessor property 'P' using simple assignment is successful, 'O' is the global object (8.12.5 step 5.b) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var obj = fnGlobalObject(); - try { + obj.verifySetFunc = "data"; var setFunc = function (value) { obj.verifySetFunc = value; @@ -34,10 +31,6 @@ function testcase() { var propertyDefineCorrect = obj.hasOwnProperty("0"); var desc = Object.getOwnPropertyDescriptor(obj, "0"); - return propertyDefineCorrect && desc.set === setFunc && obj[0] === "overrideData"; - } finally { - delete obj[0]; - delete obj.verifySetFunc; - } - } -runTestCase(testcase); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.set, setFunc, 'desc.set'); +assert.sameValue(obj[0], "overrideData", 'obj[0]'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-531-8.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-531-8.js index a39afa763..610532c9c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-531-8.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-531-8.js @@ -13,7 +13,7 @@ includes: ---*/ var obj = fnGlobalObject(); -try { + obj.verifySetFunc = "data"; var getFunc = function () { return obj.verifySetFunc; @@ -31,7 +31,3 @@ try { verifyNotWritable(obj, "prop"); assert.sameValue(typeof desc.set, "undefined"); assert.sameValue(obj.prop, "data"); -} finally { - delete obj.prop; - delete obj.verifySetFunc; -} diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-578.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-578.js index f90c6ff42..eee9a7cfe 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-578.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-578.js @@ -6,12 +6,10 @@ es5id: 15.2.3.6-4-578 description: > ES5 Attributes - [[Get]] field of inherited property of [[Prototype]] internal property is correct (String instance) -includes: [runTestCase.js] ---*/ -function testcase() { var data = "data"; - try { + Object.defineProperty(String.prototype, "prop", { get: function () { return data; @@ -24,9 +22,5 @@ function testcase() { }); var strObj = new String(); - return !strObj.hasOwnProperty("prop") && strObj.prop === "data"; - } finally { - delete String.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(strObj.hasOwnProperty("prop"), false, 'strObj.hasOwnProperty("prop")'); +assert.sameValue(strObj.prop, "data", 'strObj.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-579.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-579.js index dab54da13..e910f3335 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-579.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-579.js @@ -6,12 +6,10 @@ es5id: 15.2.3.6-4-579 description: > ES5 Attributes - Success to add property into object (Array instance) -includes: [runTestCase.js] ---*/ -function testcase() { var data = "data"; - try { + Object.defineProperty(Array.prototype, "prop", { get: function () { return data; @@ -25,9 +23,6 @@ function testcase() { var arrObj = []; arrObj.prop = "myOwnProperty"; - return !arrObj.hasOwnProperty("prop") && arrObj.prop === "myOwnProperty" && data === "myOwnProperty"; - } finally { - delete Array.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(arrObj.hasOwnProperty("prop"), false, 'arrObj.hasOwnProperty("prop")'); +assert.sameValue(arrObj.prop, "myOwnProperty", 'arrObj.prop'); +assert.sameValue(data, "myOwnProperty", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-580.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-580.js index 8fd5bd6b1..d4c99db07 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-580.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-580.js @@ -6,12 +6,10 @@ es5id: 15.2.3.6-4-580 description: > ES5 Attributes - Inherited property is enumerable (Boolean instance) -includes: [runTestCase.js] ---*/ -function testcase() { var data = "data"; - try { + Object.defineProperty(Boolean.prototype, "prop", { get: function () { return data; @@ -30,9 +28,5 @@ function testcase() { } } - return !boolObj.hasOwnProperty("prop") && verifyEnumerable; - } finally { - delete Boolean.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(boolObj.hasOwnProperty("prop"), false, 'boolObj.hasOwnProperty("prop")'); +assert(verifyEnumerable, 'verifyEnumerable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-581.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-581.js index 478e76009..2931f9c8f 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-581.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-581.js @@ -8,7 +8,7 @@ includes: [propertyHelper.js] ---*/ var data = "data"; -try { + Object.defineProperty(Number.prototype, "prop", { get: function () { return data; @@ -23,6 +23,3 @@ try { assert(!numObj.hasOwnProperty("prop")); assert.sameValue(numObj.prop, "data"); assert.sameValue(data, "data"); -} finally { - delete Number.prototype.prop; -} diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-582.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-582.js index ee7a5d0c9..7895b7455 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-582.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-582.js @@ -6,12 +6,10 @@ es5id: 15.2.3.6-4-582 description: > ES5 Attributes - Inherited property is non-enumerable (Function instance) -includes: [runTestCase.js] ---*/ -function testcase() { var data = "data"; - try { + Object.defineProperty(Function.prototype, "prop", { get: function () { return data; @@ -27,9 +25,5 @@ function testcase() { } } - return !funObj.hasOwnProperty("prop") && !verifyEnumerable; - } finally { - delete Function.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(funObj.hasOwnProperty("prop"), false, 'funObj.hasOwnProperty("prop")'); +assert.sameValue(verifyEnumerable, false, 'verifyEnumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-583.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-583.js index 4c765944c..97b7352fd 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-583.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-583.js @@ -6,12 +6,10 @@ es5id: 15.2.3.6-4-583 description: > ES5 Attributes - [[Get]] field of inherited property of [[Prototype]] internal property is correct (Error Instance) -includes: [runTestCase.js] ---*/ -function testcase() { var data = "data"; - try { + Object.defineProperty(Error.prototype, "prop", { get: function () { return data; @@ -24,9 +22,5 @@ function testcase() { }); var errObj = new Error(); - return !errObj.hasOwnProperty("prop") && errObj.prop === "data"; - } finally { - delete Error.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(errObj.hasOwnProperty("prop"), false, 'errObj.hasOwnProperty("prop")'); +assert.sameValue(errObj.prop, "data", 'errObj.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-584.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-584.js index 7b8241f0f..716431a7b 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-584.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-584.js @@ -4,12 +4,10 @@ /*--- es5id: 15.2.3.6-4-584 description: ES5 Attributes - Failed to add property into object (Date instance) -includes: [runTestCase.js] ---*/ -function testcase() { var data = "data"; - try { + Object.defineProperty(Date.prototype, "prop", { get: function () { return data; @@ -23,9 +21,6 @@ function testcase() { var dateObj = new Date(); dateObj.prop = "myOwnProperty"; - return !dateObj.hasOwnProperty("prop") && dateObj.prop === "myOwnProperty" && data === "myOwnProperty"; - } finally { - delete Date.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(dateObj.hasOwnProperty("prop"), false, 'dateObj.hasOwnProperty("prop")'); +assert.sameValue(dateObj.prop, "myOwnProperty", 'dateObj.prop'); +assert.sameValue(data, "myOwnProperty", 'data'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-585.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-585.js index 4b0699022..b58e59416 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-585.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-585.js @@ -4,12 +4,10 @@ /*--- es5id: 15.2.3.6-4-585 description: ES5 Attributes - Inherited property is enumerable (RegExp instance) -includes: [runTestCase.js] ---*/ -function testcase() { var data = "data"; - try { + Object.defineProperty(RegExp.prototype, "prop", { get: function () { return data; @@ -28,9 +26,5 @@ function testcase() { } } - return !regObj.hasOwnProperty("prop") && verifyEnumerable; - } finally { - delete RegExp.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(regObj.hasOwnProperty("prop"), false, 'regObj.hasOwnProperty("prop")'); +assert(verifyEnumerable, 'verifyEnumerable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-586.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-586.js index f10dbde3a..37c718de9 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-586.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-586.js @@ -10,7 +10,7 @@ includes: [propertyHelper.js] ---*/ var data = "data"; -try { + Object.defineProperty(Object.prototype, "prop", { get: function () { return data; @@ -23,6 +23,3 @@ try { assert(!JSON.hasOwnProperty("prop")); assert.sameValue(JSON.prop, "data"); assert.sameValue(data, "data"); -} finally { - delete Object.prototype.prop; -} diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-587.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-587.js index 911768de1..441dfe023 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-587.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-587.js @@ -4,12 +4,10 @@ /*--- es5id: 15.2.3.6-4-587 description: ES5 Attributes - Inherited property is non-enumerable (Math) -includes: [runTestCase.js] ---*/ -function testcase() { var data = "data"; - try { + Object.defineProperty(Object.prototype, "prop", { get: function () { return data; @@ -24,9 +22,5 @@ function testcase() { } } - return !Math.hasOwnProperty("prop") && !verifyEnumerable; - } finally { - delete Object.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(Math.hasOwnProperty("prop"), false, 'Math.hasOwnProperty("prop")'); +assert.sameValue(verifyEnumerable, false, 'verifyEnumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-593.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-593.js index 558c90b47..877f17efb 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-593.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-593.js @@ -7,13 +7,11 @@ description: > ES5 Attributes - [[Get]] field of inherited property of [[Prototype]] internal property is correct (Function.prototype.bind) -includes: [runTestCase.js] ---*/ -function testcase() { var foo = function () { }; var data = "data"; - try { + Object.defineProperty(Function.prototype, "prop", { get: function () { return data; @@ -27,9 +25,5 @@ function testcase() { var obj = foo.bind({}); - return !obj.hasOwnProperty("prop") && obj.prop === data; - } finally { - delete Function.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(obj.hasOwnProperty("prop"), false, 'obj.hasOwnProperty("prop")'); +assert.sameValue(obj.prop, data, 'obj.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-594.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-594.js index 6fe125ff1..8d5726679 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-594.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-594.js @@ -6,13 +6,11 @@ es5id: 15.2.3.6-4-594 description: > ES5 Attributes - Success to update value of property into of [[Proptotype]] internal property (Function.prototype.bind) -includes: [runTestCase.js] ---*/ -function testcase() { var foo = function () { }; var data = "data"; - try { + Object.defineProperty(Function.prototype, "prop", { get: function () { return data; @@ -27,9 +25,5 @@ function testcase() { var obj = foo.bind({}); obj.prop = "overrideData"; - return !obj.hasOwnProperty("prop") && obj.prop === "overrideData"; - } finally { - delete Function.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(obj.hasOwnProperty("prop"), false, 'obj.hasOwnProperty("prop")'); +assert.sameValue(obj.prop, "overrideData", 'obj.prop'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-595.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-595.js index 30be14f7a..2f800ac1c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-595.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-595.js @@ -6,13 +6,11 @@ es5id: 15.2.3.6-4-595 description: > ES5 Attributes - Inherited property is enumerable (Function.prototype.bind) -includes: [runTestCase.js] ---*/ -function testcase() { var foo = function () { }; var data = "data"; - try { + Object.defineProperty(Function.prototype, "prop", { get: function () { return data; @@ -33,9 +31,5 @@ function testcase() { } } - return !obj.hasOwnProperty("prop") && verifyEnumerable; - } finally { - delete Function.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(obj.hasOwnProperty("prop"), false, 'obj.hasOwnProperty("prop")'); +assert(verifyEnumerable, 'verifyEnumerable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-596.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-596.js index 8c99225e0..5489deaa0 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-596.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-596.js @@ -11,7 +11,7 @@ includes: [propertyHelper.js] var foo = function () { }; var data = "data"; -try { + Object.defineProperty(Function.prototype, "prop", { get: function () { return data; @@ -25,6 +25,3 @@ try { assert(!obj.hasOwnProperty("prop")); verifyNotWritable(obj, "prop", "nocheck"); assert.sameValue(obj.prop, "data");; -} finally { - delete Function.prototype.prop; -} diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-597.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-597.js index 81c4daa17..9a46c54cd 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-597.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-597.js @@ -6,13 +6,11 @@ es5id: 15.2.3.6-4-597 description: > ES5 Attributes - Inherited property is non-enumerable (Function.prototype.bind) -includes: [runTestCase.js] ---*/ -function testcase() { var foo = function () { }; var data = "data"; - try { + Object.defineProperty(Function.prototype, "prop", { get: function () { return data; @@ -30,9 +28,5 @@ function testcase() { } } - return !obj.hasOwnProperty("prop") && !verifyEnumerable; - } finally { - delete Function.prototype.prop; - } - } -runTestCase(testcase); +assert.sameValue(obj.hasOwnProperty("prop"), false, 'obj.hasOwnProperty("prop")'); +assert.sameValue(verifyEnumerable, false, 'verifyEnumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-598.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-598.js index 640eb9e6e..55420c69f 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-598.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-598.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-598 description: > ES5 Attributes - all attributes in Object.getPrototypeOf are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "getPrototypeOf"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.getPrototypeOf; - try { Object.getPrototypeOf = "2010"; var isWritable = (Object.getPrototypeOf === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("getPrototypeOf"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "getPrototypeOf", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-599.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-599.js index 03b2f21f7..00e61a739 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-599.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-599.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-599 description: > ES5 Attributes - all attributes in Object.getOwnPropertyDescriptor are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "getOwnPropertyDescriptor"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.getOwnPropertyDescriptor; - try { Object.getOwnPropertyDescriptor = "2010"; var isWritable = (Object.getOwnPropertyDescriptor === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("getOwnPropertyDescriptor"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "getOwnPropertyDescriptor", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-600.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-600.js index ad0ab1994..7f1ab0b27 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-600.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-600.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-600 description: > ES5 Attributes - all attributes in Object.getOwnPropertyNames are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "getOwnPropertyNames"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.getOwnPropertyNames; - try { Object.getOwnPropertyNames = "2010"; var isWritable = (Object.getOwnPropertyNames === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("getOwnPropertyNames"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "getOwnPropertyNames", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-601.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-601.js index 52108e4df..b9bcd8dc3 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-601.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-601.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-601 description: ES5 Attributes - all attributes in Object.create are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "create"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.create; - try { Object.create = "2010"; var isWritable = (Object.create === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("create"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "create", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-602.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-602.js index 6fd4a3d95..d2f6f0de2 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-602.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-602.js @@ -6,15 +6,13 @@ es5id: 15.2.3.6-4-602 description: > ES5 Attributes - all attributes in Object.defineProperty are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "defineProperty"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.defineProperty; - try { + Object.defineProperty = "2010"; var isWritable = (Object.defineProperty === "2010"); @@ -31,12 +29,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("defineProperty"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty = temp; - Object.defineProperty(Object, "defineProperty", { - enumerable: false - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-603.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-603.js index 542f3b58e..7959a39ee 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-603.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-603.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-603 description: > ES5 Attributes - all attributes in Object.defineProperties are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "defineProperties"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.defineProperties; - try { Object.defineProperties = "2010"; var isWritable = (Object.defineProperties === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("defineProperties"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "defineProperties", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-604.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-604.js index c008b7363..497ebad75 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-604.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-604.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-604 description: ES5 Attributes - all attributes in Object.seal are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "seal"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.seal; - try { Object.seal = "2010"; var isWritable = (Object.seal === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("seal"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "seal", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-605.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-605.js index a9a897e8f..45952f26c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-605.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-605.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-605 description: ES5 Attributes - all attributes in Object.freeze are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "freeze"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.freeze; - try { Object.freeze = "2010"; var isWritable = (Object.freeze === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("freeze"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "freeze", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-606.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-606.js index 471a8a7db..a3621fdd1 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-606.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-606.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-606 description: > ES5 Attributes - all attributes in Object.preventExtensions are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "preventExtensions"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.preventExtensions; - try { Object.preventExtensions = "2010"; var isWritable = (Object.preventExtensions === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("preventExtensions"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "preventExtensions", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-607.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-607.js index 580052300..88beb3e67 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-607.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-607.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-607 description: ES5 Attributes - all attributes in Object.isSealed are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "isSealed"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.isSealed; - try { Object.isSealed = "2010"; var isWritable = (Object.isSealed === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("isSealed"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "isSealed", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-608.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-608.js index cde4a901b..f752bc678 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-608.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-608.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-608 description: ES5 Attributes - all attributes in Object.isFrozen are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "isFrozen"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.isFrozen; - try { Object.isFrozen = "2010"; var isWritable = (Object.isFrozen === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("isFrozen"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "isFrozen", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-609.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-609.js index 43ad1010e..aa12befa7 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-609.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-609.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-609 description: ES5 Attributes - all attributes in Object.isExtensible are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "isExtensible"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.isExtensible; - try { Object.isExtensible = "2010"; var isWritable = (Object.isExtensible === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("isExtensible"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "isExtensible", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-610.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-610.js index e8b2403df..07cc6c4d8 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-610.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-610.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-610 description: ES5 Attributes - all attributes in Object.keys are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object, "keys"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Object.keys; - try { Object.keys = "2010"; var isWritable = (Object.keys === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Object.hasOwnProperty("keys"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Object, "keys", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-611.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-611.js index 949e52fad..aa0a5b9ce 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-611.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-611.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-611 description: > ES5 Attributes - all attributes in Function.prototype.bind are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Function.prototype, "bind"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Function.prototype.bind; - try { Function.prototype.bind = "2010"; var isWritable = (Function.prototype.bind === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Function.prototype.hasOwnProperty("bind"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Function.prototype, "bind", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-612.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-612.js index 3378d1497..74ff9cba3 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-612.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-612.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-612 description: > ES5 Attributes - all attributes in Array.prototype.indexOf are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Array.prototype, "indexOf"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Array.prototype.indexOf; - try { Array.prototype.indexOf = "2010"; var isWritable = (Array.prototype.indexOf === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Array.prototype.hasOwnProperty("indexOf"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Array.prototype, "indexOf", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-613.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-613.js index 8d179d0b2..58bf1afa6 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-613.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-613.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-613 description: ES5 Attributes - all attributes in Object.lastIndexOf are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Array.prototype, "lastIndexOf"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Array.prototype.lastIndexOf; - try { Array.prototype.lastIndexOf = "2010"; var isWritable = (Array.prototype.lastIndexOf === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Array.prototype.hasOwnProperty("lastIndexOf"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Array.prototype, "lastIndexOf", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-614.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-614.js index f4ee4f588..cd393df4c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-614.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-614.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-614 description: > ES5 Attributes - all attributes in Array.prototype.every are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Array.prototype, "every"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Array.prototype.every; - try { Array.prototype.every = "2010"; var isWritable = (Array.prototype.every === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Array.prototype.hasOwnProperty("every"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Array.prototype, "every", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-615.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-615.js index c93ce2921..172758c2c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-615.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-615.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-615 description: ES5 Attributes - all attributes in Array.prototype.some are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Array.prototype, "some"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Array.prototype.some; - try { Array.prototype.some = "2010"; var isWritable = (Array.prototype.some === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Array.prototype.hasOwnProperty("some"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Array.prototype, "some", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-616.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-616.js index e922be1de..4a53ab993 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-616.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-616.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-616 description: > ES5 Attributes - all attributes in Array.prototype.forEach are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Array.prototype, "forEach"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Array.prototype.forEach; - try { Array.prototype.forEach = "2010"; var isWritable = (Array.prototype.forEach === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Array.prototype.hasOwnProperty("forEach"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Array.prototype, "forEach", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-617.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-617.js index e361a7aee..7e41f46c4 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-617.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-617.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-617 description: ES5 Attributes - all attributes in Array.prototype.map are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Array.prototype, "map"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Array.prototype.map; - try { Array.prototype.map = "2010"; var isWritable = (Array.prototype.map === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Array.prototype.hasOwnProperty("map"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Array.prototype, "map", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-618.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-618.js index 6685458f0..27492e2e3 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-618.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-618.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-618 description: > ES5 Attributes - all attributes in Array.prototype.filter are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Array.prototype, "filter"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Array.prototype.filter; - try { Array.prototype.filter = "2010"; var isWritable = (Array.prototype.filter === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Array.prototype.hasOwnProperty("filter"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Array.prototype, "filter", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-619.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-619.js index d0788918c..408f1417d 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-619.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-619.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-619 description: > ES5 Attributes - all attributes in Array.prototype.reduce are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Array.prototype, "reduce"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Array.prototype.reduce; - try { Array.prototype.reduce = "2010"; var isWritable = (Array.prototype.reduce === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Array.prototype.hasOwnProperty("reduce"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Array.prototype, "reduce", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-620.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-620.js index 8afc75751..e2a9f56f5 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-620.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-620.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-620 description: > ES5 Attributes - all attributes in Array.prototype.reduceRight are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Array.prototype, "reduceRight"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Array.prototype.reduceRight; - try { Array.prototype.reduceRight = "2010"; var isWritable = (Array.prototype.reduceRight === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Array.prototype.hasOwnProperty("reduceRight"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Array.prototype, "reduceRight", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-621.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-621.js index 273168780..b7e2ebf5c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-621.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-621.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-621 description: > ES5 Attributes - all attributes in String.prototype.trim are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(String.prototype, "trim"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = String.prototype.trim; - try { String.prototype.trim = "2010"; var isWritable = (String.prototype.trim === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !String.prototype.hasOwnProperty("trim"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(String.prototype, "trim", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-622.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-622.js index 6ca6f94ce..c587d33d4 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-622.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-622.js @@ -4,17 +4,14 @@ /*--- es5id: 15.2.3.6-4-622 description: ES5 Attributes - all attributes in Date.now are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Date, "now"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Date.now; - try { Date.now = "2010"; var isWritable = (Date.now === "2010"); @@ -31,14 +28,7 @@ function testcase() { var isConfigurable = !Date.hasOwnProperty("now"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Date, "now", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-623.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-623.js index d1374fdae..f96eb0c02 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-623.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-623.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-623 description: > ES5 Attributes - all attributes in Date.prototype.toISOString are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Date.prototype, "toISOString"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Date.prototype.toISOString; - try { Date.prototype.toISOString = "2010"; var isWritable = (Date.prototype.toISOString === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Date.prototype.hasOwnProperty("toISOString"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Date.prototype, "toISOString", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-624.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-624.js index c8515ada1..5b6abba13 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-624.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-624.js @@ -6,17 +6,14 @@ es5id: 15.2.3.6-4-624 description: > ES5 Attributes - all attributes in Date.prototype.toJSON are correct -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Date.prototype, "toJSON"); var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); var temp = Date.prototype.toJSON; - try { Date.prototype.toJSON = "2010"; var isWritable = (Date.prototype.toJSON === "2010"); @@ -33,14 +30,7 @@ function testcase() { var isConfigurable = !Date.prototype.hasOwnProperty("toJSON"); - return propertyAreCorrect && isWritable && !isEnumerable && isConfigurable; - } finally { - Object.defineProperty(Date.prototype, "toJSON", { - value: temp, - writable: true, - enumerable: false, - configurable: true - }); - } - } -runTestCase(testcase); +assert(propertyAreCorrect, 'propertyAreCorrect !== true'); +assert(isWritable, 'isWritable !== true'); +assert.sameValue(isEnumerable, false, 'isEnumerable'); +assert(isConfigurable, 'isConfigurable !== true'); diff --git a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-2-4.js b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-2-4.js index 8401f8ad7..fd42435c7 100644 --- a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-2-4.js +++ b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-2-4.js @@ -6,23 +6,15 @@ es5id: 15.2.3.4-2-4 description: > Object.getOwnPropertyNames - returned array is the standard built-in constructor -includes: [runTestCase.js] ---*/ -function testcase() { var oldArray = Array; Array = function () { throw new Error("invoke customer defined Array!"); }; var obj = {}; - try { + var result = Object.getOwnPropertyNames(obj); - return Object.prototype.toString.call(result) === "[object Array]"; - } catch (ex) { - return false; - } finally { - Array = oldArray; - } - } -runTestCase(testcase); + +assert.sameValue(Object.prototype.toString.call(result), "[object Array]", 'Object.prototype.toString.call(result)'); diff --git a/test/built-ins/global/10.2.1.1.3-4-22-s.js b/test/built-ins/global/10.2.1.1.3-4-22-s.js index 45ec8eb2c..bda9016fd 100644 --- a/test/built-ins/global/10.2.1.1.3-4-22-s.js +++ b/test/built-ins/global/10.2.1.1.3-4-22-s.js @@ -8,17 +8,12 @@ description: > the Constructor Properties of the Global Object under strict mode (Object) flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { var objBak = Object; try { Object = 12; - return true; } finally { Object = objBak; } - } -runTestCase(testcase); diff --git a/test/built-ins/global/10.2.1.1.3-4-27-s.js b/test/built-ins/global/10.2.1.1.3-4-27-s.js index 37418fbb5..ec1bc94e7 100644 --- a/test/built-ins/global/10.2.1.1.3-4-27-s.js +++ b/test/built-ins/global/10.2.1.1.3-4-27-s.js @@ -8,16 +8,11 @@ description: > the Constructor Properties of the Global Object under strict mode (Number) flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { var numBak = Number; try { Number = 12; - return true; } finally { Number = numBak; } - } -runTestCase(testcase); diff --git a/test/language/arguments-object/10.6-11-b-1.js b/test/language/arguments-object/10.6-11-b-1.js index cd09d57c4..47ced3290 100644 --- a/test/language/arguments-object/10.6-11-b-1.js +++ b/test/language/arguments-object/10.6-11-b-1.js @@ -7,11 +7,8 @@ description: > Arguments Object has index property '0' as its own property, it shoulde be writable, enumerable, configurable and does not invoke the setter defined on Object.prototype[0] (Step 11.b) -includes: [runTestCase.js] ---*/ -function testcase() { - try { var data = "data"; var getFunc = function () { return data; @@ -47,9 +44,8 @@ function testcase() { delete argObj[0]; verifyConfigurable = argObj.hasOwnProperty("0"); - return verifyValue && verifyWritable && verifyEnumerable && !verifyConfigurable && data === "data"; - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); +assert(verifyValue, 'verifyValue !== true'); +assert(verifyWritable, 'verifyWritable !== true'); +assert(verifyEnumerable, 'verifyEnumerable !== true'); +assert.sameValue(verifyConfigurable, false, 'verifyConfigurable'); +assert.sameValue(data, "data", 'data'); diff --git a/test/language/arguments-object/10.6-13-a-1.js b/test/language/arguments-object/10.6-13-a-1.js index fa722ac3d..e55527367 100644 --- a/test/language/arguments-object/10.6-13-a-1.js +++ b/test/language/arguments-object/10.6-13-a-1.js @@ -7,11 +7,8 @@ description: > In non-strict mode, arguments object should have its own 'callee' property defined (Step 13.a) flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Object.prototype, "callee", { value: 1, writable: false, @@ -38,9 +35,7 @@ function testcase() { delete argObj.callee; verifyConfigurable = argObj.hasOwnProperty("callee"); - return verifyValue && verifyWritable && !verifyEnumerable && !verifyConfigurable; - } finally { - delete Object.prototype.callee; - } - } -runTestCase(testcase); +assert(verifyValue, 'verifyValue !== true'); +assert(verifyWritable, 'verifyWritable !== true'); +assert.sameValue(verifyEnumerable, false, 'verifyEnumerable'); +assert.sameValue(verifyConfigurable, false, 'verifyConfigurable'); diff --git a/test/language/arguments-object/10.6-7-1.js b/test/language/arguments-object/10.6-7-1.js index b663fe370..c6a368452 100644 --- a/test/language/arguments-object/10.6-7-1.js +++ b/test/language/arguments-object/10.6-7-1.js @@ -6,11 +6,8 @@ es5id: 10.6-7-1 description: > Arguments Object has length as its own property and does not invoke the setter defined on Object.prototype.length (Step 7) -includes: [runTestCase.js] ---*/ -function testcase() { - try { var data = "data"; var getFunc = function () { return 12; @@ -45,9 +42,8 @@ function testcase() { delete argObj.length; verifyConfigurable = argObj.hasOwnProperty("length"); - return verifyValue && verifyWritable && !verifyEnumerable && !verifyConfigurable && data === "data"; - } finally { - delete Object.prototype.length; - } - } -runTestCase(testcase); +assert(verifyValue, 'verifyValue !== true'); +assert(verifyWritable, 'verifyWritable !== true'); +assert.sameValue(verifyEnumerable, false, 'verifyEnumerable'); +assert.sameValue(verifyConfigurable, false, 'verifyConfigurable'); +assert.sameValue(data, "data", 'data'); diff --git a/test/language/expressions/array/11.1.4_4-5-1.js b/test/language/expressions/array/11.1.4_4-5-1.js index 7d2ad8e0d..229f9ff8d 100644 --- a/test/language/expressions/array/11.1.4_4-5-1.js +++ b/test/language/expressions/array/11.1.4_4-5-1.js @@ -13,11 +13,8 @@ description: > Initialize array using ElementList (Elisionopt AssignmentExpression) when index property (read-only) exists in Array.prototype (step 5) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { value: 100, writable: false, @@ -25,9 +22,5 @@ function testcase() { }); var arr = [101]; - return arr.hasOwnProperty("0") && arr[0] === 101; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(arr.hasOwnProperty("0"), 'arr.hasOwnProperty("0") !== true'); +assert.sameValue(arr[0], 101, 'arr[0]'); diff --git a/test/language/expressions/array/11.1.4_5-6-1.js b/test/language/expressions/array/11.1.4_5-6-1.js index d4c6b202a..54a3d0d5f 100644 --- a/test/language/expressions/array/11.1.4_5-6-1.js +++ b/test/language/expressions/array/11.1.4_5-6-1.js @@ -13,11 +13,8 @@ description: > Initialize array using ElementList (ElementList , Elisionopt AssignmentExpression) when index property (read-only) exists in Array.prototype (step 6) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "1", { value: 100, writable: false, @@ -25,9 +22,5 @@ function testcase() { }); var arr = [101, 12]; - return arr.hasOwnProperty("1") && arr[1] === 12; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(arr.hasOwnProperty("1"), 'arr.hasOwnProperty("1") !== true'); +assert.sameValue(arr[1], 12, 'arr[1]'); diff --git a/test/language/expressions/delete/11.4.1-4.a-10.js b/test/language/expressions/delete/11.4.1-4.a-10.js index 48b5543ae..279e62e4d 100644 --- a/test/language/expressions/delete/11.4.1-4.a-10.js +++ b/test/language/expressions/delete/11.4.1-4.a-10.js @@ -9,25 +9,9 @@ es5id: 11.4.1-4.a-10 description: > delete operator returns true for property (stringify) defined on built-in object (JSON) -includes: [runTestCase.js] ---*/ -function testcase() { - try { - var o = JSON.stringify; - var desc; - try { - desc = Object.getOwnPropertyDescriptor(JSON, 'stringify') - } - catch (e) { - }; - var d = delete JSON.stringify; - if (d === true && JSON.stringify === undefined) { - return true; - } - } finally { - if (desc) Object.defineProperty(JSON, 'stringify', desc) - else JSON.stringify = o /* this branch messes up the attributes */; - } - } -runTestCase(testcase); +var d = delete JSON.stringify; + +assert.sameValue(d, true, 'd'); +assert.sameValue(JSON.stringify, undefined, 'JSON.stringify'); diff --git a/test/language/expressions/delete/11.4.1-4.a-8.js b/test/language/expressions/delete/11.4.1-4.a-8.js index a2e443a3c..85843135c 100644 --- a/test/language/expressions/delete/11.4.1-4.a-8.js +++ b/test/language/expressions/delete/11.4.1-4.a-8.js @@ -8,18 +8,8 @@ info: > es5id: 11.4.1-4.a-8 description: delete operator returns true for built-in objects (JSON) flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { - try { - var o = JSON; - var d = delete JSON; - if (d === true) { - return true; - } - } finally { - JSON = o; - } - } -runTestCase(testcase); +var d = delete JSON; + +assert.sameValue(d, true, 'd'); diff --git a/test/language/expressions/delete/11.4.1-5-a-26-s.js b/test/language/expressions/delete/11.4.1-5-a-26-s.js index 475b61ee1..97a706174 100644 --- a/test/language/expressions/delete/11.4.1-5-a-26-s.js +++ b/test/language/expressions/delete/11.4.1-5-a-26-s.js @@ -7,19 +7,8 @@ description: > Strict Mode - SyntaxError is thrown when deleting a built-in (Error) flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { - var errorBackup = Error; - try { +assert.throws(SyntaxError, function() { eval("delete Error;"); - return false; - } catch (e) { - return e instanceof SyntaxError; - } finally { - Error = errorBackup; - } - - } -runTestCase(testcase); +}); diff --git a/test/language/expressions/object/11.1.5_3-3-1.js b/test/language/expressions/object/11.1.5_3-3-1.js index ead4da5ea..810d59994 100644 --- a/test/language/expressions/object/11.1.5_3-3-1.js +++ b/test/language/expressions/object/11.1.5_3-3-1.js @@ -12,11 +12,8 @@ description: > Object initialization using PropertyNameAndValueList (PropertyAssignment) when property (read-only) exists in Object.prototype (step 3) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Object.prototype, "prop", { value: 100, writable: false, @@ -24,9 +21,5 @@ function testcase() { }); var obj = { prop: 12 }; - return obj.hasOwnProperty("prop") && obj.prop === 12; - } finally { - delete Object.prototype.prop; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true'); +assert.sameValue(obj.prop, 12, 'obj.prop'); diff --git a/test/language/expressions/object/11.1.5_4-5-1.js b/test/language/expressions/object/11.1.5_4-5-1.js index bf9f4ca0d..6ae19d4d4 100644 --- a/test/language/expressions/object/11.1.5_4-5-1.js +++ b/test/language/expressions/object/11.1.5_4-5-1.js @@ -12,11 +12,8 @@ description: > Object initialization using PropertyNameAndValueList (PropertyNameAndValueList , PropertyAssignment) when property (read-only) exists in Object.prototype (Step 5) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Object.prototype, "prop2", { value: 100, writable: false, @@ -25,9 +22,4 @@ function testcase() { var obj = { prop1: 101, prop2: 12 }; - return obj.hasOwnProperty("prop2"); - } finally { - delete Object.prototype.prop2; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty("prop2"), 'obj.hasOwnProperty("prop2") !== true'); diff --git a/test/language/statements/function/13.2-17-1.js b/test/language/statements/function/13.2-17-1.js index e9dd05da8..96ad83724 100644 --- a/test/language/statements/function/13.2-17-1.js +++ b/test/language/statements/function/13.2-17-1.js @@ -7,12 +7,10 @@ description: > Function Object has 'constructor' as its own property, it is not enumerable and does not invoke the setter defined on Function.prototype.constructor (Step 17) -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(Object.prototype, "constructor"); - try { + var getFunc = function () { return 100; }; @@ -48,9 +46,8 @@ function testcase() { delete fun.prototype.constructor; verifyConfigurable = fun.hasOwnProperty("constructor"); - return verifyValue && verifyWritable && !verifyEnumerable && !verifyConfigurable && data === "data"; - } finally { - Object.defineProperty(Object.prototype, "constructor", desc); - } - } -runTestCase(testcase); +assert(verifyValue, 'verifyValue !== true'); +assert(verifyWritable, 'verifyWritable !== true'); +assert.sameValue(verifyEnumerable, false, 'verifyEnumerable'); +assert.sameValue(verifyConfigurable, false, 'verifyConfigurable'); +assert.sameValue(data, "data", 'data'); diff --git a/test/language/statements/try/12.14-13.js b/test/language/statements/try/12.14-13.js index 232306c24..ba6ccaec9 100644 --- a/test/language/statements/try/12.14-13.js +++ b/test/language/statements/try/12.14-13.js @@ -4,17 +4,16 @@ /*--- es5id: 12.14-13 description: catch introduces scope - updates are based on scope -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() { var res1 = false; var res2 = false; var res3 = false; +(function() { var x_12_14_13 = 'local'; - try { + function foo() { this.x_12_14_13 = 'instance'; } @@ -28,14 +27,8 @@ function testcase() { res2 = (x_12_14_13 === 'local'); } res3 = (x_12_14_13 === 'local'); +})(); - if (res1 === true && - res2 === true && - res3 === true) { - return true; - } - } finally { - delete this.x_12_14_13; - } - } -runTestCase(testcase); +assert(res1, 'res1 !== true'); +assert(res2, 'res2 !== true'); +assert(res3, 'res3 !== true'); diff --git a/test/language/statements/try/12.14-14.js b/test/language/statements/try/12.14-14.js index 0ffd98b48..2921b62df 100644 --- a/test/language/statements/try/12.14-14.js +++ b/test/language/statements/try/12.14-14.js @@ -7,24 +7,21 @@ description: > Exception object is a function, when an exception parameter is called as a function in catch block, global object is passed as the this value -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] flags: [noStrict] ---*/ -function testcase() { +var result; + +(function() { try { throw function () { this._12_14_14_foo = "test"; }; - return false; } catch (e) { e(); - return fnGlobalObject()._12_14_14_foo === "test"; - } - finally { - delete fnGlobalObject()._12_14_14_foo; + result = fnGlobalObject()._12_14_14_foo; } - } -runTestCase(testcase); +})(); + +assert.sameValue(result, "test", 'result'); diff --git a/test/language/statements/try/12.14-15.js b/test/language/statements/try/12.14-15.js index aa4f4860a..fbbda820b 100644 --- a/test/language/statements/try/12.14-15.js +++ b/test/language/statements/try/12.14-15.js @@ -7,26 +7,23 @@ description: > Exception object is a function which is a property of an object, when an exception parameter is called as a function in catch block, global object is passed as the this value -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] flags: [noStrict] ---*/ -function testcase() { +var result; + +(function() { var obj = {}; obj.test = function () { this._12_14_15_foo = "test"; }; try { throw obj.test; - return false; } catch (e) { e(); - return fnGlobalObject()._12_14_15_foo === "test"; - } - finally { - delete fnGlobalObject()._12_14_15_foo; + result = fnGlobalObject()._12_14_15_foo; } - } -runTestCase(testcase); +})(); + +assert.sameValue(result, "test", 'result'); diff --git a/test/language/statements/try/12.14-16.js b/test/language/statements/try/12.14-16.js index 919e43170..24656a0b0 100644 --- a/test/language/statements/try/12.14-16.js +++ b/test/language/statements/try/12.14-16.js @@ -7,18 +7,17 @@ description: > Exception object is a function which update in catch block, when an exception parameter is called as a function in catch block, global object is passed as the this value -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] flags: [noStrict] ---*/ -function testcase() { +var result; + +(function() { try { throw function () { this._12_14_16_foo = "test"; }; - return false; } catch (e) { var obj = {}; obj.test = function () { @@ -26,11 +25,8 @@ function testcase() { }; e = obj.test; e(); - return fnGlobalObject()._12_14_16_foo === "test1"; - } - finally { - delete fnGlobalObject()._12_14_16_foo; + result = fnGlobalObject()._12_14_16_foo; } +})(); - } -runTestCase(testcase); +assert.sameValue(result, "test1", 'result'); |