diff --git a/test/built-ins/Array/15.4.5.1-3.d-1.js b/test/built-ins/Array/15.4.5.1-3.d-1.js index 936331009cbfbb6ac7f3edb10238bb72b8b3ec9b..7e771af03732cf2415eadb36f68742d298fecb9c 100644 --- a/test/built-ins/Array/15.4.5.1-3.d-1.js +++ b/test/built-ins/Array/15.4.5.1-3.d-1.js @@ -6,14 +6,9 @@ es5id: 15.4.5.1-3.d-1 description: > Throw RangeError if attempt to set array length property to 4294967296 (2**32) -includes: [runTestCase.js] ---*/ -function testcase() { - try { + +assert.throws(RangeError, function() { [].length = 4294967296 ; - } catch (e) { - if (e instanceof RangeError) return true; - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/15.4.5.1-3.d-2.js b/test/built-ins/Array/15.4.5.1-3.d-2.js index eacc1b709c625edef4f884330155abf214ae5920..e5ecd52d042e13d5d2944dba0d634343fae293bc 100644 --- a/test/built-ins/Array/15.4.5.1-3.d-2.js +++ b/test/built-ins/Array/15.4.5.1-3.d-2.js @@ -6,14 +6,9 @@ es5id: 15.4.5.1-3.d-2 description: > Throw RangeError if attempt to set array length property to 4294967297 (1+2**32) -includes: [runTestCase.js] ---*/ -function testcase() { - try { + +assert.throws(RangeError, function() { [].length = 4294967297 ; - } catch (e) { - if (e instanceof RangeError) return true; - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-1-1.js b/test/built-ins/Array/prototype/every/15.4.4.16-1-1.js index f4c9bfe4e57e96211664a965a551867d9a1377cc..f6250b0af232777e23efafb79f520d8783795864 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-1-1.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-1-1.js @@ -4,15 +4,9 @@ /*--- es5id: 15.4.4.16-1-1 description: Array.prototype.every applied to undefined throws a TypeError -includes: [runTestCase.js] ---*/ -function testcase() { - try { + +assert.throws(TypeError, function() { Array.prototype.every.call(undefined); // TypeError is thrown if value is undefined - return false; - } catch (e) { - return (e instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-1-2.js b/test/built-ins/Array/prototype/every/15.4.4.16-1-2.js index 27bb16bf60cab7184b862f2ab94b39377a6aadb1..8e9c44e1cc6a94950050f8b3218954d801c02d35 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-1-2.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-1-2.js @@ -4,15 +4,9 @@ /*--- es5id: 15.4.4.16-1-2 description: Array.prototype.every applied to null throws a TypeError -includes: [runTestCase.js] ---*/ -function testcase() { - try { + +assert.throws(TypeError, function() { Array.prototype.every.call(null); // TypeError is thrown if value is null - return false; - } catch (e) { - return (e instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-22.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-22.js index c6740303f46004348145dea36d57459898388330..0925479b4ea932ad12a1b3bb468c4e5b6bfb3ad3 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-22.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-22.js @@ -7,11 +7,8 @@ description: > Array.prototype.every throws TypeError exception when 'length' is an object with toString and valueOf methods that don�t return primitive values -includes: [runTestCase.js] ---*/ -function testcase() { - var callbackfnAccessed = false; var toStringAccessed = false; var valueOfAccessed = false; @@ -36,12 +33,9 @@ function testcase() { } } }; - - try { +assert.throws(TypeError, function() { Array.prototype.every.call(obj, callbackfn); - return false; - } catch (ex) { - return (ex instanceof TypeError) && toStringAccessed && valueOfAccessed && !callbackfnAccessed; - } - } -runTestCase(testcase); +}); +assert(toStringAccessed, 'toStringAccessed !== true'); +assert(valueOfAccessed, 'valueOfAccessed !== true'); +assert.sameValue(callbackfnAccessed, false, 'callbackfnAccessed'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-4-1.js b/test/built-ins/Array/prototype/every/15.4.4.16-4-1.js index e6a44deb9e048bb20ebb4534d14860b41fbbfdb8..7c41da2ceb1ae40f3e3f845423257badaa0ecaca 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-4-1.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-4-1.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.16-4-1 description: Array.prototype.every throws TypeError if callbackfn is undefined -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.every(); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.every(); +}); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-4-15.js b/test/built-ins/Array/prototype/every/15.4.4.16-4-15.js index ebc4e74909b168582e094e2a298c8859dee78cf6..5c7b02fa469136082361ea6a39d855186ef5baec 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-4-15.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-4-15.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-4-15 description: > Array.prototype.every - calling with no callbackfn is the same as passing undefined for callbackfn -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { 10: 10 }; var lengthAccessed = false; var loopAccessed = false; @@ -29,12 +27,8 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.every.call(obj); - return false; - } catch (ex) { - return (ex instanceof TypeError) && lengthAccessed && !loopAccessed; - } - } -runTestCase(testcase); +}); +assert(lengthAccessed, 'lengthAccessed !== true'); +assert.sameValue(loopAccessed, false, 'loopAccessed'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-4-3.js b/test/built-ins/Array/prototype/every/15.4.4.16-4-3.js index 1cc880e8aaa091fee3bd365b695fb50026670804..75e038a10398e2c9c939e00ce7389f93ae690c16 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-4-3.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-4-3.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.16-4-3 description: Array.prototype.every throws TypeError if callbackfn is null -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.every(null); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.every(null); +}); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-4-4.js b/test/built-ins/Array/prototype/every/15.4.4.16-4-4.js index 4087cbdc639164114c84b8f64edf685c04e3e48f..9da632a37fc5956910b750ff383b74d2200230dc 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-4-4.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-4-4.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.16-4-4 description: Array.prototype.every throws TypeError if callbackfn is boolean -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.every(true); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.every(true); +}); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-4-5.js b/test/built-ins/Array/prototype/every/15.4.4.16-4-5.js index 169f53a57a227e49ae628dccfb2acba1c61a6093..503ec7d8989fb1ea3d55f03fcf1e38c64cc55e44 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-4-5.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-4-5.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.16-4-5 description: Array.prototype.every throws TypeError if callbackfn is number -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.every(5); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.every(5); +}); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-4-6.js b/test/built-ins/Array/prototype/every/15.4.4.16-4-6.js index 563af42bd6f097d26b895dc8e8fc723b2c56f2d9..789674836b46bddfc65781253f8ece371d83ebc7 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-4-6.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-4-6.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.16-4-6 description: Array.prototype.every throws TypeError if callbackfn is string -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.every("abc"); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.every("abc"); +}); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-4-7.js b/test/built-ins/Array/prototype/every/15.4.4.16-4-7.js index 9bad6bede84d2e1e5d76819381e7145020521735..5d6bbc1a5930e593c8911d10609f16f522695c02 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-4-7.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-4-7.js @@ -6,19 +6,9 @@ es5id: 15.4.4.16-4-7 description: > Array.prototype.every throws TypeError if callbackfn is Object without a Call internal method -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.every( {} ); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.every( {} ); +}); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-4-8.js b/test/built-ins/Array/prototype/every/15.4.4.16-4-8.js index 3112aead035884d4fd14dca2e10a8d50d3be60fb..e274820717b694352949cc49dd89464eae04fce2 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-4-8.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-4-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.16-4-8 description: > Array.prototype.every - side effects produced by step 2 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; var accessed = false; @@ -22,12 +19,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.every.call(obj, null); - return false; - } catch (ex) { - return ex instanceof TypeError && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-4-9.js b/test/built-ins/Array/prototype/every/15.4.4.16-4-9.js index 1471ee503ae9fa1c7adafab07187bf6976b499e1..1eac00d46851954fecb4843bd5df558e226becd1 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-4-9.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-4-9.js @@ -6,11 +6,8 @@ es5id: 15.4.4.16-4-9 description: > Array.prototype.every - side effects produced by step 3 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; var accessed = false; @@ -26,12 +23,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.every.call(obj, null); - return false; - } catch (ex) { - return ex instanceof TypeError && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-30.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-30.js index de3ad30b792f58bb97076a80644aec9c61b7f43d..dbf50bc00843dfd56b75847335936ebe2d1a0af9 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-30.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-30.js @@ -6,11 +6,8 @@ es5id: 15.4.4.16-7-c-i-30 description: > Array.prototype.every - unnhandled exceptions happened in getter terminate iteration on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { if (idx > 1) { @@ -26,12 +23,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(RangeError, function() { Array.prototype.every.call(obj, callbackfn); - return false; - } catch (ex) { - return (ex instanceof RangeError) && !accessed; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-31.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-31.js index 6be105291d4738b4b12bb7f3251ec611eb7a8d4a..00acee89953856cb36512ba773b3bd56754d20bd 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-31.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-31.js @@ -6,11 +6,8 @@ es5id: 15.4.4.16-7-c-i-31 description: > Array.prototype.every - unhandled exceptions happened in getter terminate iteration on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { if (idx > 1) { @@ -29,12 +26,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(RangeError, function() { arr.every(callbackfn); - return false; - } catch (ex) { - return (ex instanceof RangeError) && !accessed; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-1.js index 770768432f399fd27f8e241749bb020f5741f907..749b48d8a2adf1f1735dd613395b8faa8f1cef6f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-1.js @@ -4,15 +4,9 @@ /*--- es5id: 15.4.4.20-1-1 description: Array.prototype.filter applied to undefined throws a TypeError -includes: [runTestCase.js] ---*/ -function testcase() { - try { + +assert.throws(TypeError, function() { Array.prototype.filter.call(undefined); // TypeError is thrown if value is undefined - return false; - } catch (ex) { - return ex instanceof TypeError; - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-2.js index 67b1857304577f8b439db5537c55518d076cda37..e744128c6efbe319ec299db4b7864e270b18ea4f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-2.js @@ -4,15 +4,9 @@ /*--- es5id: 15.4.4.20-1-2 description: Array.prototype.filter applied to null throws a TypeError -includes: [runTestCase.js] ---*/ -function testcase() { - try { + +assert.throws(TypeError, function() { Array.prototype.filter.call(null); - return false; - } catch (ex) { - return ex instanceof TypeError; - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-22.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-22.js index c9df0158fcdf8fb80e876771ccf840cfabade3f8..e72f4aab49abfce5d398813e3e4e405e0e86b0ce 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-22.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-22.js @@ -7,11 +7,8 @@ description: > Array.prototype.filter throws TypeError exception when 'length' is an object with toString and valueOf methods that don�t return primitive values -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var firstStepOccured = false; var secondStepOccured = false; @@ -36,12 +33,9 @@ function testcase() { } } }; - - try { +assert.throws(TypeError, function() { Array.prototype.filter.call(obj, callbackfn); - return false; - } catch (ex) { - return (ex instanceof TypeError) && !accessed && firstStepOccured && secondStepOccured; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); +assert(firstStepOccured, 'firstStepOccured !== true'); +assert(secondStepOccured, 'secondStepOccured !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-1.js index f8254ae83a563d7c3473d31947c6b972b0923204..438a810dac7a5803b240059db5c1de8d76f5df19 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-1.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.20-4-1 description: Array.prototype.filter throws TypeError if callbackfn is undefined -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.filter(); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.filter(); +}); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-15.js index eb24bf97d00791f20c6cbc2ff5df7c7a61825e0e..2bf2e8a962d78c91a86a11137cdb44553f90e6c1 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-15.js @@ -6,10 +6,8 @@ es5id: 15.4.4.20-4-15 description: > Array.prototype.filter - calling with no callbackfn is the same as passing undefined for callbackfn -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { 10: 10 }; var lengthAccessed = false; var loopAccessed = false; @@ -27,12 +25,8 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.filter.call(obj); - return false; - } catch (ex) { - return (ex instanceof TypeError) && lengthAccessed && !loopAccessed; - } - } -runTestCase(testcase); +}); +assert(lengthAccessed, 'lengthAccessed !== true'); +assert.sameValue(loopAccessed, false, 'loopAccessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-2.js index fa8b81de4c5a82cc36c2fe577c3e6f529bd1fffe..69579f172c2083ff841f5c204e371cfa29be55f2 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-2.js @@ -6,19 +6,9 @@ es5id: 15.4.4.20-4-2 description: > Array.prototype.filter throws ReferenceError if callbackfn is unreferenced -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.filter(foo); - } - catch(e) { - if(e instanceof ReferenceError) - return true; - } - - } -runTestCase(testcase); +assert.throws(ReferenceError, function() { + arr.filter(foo); +}); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-3.js index 37808a987380123791a8e535ab042ab5ad3211a1..3a9417fafc7f36350fee81e1c6caee59c9b7770a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-3.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.20-4-3 description: Array.prototype.filter throws TypeError if callbackfn is null -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.filter(null); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.filter(null); +}); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-4.js index c09bf01f3319a8668fd73ffa229eb1986a9e8c82..2f6e67726028be12ffb71282c864a60a5e1b2bf6 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-4.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.20-4-4 description: Array.prototype.filter throws TypeError if callbackfn is boolean -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.filter(true); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.filter(true); +}); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-5.js index 4d49906ec032b341412709d358e52619824420d3..62e94d2a31ffbf1319188a1e5fdb0abe88b6fabd 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-5.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.20-4-5 description: Array.prototype.filter throws TypeError if callbackfn is number -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.filter(5); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.filter(5); +}); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-6.js index 543dd3adcb72ed96922a7eccb32f945b91eb7280..964c3d340a139d569abe28c8ce3b9bbc203aa76c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-6.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.20-4-6 description: Array.prototype.filter throws TypeError if callbackfn is string -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.filter("abc"); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.filter("abc"); +}); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-7.js index d80cb49a0a7df53d3fdf09c8236704c1c763cd2d..11a9fc5b0796706ceddef358908b1f8df452d6ae 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-7.js @@ -6,19 +6,9 @@ es5id: 15.4.4.20-4-7 description: > Array.prototype.filter throws TypeError if callbackfn is Object without [[Call]] internal method -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.filter(new Object()); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.filter(new Object()); +}); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-8.js index b643d08ff166c7a65a85a179bde9f73995831996..2941ac08cd54a0d289ac77791c94bb18127b8dac 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-4-8 description: > Array.prototype.filter - side effects produced by step 2 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; var accessed = false; @@ -22,12 +19,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.filter.call(obj, null); - return false; - } catch (ex) { - return ex instanceof TypeError && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-9.js index 813de76f6e47c3fb80db332e46d24b78b3e635e7..566e97f529af5f80a2dec500d91b51cbe11740ce 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-9.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-4-9 description: > Array.prototype.filter - side effects produced by step 3 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; var accessed = false; @@ -26,12 +23,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.filter.call(obj, null); - return false; - } catch (ex) { - return ex instanceof TypeError && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-30.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-30.js index 7851756f51547d1b90105287800b61838eb81412..e0381e7cdbceed48845a02a59a20530d86bca1e5 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-30.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-30.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-i-30 description: > Array.prototype.filter - unnhandled exceptions happened in getter terminate iteration on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { if (idx > 1) { @@ -26,12 +23,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(RangeError, function() { Array.prototype.filter.call(obj, callbackfn); - return false; - } catch (ex) { - return (ex instanceof RangeError) && !accessed; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-31.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-31.js index 844231c32dcaaf5f5b40a5d564106794a36e5c80..63d371c18065fae63cc505c1109d3898c2f5da12 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-31.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-31.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-i-31 description: > Array.prototype.filter - unnhandled exceptions happened in getter terminate iteration on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { if (idx > 1) { @@ -29,12 +26,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(RangeError, function() { arr.filter(callbackfn); - return false; - } catch (ex) { - return (ex instanceof RangeError) && !accessed; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-7.js index 55a30af64e76d8f9b2a2a9db3602ae4fc1b2b372..cc1b9ba757d720062468d15f72a045a9e126527b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-ii-7 description: > Array.prototype.filter - unhandled exceptions happened in callbackfn terminate iteration -includes: [runTestCase.js] ---*/ -function testcase() { - var called = 0; function callbackfn(val, idx, obj) { @@ -22,12 +19,7 @@ function testcase() { } var obj = { 0: 11, 4: 10, 10: 8, length: 20 }; - - try { +assert.throws(Error, function() { Array.prototype.filter.call(obj, callbackfn); - return false; - } catch (ex) { - return 1 === called && ex instanceof Error; - } - } -runTestCase(testcase); +}); +assert.sameValue(called, 1, 'called'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-1.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-1.js index 35bc0912017d0046400c6015f073fd4e182f28af..5df4d453a8ef7edeb4d485003ca85ff14abf1c73 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-1.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-1.js @@ -4,15 +4,9 @@ /*--- es5id: 15.4.4.18-1-1 description: Array.prototype.forEach applied to undefined -includes: [runTestCase.js] ---*/ -function testcase() { - try { + +assert.throws(TypeError, function() { Array.prototype.forEach.call(undefined); // TypeError is thrown if value is undefined - return false; - } catch (e) { - return (e instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-2.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-2.js index 1264199ae3d27be74dbbcd29afd9134b7c3eacc6..4f0d6c81dc206376671fb5819106e59ee46d36f8 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-2.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-2.js @@ -4,15 +4,9 @@ /*--- es5id: 15.4.4.18-1-2 description: Array.prototype.forEach applied to null -includes: [runTestCase.js] ---*/ -function testcase() { - try { + +assert.throws(TypeError, function() { Array.prototype.forEach.call(null); // TypeError is thrown if value is null - return false; - } catch (e) { - return (e instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-22.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-22.js index 1ee562c5a5cee3c1dd775412e507d00a605c032f..e9f68c7d5db67176ee573d3a04b25b736f346dd9 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-22.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-22.js @@ -7,11 +7,8 @@ description: > Array.prototype.forEach throws TypeError exception when 'length' is an object with toString and valueOf methods that don�t return primitive values -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var firstStepOccured = false; var secondStepOccured = false; @@ -35,12 +32,7 @@ function testcase() { } } }; - - try { +assert.throws(TypeError, function() { Array.prototype.forEach.call(obj, callbackfn); - return false; - } catch (ex) { - return ex instanceof TypeError && !accessed; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-1.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-1.js index e8d0a85c2c1641ef34becdcca91c5a0e626ca295..34eba32d8f1075d6f5559b05e014852ac4f286a9 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-1.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-1.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.18-4-1 description: Array.prototype.forEach throws TypeError if callbackfn is undefined -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.forEach(); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.forEach(); +}); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-15.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-15.js index fcb6aa5566104a589e277377b37136a4196dc79f..c3a2599bf8c879658db676dfe5f8eade61801162 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-15.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-15.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-4-15 description: > Array.prototype.forEach - calling with no callbackfn is the same as passing undefined for callbackfn -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 10: 10 }; var lengthAccessed = false; var loopAccessed = false; @@ -30,12 +27,8 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.forEach.call(obj); - return false; - } catch (ex) { - return (ex instanceof TypeError) && lengthAccessed && !loopAccessed; - } - } -runTestCase(testcase); +}); +assert(lengthAccessed, 'lengthAccessed !== true'); +assert.sameValue(loopAccessed, false, 'loopAccessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-2.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-2.js index ecf45aba3898c05950b9d917d867347c9cceeb45..08363293d4071e6f598ac17c1cfadb0194d2dae9 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-2.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-2.js @@ -6,19 +6,9 @@ es5id: 15.4.4.18-4-2 description: > Array.prototype.forEach throws ReferenceError if callbackfn is unreferenced -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.forEach(foo); - } - catch(e) { - if(e instanceof ReferenceError) - return true; - } - - } -runTestCase(testcase); +assert.throws(ReferenceError, function() { + arr.forEach(foo); +}); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-3.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-3.js index 6abd385a3503c7912a9e5e70dc1ebde0e7a2c991..8268cbf669e4428dd4bc08138a7befc0a7bcc4d0 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-3.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-3.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.18-4-3 description: Array.prototype.forEach throws TypeError if callbackfn is null -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.forEach(null); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.forEach(null); +}); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-4.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-4.js index 749e4d3a6c2237315fcffc5fec8523b47d9b9bf4..6fe301dab0283bd86c5a72d7921a75b6ee9fb0fa 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-4.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-4.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.18-4-4 description: Array.prototype.forEach throws TypeError if callbackfn is boolean -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.forEach(true); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.forEach(true); +}); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-5.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-5.js index c0cd39e86d5a9153bc187d36a457d8b2d6e17cfc..4485c4606209a886b8dbae6e448386ac07dc0b98 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-5.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-5.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.18-4-5 description: Array.prototype.forEach throws TypeError if callbackfn is number -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.forEach(5); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.forEach(5); +}); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-6.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-6.js index 60888e0007402ff108e4ef8098f098a1c0f20023..84e29d51d5ab92a8414b65da02269d45c01faf24 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-6.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-6.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.18-4-6 description: Array.prototype.forEach throws TypeError if callbackfn is string -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.forEach("abc"); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.forEach("abc"); +}); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-7.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-7.js index c397eff4e87da462f090ea49579eb10eecbcf2f4..d7ed337aef8b14b94554e4d91fe8dfbd87f09a87 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-7.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-7.js @@ -6,19 +6,9 @@ es5id: 15.4.4.18-4-7 description: > Array.prototype.forEach throws TypeError if callbackfn is Object without Call internal method -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.forEach(new Object()); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.forEach(new Object()); +}); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-8.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-8.js index a6ba2a75ecbb991d53b398deb984c8f10565a054..033029fa12c94c49a75b29c65c7d0bca69d71b82 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-8.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-4-8 description: > Array.prototype.forEach - side effects produced by step 2 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; var accessed = false; @@ -22,12 +19,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.forEach.call(obj, null); - return false; - } catch (ex) { - return ex instanceof TypeError && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-9.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-9.js index bcdf91fb1eeb996545bbdb527b29176faa5e67da..1cccf2166e15fc8f17c2edb9e72b877c7bb92015 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-9.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-9.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-4-9 description: > Array.prototype.forEach - side effects produced by step 3 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; var accessed = false; @@ -26,12 +23,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.forEach.call(obj, null); - return false; - } catch (ex) { - return ex instanceof TypeError && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-30.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-30.js index b438b56450e7193c4a781a35aa3f4bdb60a54ba7..f02c6bf67bd0f9f12c440aafd1554082e5acecfe 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-30.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-30.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-c-i-30 description: > Array.prototype.forEach - unnhandled exceptions happened in getter terminate iteration on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 5: 10, 10: 8, length: 20 }; var accessed = false; @@ -34,12 +31,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(RangeError, function() { Array.prototype.forEach.call(obj, callbackfn); - return false; - } catch (ex) { - return (ex instanceof RangeError) && !accessed; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-31.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-31.js index b32a0eb15e403a6f9e224c06d1bdfd76efe9c905..1a84121fd9ca07aa22373ca8eaf0ce4b27f5abd9 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-31.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-31.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-c-i-31 description: > Array.prototype.forEach - unnhandled exceptions happened in getter terminate iteration on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -37,12 +34,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(RangeError, function() { arr.forEach(callbackfn); - return false; - } catch (ex) { - return (ex instanceof RangeError) && !accessed; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-7.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-7.js index b56b2333eb892ea9f077222041b15ebef96df801..a7b0680c1df1edd232458b9404daaf6797eed899 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-7.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-c-ii-7 description: > Array.prototype.forEach - unhandled exceptions happened in callbackfn terminate iteration -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -23,12 +20,7 @@ function testcase() { } var obj = { 0: 11, 4: 10, 10: 8, length: 20 }; - - try { +assert.throws(Error, function() { Array.prototype.forEach.call(obj, callbackfn); - return false; - } catch (ex) { - return ex instanceof Error && !accessed; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-1.js index e91bf82c8bd32661f73ef0c9922d471c699db477..fbffd031cc8dda0f31b433e32ec990f8b10a6355 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-1.js @@ -4,16 +4,9 @@ /*--- es5id: 15.4.4.14-1-1 description: Array.prototype.indexOf applied to undefined throws a TypeError -includes: [runTestCase.js] ---*/ -function testcase() { - try { + +assert.throws(TypeError, function() { Array.prototype.indexOf.call(undefined); - return false; - } - catch (e) { - return e instanceof TypeError; - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-2.js index ed94cac5c0a45b7570aa25c4a8339140de0c3043..c1685fcb016cf6694523946cc389895affa0d119 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-2.js @@ -4,16 +4,9 @@ /*--- es5id: 15.4.4.14-1-2 description: Array.prototype.indexOf applied to null throws a TypeError -includes: [runTestCase.js] ---*/ -function testcase() { - try { + +assert.throws(TypeError, function() { Array.prototype.indexOf.call(null); - return false; - } - catch (e) { - return e instanceof TypeError; - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-28.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-28.js index b96dc3b460cba1e42b3f33ca61c8c13efb6d3c9f..3a9538711c20b19b87e85de9ceed90da70bde5d0 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-28.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-28.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-5-28 description: > Array.prototype.indexOf - side effects produced by step 1 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var stepFiveOccurs = false; var fromIndex = { valueOf: function () { @@ -18,12 +15,7 @@ function testcase() { return 0; } }; - - try { +assert.throws(TypeError, function() { Array.prototype.indexOf.call(undefined, undefined, fromIndex); - return false; - } catch (e) { - return (e instanceof TypeError) && !stepFiveOccurs; - } - } -runTestCase(testcase); +}); +assert.sameValue(stepFiveOccurs, false, 'stepFiveOccurs'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-29.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-29.js index 60c52cb088ba4d3cc034505dc0281a5e767f4443..6c4c3d7691a65431a14a6cc5a1b9819514350d77 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-29.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-29.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-5-29 description: > Array.prototype.indexOf - side effects produced by step 2 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var stepFiveOccurs = false; var obj = {}; @@ -27,12 +24,7 @@ function testcase() { return 0; } }; - - try { +assert.throws(RangeError, function() { Array.prototype.indexOf.call(obj, undefined, fromIndex); - return false; - } catch (e) { - return (e instanceof RangeError) && !stepFiveOccurs; - } - } -runTestCase(testcase); +}); +assert.sameValue(stepFiveOccurs, false, 'stepFiveOccurs'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-30.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-30.js index 3766f2ab9f0fc75e4aa57275dff6e5133effc809..7fdd12722e75e78bbcef89939fd92abc11f80202 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-30.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-30.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-5-30 description: > Array.prototype.indexOf - side effects produced by step 3 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var stepFiveOccurs = false; var obj = {}; @@ -31,12 +28,7 @@ function testcase() { return 0; } }; - - try { +assert.throws(TypeError, function() { Array.prototype.indexOf.call(obj, undefined, fromIndex); - return false; - } catch (e) { - return (e instanceof TypeError) && !stepFiveOccurs; - } - } -runTestCase(testcase); +}); +assert.sameValue(stepFiveOccurs, false, 'stepFiveOccurs'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-30.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-30.js index 00da4236642ccdc90e093d09fca78e0b86dabf3d..5d6195afbbf820b62baf1f68d54e1c38d3ed40f3 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-30.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-30.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-b-i-30 description: > Array.prototype.indexOf - terminates iteration on unhandled exception on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var arr = []; @@ -28,12 +25,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { arr.indexOf(true); - return false; - } catch (e) { - return (e instanceof TypeError) && !accessed; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-31.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-31.js index 98556ba4bd6946cd4e5ef60f97da2e5e33640481..caf9f52867df9976ec9ddcf1f5ea661b73baa744 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-31.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-31.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-b-i-31 description: > Array.prototype.indexOf - terminates iteration on unhandled exception on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var obj = { length: 2 }; @@ -28,13 +25,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.indexOf.call(obj, true); - return false; - } catch (e) { - return (e instanceof TypeError) && !accessed; - } - - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-1.js index 1a3f3404e192a5bcf672ddd10da6534b7c926d42..93d2ea6e0ba0ef1e7601a628fec0d898af6950da 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-1.js @@ -4,18 +4,9 @@ /*--- es5id: 15.4.4.15-1-1 description: Array.prototype.lastIndexOf applied to undefined throws a TypeError -includes: [runTestCase.js] ---*/ -function testcase() { - try { +assert.throws(TypeError, function() { Array.prototype.lastIndexOf.call(undefined); - return false; - } catch (e) { - if (e instanceof TypeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-2.js index 9df9406663cb1bcd020efea4929527b51a716bb0..4412bdcb621d32909dbf0d9ce6f217def575f911 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-2.js @@ -4,18 +4,9 @@ /*--- es5id: 15.4.4.15-1-2 description: Array.prototype.lastIndexOf applied to null throws a TypeError -includes: [runTestCase.js] ---*/ -function testcase() { - try { +assert.throws(TypeError, function() { Array.prototype.lastIndexOf.call(null); - return false; - } catch (e) { - if (e instanceof TypeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-28.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-28.js index e7d3c3b17e22655d88c2e4173bb4e60bf5e944c0..8ea3d806382b35103b13567c65c3157d9694a0eb 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-28.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-28.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-5-28 description: > Array.prototype.lastIndexOf - side effects produced by step 1 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var stepFiveOccurs = false; var fromIndex = { valueOf: function () { @@ -18,12 +15,7 @@ function testcase() { return 0; } }; - - try { +assert.throws(TypeError, function() { Array.prototype.lastIndexOf.call(undefined, undefined, fromIndex); - return false; - } catch (e) { - return (e instanceof TypeError) && !stepFiveOccurs; - } - } -runTestCase(testcase); +}); +assert.sameValue(stepFiveOccurs, false, 'stepFiveOccurs'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-29.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-29.js index 4da7075f424f14dea75eafdbbaecf762e9df7f65..a5f477b4745d5de9ab522ff50d896666e3d2fc6e 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-29.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-29.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-5-29 description: > Array.prototype.lastIndexOf - side effects produced by step 2 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var stepFiveOccurs = false; var obj = {}; @@ -27,12 +24,7 @@ function testcase() { return 0; } }; - - try { +assert.throws(RangeError, function() { Array.prototype.lastIndexOf.call(obj, undefined, fromIndex); - return false; - } catch (e) { - return (e instanceof RangeError) && !stepFiveOccurs; - } - } -runTestCase(testcase); +}); +assert.sameValue(stepFiveOccurs, false, 'stepFiveOccurs'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-30.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-30.js index 44e7ce2fdb732b4c94285788168acd13d60c6d73..b462cde0978258cce9f3b868960ed53a58799b66 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-30.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-30.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-5-30 description: > Array.prototype.lastIndexOf - side effects produced by step 3 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var stepFiveOccurs = false; var obj = {}; @@ -31,12 +28,7 @@ function testcase() { return 0; } }; - - try { +assert.throws(TypeError, function() { Array.prototype.lastIndexOf.call(obj, undefined, fromIndex); - return false; - } catch (e) { - return (e instanceof TypeError) && !stepFiveOccurs; - } - } -runTestCase(testcase); +}); +assert.sameValue(stepFiveOccurs, false, 'stepFiveOccurs'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-30.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-30.js index fb4bf57019d6e6d959fa1f819dee8196f2106404..9e85224f09ee9f5046be136a6aa7d36d96439341 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-30.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-30.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-b-i-30 description: > Array.prototype.lastIndexOf terminates iteration on unhandled exception on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var arr = []; @@ -28,13 +25,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { arr.lastIndexOf(true); - return false; - } catch (e) { - return (e instanceof TypeError) && !accessed; - } - - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-31.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-31.js index e06ce36e03d934eb290de4d1ace8894f489d6225..755d7de15fd9dca55910aa84996b0b8f5585af1e 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-31.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-31.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-b-i-31 description: > Array.prototype.lastIndexOf terminates iteration on unhandled exception on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var obj = { length: 3 }; @@ -28,13 +25,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.lastIndexOf.call(obj, true); - return false; - } catch (e) { - return (e instanceof TypeError) && !accessed; - } - - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-1.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-1.js index ec66e5a6657c7546c06a300f1db93355f09b0ece..c06be0e03f13f9c7d31f910209b412488da2897b 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-1.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-1.js @@ -4,15 +4,9 @@ /*--- es5id: 15.4.4.19-1-1 description: Array.prototype.map - applied to undefined -includes: [runTestCase.js] ---*/ -function testcase() { - try { + +assert.throws(TypeError, function() { Array.prototype.map.call(undefined); // TypeError is thrown if value is undefined - return false; - } catch (e) { - return (e instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-2.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-2.js index eb819c4dbacae6721da7ea6f516a7ae5f1451db8..4d946c98bcd172fd7f51b1a6629d9b2b0bd7bbb8 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-2.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-2.js @@ -4,15 +4,9 @@ /*--- es5id: 15.4.4.19-1-2 description: Array.prototype.map - applied to null -includes: [runTestCase.js] ---*/ -function testcase() { - try { + +assert.throws(TypeError, function() { Array.prototype.map.call(null); // TypeError is thrown if value is null - return false; - } catch (e) { - return (e instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-14.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-14.js index 0e10ba1e1e2dbb0176be07f20ebad5941671190f..de00b86d0e9dda604ba3a6bcbaccbca78206bd3b 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-14.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-14.js @@ -4,22 +4,13 @@ /*--- es5id: 15.4.4.19-3-14 description: Array.prototype.map - 'length' is a string containing Infinity -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return val < 10; } var obj = { 0: 9, length: "Infinity" }; - - try { +assert.throws(RangeError, function() { Array.prototype.map.call(obj, callbackfn); - } catch (e) { - if (e instanceof RangeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-22.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-22.js index 06b009cf2335a36d3f8b8f6f842c70c658c428e0..7dcdcc31e7de71ce48c7175274e3e43fe61fd8d9 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-22.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-22.js @@ -7,11 +7,8 @@ description: > Array.prototype.map throws TypeError exception when 'length' is an object with toString and valueOf methods that don�t return primitive values -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return val > 10; } @@ -29,12 +26,6 @@ function testcase() { } } }; - - try { +assert.throws(TypeError, function() { Array.prototype.map.call(obj, callbackfn); - return false; - } catch (ex) { - return ex instanceof TypeError; - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-28.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-28.js index 7fe0d865f409bde3e4b97118f19a52a4f2b1ce67..25f868e3e8a976a00254c7d7cefc0dc83ccefe34 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-28.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-28.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.19-3-28 description: Array.prototype.map - value of 'length' is boundary value (2^32) -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return val > 10; } @@ -17,13 +14,6 @@ function testcase() { 0: 12, length: 4294967296 }; - - try { +assert.throws(RangeError, function() { var newArr = Array.prototype.map.call(obj, callbackfn); - } catch (e) { - if (e instanceof RangeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-29.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-29.js index 8e4d501067dff49d22010e6c600da52204ac6397..45b72bbe1490b1d2445ca4191a1fed9b230e5364 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-29.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-29.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-3-29 description: > Array.prototype.map - value of 'length' is boundary value (2^32 + 1) -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return val > 10; } @@ -20,13 +17,6 @@ function testcase() { 1: 9, length: 4294967297 }; - - try { +assert.throws(RangeError, function() { var newArr = Array.prototype.map.call(obj, callbackfn); - } catch (e) { - if (e instanceof RangeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-8.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-8.js index f4ee0e4258392c629bea535a2a7d5c4d54b42577..5129e06e2cb8d7577eba40a2e673b1e299466db4 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-8.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-8.js @@ -6,22 +6,13 @@ es5id: 15.4.4.19-3-8 description: > Array.prototype.map - value of 'length' is a number (value is Infinity) -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return val < 10; } var obj = { 0: 9, length: Infinity }; - - try { +assert.throws(RangeError, function() { Array.prototype.map.call(obj, callbackfn); - } catch (e) { - if (e instanceof RangeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-4-1.js b/test/built-ins/Array/prototype/map/15.4.4.19-4-1.js index 27a87abfe536777bf1b5a62a8294ce5bd1e65aac..e1bbc378dcd287bce28dd6e8fd04dead6a0a6335 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-4-1.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-4-1.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.19-4-1 description: Array.prototype.map throws TypeError if callbackfn is undefined -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.map(); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.map(); +}); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-4-15.js b/test/built-ins/Array/prototype/map/15.4.4.19-4-15.js index 8f7efc8390dde4b06e538e70559fb8b7c7d81b20..cba95c17c13d5ded85807f27402297d21ae18948 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-4-15.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-4-15.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-4-15 description: > Array.prototype.map - calling with no callbackfn is the same as passing undefined for callbackfn -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 10: 10 }; var lengthAccessed = false; var loopAccessed = false; @@ -29,12 +26,8 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.map.call(obj); - return false; - } catch (e) { - return e instanceof TypeError && lengthAccessed && !loopAccessed; - } - } -runTestCase(testcase); +}); +assert(lengthAccessed, 'lengthAccessed !== true'); +assert.sameValue(loopAccessed, false, 'loopAccessed'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-4-2.js b/test/built-ins/Array/prototype/map/15.4.4.19-4-2.js index 24fe85ead0ed08cbf7c57aade537cb8f10ca4e08..0b0b2becfe78cdeb4d721001218f1d9b0b2b2e3d 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-4-2.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-4-2.js @@ -6,19 +6,9 @@ es5id: 15.4.4.19-4-2 description: > Array.prototype.map throws ReferenceError if callbackfn is unreferenced -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.map(foo); - } - catch(e) { - if(e instanceof ReferenceError) - return true; - } - - } -runTestCase(testcase); +assert.throws(ReferenceError, function() { + arr.map(foo); +}); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-4-3.js b/test/built-ins/Array/prototype/map/15.4.4.19-4-3.js index ff3ead687b9a01ee574f53d3dfbdc245f9dc1b4e..0cb7b7c31ba4a80971a814da690f128c51f449c2 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-4-3.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-4-3.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.19-4-3 description: Array.prototype.map throws TypeError if callbackfn is null -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.map(null); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.map(null); +}); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-4-4.js b/test/built-ins/Array/prototype/map/15.4.4.19-4-4.js index 7d88c6569208dfd2484f36a93a9222a43f2d6ea7..ed53e5efae9f2026b875606853877e1c0e87391e 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-4-4.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-4-4.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.19-4-4 description: Array.prototype.map throws TypeError if callbackfn is boolean -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.map(true); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.map(true); +}); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-4-5.js b/test/built-ins/Array/prototype/map/15.4.4.19-4-5.js index 9b0359ac7a43654d440dcd1fd01c43bd0db6a267..fbbbb83a610351bb89e4829e7da2671d2f9ccaa2 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-4-5.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-4-5.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.19-4-5 description: Array.prototype.map throws TypeError if callbackfn is number -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.map(5); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.map(5); +}); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-4-6.js b/test/built-ins/Array/prototype/map/15.4.4.19-4-6.js index 122f87774de48e987d0c71d3a70528231e7756f0..ac6eea9241420555ef44b9234e02c18128296631 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-4-6.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-4-6.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.19-4-6 description: Array.prototype.map throws TypeError if callbackfn is string -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.map("abc"); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.map("abc"); +}); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-4-7.js b/test/built-ins/Array/prototype/map/15.4.4.19-4-7.js index 14b11b713590d174554b82c2baf99822a7dafdf5..172a1905e0b3d2b92dbdb58ce46f875576c4a2ce 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-4-7.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-4-7.js @@ -6,19 +6,9 @@ es5id: 15.4.4.19-4-7 description: > Array.prototype.map throws TypeError if callbackfn is Object without Call internal method -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.map(new Object()); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.map(new Object()); +}); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-4-8.js b/test/built-ins/Array/prototype/map/15.4.4.19-4-8.js index ace649ef6bc14167715cd7107ce44212c0bde524..de3eaa35341fee501c32e75cf26a92cff74c9e90 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-4-8.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-4-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-4-8 description: > Array.prototype.map - Side effects produced by step 2 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; var accessed = false; @@ -22,12 +19,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.map.call(obj, null); - return false; - } catch (ex) { - return ex instanceof TypeError && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-4-9.js b/test/built-ins/Array/prototype/map/15.4.4.19-4-9.js index 4c025972f59c29aa9cc4231ec7322fdc850116f0..89358e9134664ea781ca9e8d90269b9b0f3c30b4 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-4-9.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-4-9.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-4-9 description: > Array.prototype.map - Side effects produced by step 3 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; var accessed = false; @@ -26,12 +23,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.map.call(obj, null); - return false; - } catch (ex) { - return ex instanceof TypeError && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-30.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-30.js index 064f3db60bd351b4e261cb41918750ae737bd834..195ddd7868638a696826737e5d16b923a2b9fa5f 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-30.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-30.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-30 description: > Array.prototype.map - unhandled exceptions happened in getter terminate iteration on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 5: 10, 10: 8, length: 20 }; var accessed = false; @@ -34,12 +31,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(RangeError, function() { Array.prototype.map.call(obj, callbackfn); - return false; - } catch (ex) { - return (ex instanceof RangeError) && !accessed; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-31.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-31.js index 04798223e6ebe33a939402fce54be843b8950378..b96cb232ecf0ec1df36071bd74b7468b10ea471f 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-31.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-31.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-31 description: > Array.prototype.map - unhandled exceptions happened in getter terminate iteration on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -37,12 +34,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(RangeError, function() { arr.map(callbackfn); - return false; - } catch (ex) { - return (ex instanceof RangeError) && !accessed; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-7.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-7.js index 8045f4f6f205034992fc6f1e96cfa1efb83a3a0e..a31f9e41d4164c40f6c5d66e54dc0d082c0747fc 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-7.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-ii-7 description: > Array.prototype.map - unhandled exceptions happened in callbackfn terminate iteration -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -23,12 +20,7 @@ function testcase() { } var obj = { 0: 11, 4: 10, 10: 8, length: 20 }; - - try { +assert.throws(Error, function() { Array.prototype.map.call(obj, callbackfn); - return false; - } catch (ex) { - return ex instanceof Error && !accessed; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-1.js index 40c2913349e358f7931b09c6ba9fee6531480c0e..04fd4e8970034ab19bcdf69c0f690e04a529ce6b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-1.js @@ -4,15 +4,9 @@ /*--- es5id: 15.4.4.21-1-1 description: Array.prototype.reduce applied to undefined -includes: [runTestCase.js] ---*/ -function testcase() { - try { - Array.prototype.reduce.call(undefined); - return false; - } catch (e) { - return (e instanceof TypeError); - } - } -runTestCase(testcase); + +assert.throws(TypeError, function() { + Array.prototype.reduce.call(undefined); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-2.js index ace5be9614663da7626c9365400d4da9d2d74ce9..96adb146d8a16703e6d4ccaed077bed467cef2ca 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-2.js @@ -4,15 +4,9 @@ /*--- es5id: 15.4.4.21-1-2 description: Array.prototype.reduce applied to null -includes: [runTestCase.js] ---*/ -function testcase() { - try { + +assert.throws(TypeError, function() { Array.prototype.reduce.call(null); - return false; - } catch (e) { - return (e instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-22.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-22.js index bcfe3363515ab8d9f7a3af3a0185504ea616f689..9b18e0cfd68cb571bbb89f16a70710e49b823010 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-22.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-22.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce throws TypeError exception - 'length' is an object with toString and valueOf methods that don�t return primitive values -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var valueOfAccessed = false; var toStringAccessed = false; @@ -36,12 +33,9 @@ function testcase() { } } }; - - try { +assert.throws(TypeError, function() { Array.prototype.reduce.call(obj, callbackfn, 1); - return false; - } catch (ex) { - return (ex instanceof TypeError) && !accessed && toStringAccessed && valueOfAccessed; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); +assert(toStringAccessed, 'toStringAccessed !== true'); +assert(valueOfAccessed, 'valueOfAccessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-1.js index b099fcc0d686906360a004701dee04ce741003df..897c504d24b4a0afadf4e60b9015e40191b7cfc5 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-1.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.21-4-1 description: Array.prototype.reduce throws TypeError if callbackfn is undefined -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.reduce(); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.reduce(); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-15.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-15.js index 5c7136a4b4fe0afdf301974ca3da917122b95274..c62a892d146a4d0159dbf6163b66b844376e0fb9 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-15.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-15.js @@ -6,10 +6,8 @@ es5id: 15.4.4.21-4-15 description: > Array.prototype.reduce - calling with no callbackfn is the same as passing undefined for callbackfn -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { 10: 10 }; var lengthAccessed = false; var loopAccessed = false; @@ -29,12 +27,8 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.reduce.call(obj); - return false; - } catch (ex) { - return (ex instanceof TypeError) && lengthAccessed && !loopAccessed; - } - } -runTestCase(testcase); +}); +assert(lengthAccessed, 'lengthAccessed !== true'); +assert.sameValue(loopAccessed, false, 'loopAccessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-2.js index 6c08442d56a7b9809c575e43d07615d66e11e77c..53acc464e5def61cfbfc2f67a8f73cca96959646 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-2.js @@ -6,19 +6,9 @@ es5id: 15.4.4.21-4-2 description: > Array.prototype.reduce throws ReferenceError if callbackfn is unreferenced -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.reduce(foo); - } - catch(e) { - if(e instanceof ReferenceError) - return true; - } - - } -runTestCase(testcase); +assert.throws(ReferenceError, function() { + arr.reduce(foo); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-3.js index f3c7794fb28bfe4091986e6c6cfcc05b9c373a09..342be4a5f9b10fdc57108fe92d52cedb34e3503b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-3.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.21-4-3 description: Array.prototype.reduce throws TypeError if callbackfn is null -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.reduce(null); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.reduce(null); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-4.js index 749e752030ce9df8593dbd7974a1b5d79ee25674..d5777b17d2a3f4c5ec4cae357b00af257624ab9c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-4.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.21-4-4 description: Array.prototype.reduce throws TypeError if callbackfn is boolean -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.reduce(true); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.reduce(true); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-5.js index 76dd875b8c036508c8ae4f0b1cef244233e53e1f..cb4a091174aef47581974b3ad7fe1652b186bb4f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-5.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.21-4-5 description: Array.prototype.reduce throws TypeError if callbackfn is number -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.reduce(5); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.reduce(5); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-6.js index 957fe82de1b75b584a7cf19e886e03293177e02b..42faa62ecd4fbfb840cbdc884d6fa9b6c42a620a 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-6.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.21-4-6 description: Array.prototype.reduce throws TypeError if callbackfn is string -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.reduce("abc"); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.reduce("abc"); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-7.js index 0743e19b56a990a6a345cbf7aa9d44687d4ea913..5d08f90adf8c7e514bfd6bba7da32fa8636f6308 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-7.js @@ -6,19 +6,9 @@ es5id: 15.4.4.21-4-7 description: > Array.prototype.reduce throws TypeError if callbackfn is Object without [[Call]] internal method -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.reduce(new Object()); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.reduce(new Object()); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-8.js index f545412dcaa90b9ecffb44fdaadbc12d4bbf0a86..df7a1112c312924b4bb3e85ce8c63584b3a2a769 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-4-8 description: > Array.prototype.reduce - side effects produced by step 2 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; var accessed = false; @@ -22,12 +19,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.reduce.call(obj, null); - return false; - } catch (ex) { - return ex instanceof TypeError && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-9.js index bbed561102f55facbea78135287e179b6d082e23..ea580455ea5ab0540ba4588cfb066dc2fde30d7b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-9.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-4-9 description: > Array.prototype.reduce - side effects produced by step 3 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; var accessed = false; @@ -26,12 +23,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.reduce.call(obj, null); - return false; - } catch (ex) { - return ex instanceof TypeError && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-1.js index 6b7844e29d36119523d600620e2b31b94afb1282..a225b4dedd119841641090d724edb41e7ece18a5 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-1.js @@ -6,19 +6,9 @@ es5id: 15.4.4.21-5-1 description: > Array.prototype.reduce throws TypeError if 'length' is 0 (empty array), no initVal -includes: [runTestCase.js] ---*/ -function testcase() { function cb(){} - - try { +assert.throws(TypeError, function() { [].reduce(cb); - } - catch (e) { - if (e instanceof TypeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-10.js index 7344df34c77c768b8d8695d0741b0e81c6de93f0..8f5cb86b87a7e2094165b9d2c7e68840d54f44da 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-10.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-5-10 description: > Array.prototype.reduce - if exception occurs, it occurs after any side-effects that might be produced by step 2 -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (curVal > 10); } @@ -26,12 +23,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.reduce.call(obj, callbackfn); - return false; - } catch (ex) { - return (ex instanceof TypeError) && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-11.js index 3291875d4b02becb6f995d6b65a61e3b8ad9d660..e7d20c8f465fa5ead02c18c4296689de6bc67a72 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-11.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-5-11 description: > Array.prototype.reduce - if the exception occurs, it occurs after any side-effects that might be produced by step 3 -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (curVal > 10); } @@ -30,12 +27,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.reduce.call(obj, callbackfn); - return false; - } catch (ex) { - return (ex instanceof TypeError) && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-2.js index e8b316cced9214f571d6ede23b5feaac1eb8faae..bd1728cbdbc015eff3db98c91c18af736c6ec7d5 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-2.js @@ -7,23 +7,14 @@ description: > Array.prototype.reduce throws TypeError if 'length' is 0 (subclassed Array, length overridden to null (type conversion)), no initVal -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = null; function cb(){} - try { +assert.throws(TypeError, function() { f.reduce(cb); - } - catch (e) { - if (e instanceof TypeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-3.js index 1aedd2b36ed0e80739e94078f6a4c01dc9fe48dd..66ca0f4f066f879a778d034bb4a6b81eb8e037bc 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-3.js @@ -7,23 +7,14 @@ description: > Array.prototype.reduce throws TypeError if 'length' is 0 (subclassed Array, length overridden to false (type conversion)), no initVal -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = false; function cb(){} - try { +assert.throws(TypeError, function() { f.reduce(cb); - } - catch (e) { - if (e instanceof TypeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-4.js index af9efc8875eecadf517cc9f44e12a71e5d87a5cf..345b5f8d02062c678581ecaebce61e9fc3701e77 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-4.js @@ -7,23 +7,14 @@ description: > Array.prototype.reduce throws TypeError if 'length' is 0 (subclassed Array, length overridden to 0 (type conversion)), no initVal -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = 0; function cb(){} - try { +assert.throws(TypeError, function() { f.reduce(cb); - } - catch (e) { - if (e instanceof TypeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-5.js index 0a62ef2310adc4bd65e7bef2a802aa655f168840..18531bd0f9d35d4bb4eba0ed4cc4d494ea6a8b6b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-5.js @@ -7,23 +7,14 @@ description: > Array.prototype.reduce throws TypeError if 'length' is 0 (subclassed Array, length overridden to '0' (type conversion)), no initVal -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = '0'; function cb(){} - try { +assert.throws(TypeError, function() { f.reduce(cb); - } - catch (e) { - if (e instanceof TypeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-6.js index 2aeb7827a85283a0cfc6a20ed03b01a505003a29..b59332ca54f1ac159bf8d18dc7990679c0c4e2bf 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-6.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduce throws TypeError if 'length' is 0 (subclassed Array, length overridden with obj with valueOf), no initVal -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -19,13 +17,6 @@ function testcase() { f.length = o; function cb(){} - try { +assert.throws(TypeError, function() { f.reduce(cb); - } - catch (e) { - if (e instanceof TypeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-7.js index 04abec388346c104c6b47b644db2fb0b283aca1e..e2819a73efa7ca83f23f4d8aaf5a402496ca5b5f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-7.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduce throws TypeError if 'length' is 0 (subclassed Array, length overridden with obj w/o valueOf (toString)), no initVal -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -25,13 +23,6 @@ function testcase() { // resulting string to a number. function cb(){} - try { +assert.throws(TypeError, function() { f.reduce(cb); - } - catch (e) { - if (e instanceof TypeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-8.js index 989d4001317caad6e07bda09f139e87187e59bf8..ef30e6bb8d100c9f5706699939cf83dbe92bdda9 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-8.js @@ -6,10 +6,8 @@ es5id: 15.4.4.21-5-8 description: > Array.prototype.reduce throws TypeError if 'length' is 0 (subclassed Array, length overridden with []), no initVal -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -31,13 +29,6 @@ function testcase() { // or if its one element is not a number, the array converts to NaN. function cb(){} - try { +assert.throws(TypeError, function() { f.reduce(cb); - } - catch (e) { - if (e instanceof TypeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-32.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-32.js index fd139b89d5b1a102377cd8797675a44f400a2d0c..3cc60dd9662b5f049c62b60fc3e3f74dd14e7287 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-32.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-32.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-32 description: > Array.prototype.reduce - exception in getter terminates iteration on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -27,12 +24,8 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(RangeError, function() { Array.prototype.reduce.call(obj, callbackfn); - return false; - } catch (ex) { - return (ex instanceof RangeError) && !accessed && !testResult; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); +assert.sameValue(testResult, false, 'testResult'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-33.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-33.js index c56d04a1383a9f118a5ff8017d7d6fa746a30e26..7895d2c6c1f6c552a7829c6954c4079c0acb89f7 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-33.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-33.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-33 description: > Array.prototype.reduce - exception in getter terminates iteration on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -28,12 +25,8 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(RangeError, function() { arr.reduce(callbackfn); - return false; - } catch (ex) { - return (ex instanceof RangeError) && !accessed && !testResult; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); +assert.sameValue(testResult, false, 'testResult'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-1.js index ed1114228f34867255a09f211ab534ca1e2a1bd1..4584c5c90ca410545f4ae29ca5c94bfc9099749e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-1.js @@ -6,22 +6,13 @@ es5id: 15.4.4.21-8-c-1 description: > Array.prototype.reduce throws TypeError when Array is empty and initialValue is not present -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { } var arr = new Array(10); - try { +assert.throws(TypeError, function() { arr.reduce(callbackfn); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-2.js index 5e71bc183e5e2ef298093978f3ab286ca461feaa..7f7a22647346403737ce639578299977a763cee8 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-2.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce throws TypeError when elements assigned values are deleted by reducing array length and initialValue is not present -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { } @@ -19,12 +16,6 @@ function testcase() { var arr = new Array(10); arr[9] = 1; arr.length = 5; - try { +assert.throws(TypeError, function() { arr.reduce(callbackfn); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-3.js index e9cee5f628cc2423f1b88a88edfdd440d7e1eb13..200edf42e7c765dc92488b14fcddaee1a6122946 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-3.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-c-3 description: > Array.prototype.reduce throws TypeError when elements assigned values are deleted and initialValue is not present -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { } @@ -21,12 +18,6 @@ function testcase() { delete arr[2]; delete arr[3]; delete arr[4]; - try { +assert.throws(TypeError, function() { arr.reduce(callbackfn); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-5.js index 91c8258f8b5d1d9f1dd1358ea59b0f2c6dec0819..159c6eeb2f215a44e0225c48e7e509f8bf7cbf8b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-5.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-c-5 description: > Array.prototype.reduce - if exception occurs, it occurs after any side-effects that might be produced by step 2 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { }; var accessed = false; @@ -22,12 +19,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.reduce.call(obj, function () { }); - return false; - } catch (ex) { - return (ex instanceof TypeError) && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-6.js index 1d2a6bc3a098a532e00d6cf510c7c14c715e9b8d..428ef5a9dd84d16d06fbc7462d84d8cd5ce48364 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-c-6 description: > Array.prototype.reduce - if exception occurs, it occurs after any side-effects that might be produced by step 3 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; var accessed = false; @@ -26,12 +23,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.reduce.call(obj, function () { }); - return false; - } catch (ex) { - return (ex instanceof TypeError) && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-32.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-32.js index 3fd275289ab6d0216004d206ba5e29ab008f5183..64efa4e1a210ec4d7371d70ba374a8d18dd000f8 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-32.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-32.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-32 description: > Array.prototype.reduce - unnhandled exceptions happened in getter terminate iteration on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = false; var initialValue = 0; @@ -28,12 +25,8 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(RangeError, function() { Array.prototype.reduce.call(obj, callbackfn, initialValue); - return false; - } catch (ex) { - return (ex instanceof RangeError) && !accessed && !testResult; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); +assert.sameValue(testResult, false, 'testResult'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-33.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-33.js index f6e29e85ec5e7eac591f2c61e8138fd19a14b5b0..8fe9d99a49ebada60ea0a66b65431129444a2891 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-33.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-33.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-33 description: > Array.prototype.reduce - unnhandled exceptions happened in getter terminate iteration on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = false; var initialValue = 0; @@ -29,12 +26,8 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(RangeError, function() { arr.reduce(callbackfn, initialValue); - return false; - } catch (ex) { - return (ex instanceof RangeError) && !accessed && !testResult; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); +assert.sameValue(testResult, false, 'testResult'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-7.js index 41b136b6f847988ce9db5bd7b357eb0ab11acd94..1fb2015bb9030e60a9b1534fce38d3acff2e1a82 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-ii-7 description: > Array.prototype.reduce - unhandled exceptions happened in callbackfn terminate iteration -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -23,12 +20,7 @@ function testcase() { } var obj = { 0: 11, 4: 10, 10: 8, length: 20 }; - - try { +assert.throws(Error, function() { Array.prototype.reduce.call(obj, callbackfn, 1); - return false; - } catch (ex) { - return (ex instanceof Error) && !accessed; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-1.js index da9fe53abf932cb842cf47e31fd4b09d9abe9242..d1758340ce56a0e2b85af27c71987366ffd503ba 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-1.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-1.js @@ -4,15 +4,9 @@ /*--- es5id: 15.4.4.22-1-1 description: Array.prototype.reduceRight applied to undefined throws a TypeError -includes: [runTestCase.js] ---*/ -function testcase() { - try { - Array.prototype.reduceRight.call(undefined); - return false; - } catch (e) { - return (e instanceof TypeError); - } - } -runTestCase(testcase); + +assert.throws(TypeError, function() { + Array.prototype.reduceRight.call(undefined); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-2.js index 7ab29703b2187f69115182f4abf9c2b24f13eed8..dc4b68dc02adae7e34dc3c1286c20052c0f14b4a 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-2.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-2.js @@ -4,15 +4,9 @@ /*--- es5id: 15.4.4.22-1-2 description: Array.prototype.reduceRight applied to null throws a TypeError -includes: [runTestCase.js] ---*/ -function testcase() { - try { + +assert.throws(TypeError, function() { Array.prototype.reduceRight.call(null); - return false; - } catch (e) { - return (e instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-22.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-22.js index 90da420a017bff4e33c9774e0b9e4d9cf69f6f7d..099ba3179f8bd90d7f73631a7d5e523f9de33df8 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-22.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-22.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight throws TypeError exception when 'length' is an object with toString and valueOf methods that don�t return primitive values -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var toStringAccessed = false; var valueOfAccessed = false; @@ -35,12 +32,9 @@ function testcase() { } } }; - - try { +assert.throws(TypeError, function() { Array.prototype.reduceRight.call(obj, callbackfn, 1); - return false; - } catch (ex) { - return (ex instanceof TypeError) && toStringAccessed && valueOfAccessed && !accessed; - } - } -runTestCase(testcase); +}); +assert(toStringAccessed, 'toStringAccessed !== true'); +assert(valueOfAccessed, 'valueOfAccessed !== true'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-1.js index 19549a18b27a6ea2e8ff368b75790f3eb3af5e7b..24c12f6b25ef82e88f16c8975e9168628d7c9252 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-1.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-1.js @@ -6,19 +6,9 @@ es5id: 15.4.4.22-4-1 description: > Array.prototype.reduceRight throws TypeError if callbackfn is undefined -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.reduceRight(); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.reduceRight(); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-15.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-15.js index ca9408b6566d86d94e0ff111fea082879670ed82..8b1d2258e3f29d2230b0a1bd3c7d971361fe615d 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-15.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-15.js @@ -6,10 +6,8 @@ es5id: 15.4.4.22-4-15 description: > Array.prototype.reduceRight - calling with no callbackfn is the same as passing undefined for callbackfn -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { 10: 10 }; var lengthAccessed = false; var loopAccessed = false; @@ -28,12 +26,8 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.reduceRight.call(obj, undefined); - return false; - } catch (ex) { - return (ex instanceof TypeError) && lengthAccessed && !loopAccessed; - } - } -runTestCase(testcase); +}); +assert(lengthAccessed, 'lengthAccessed !== true'); +assert.sameValue(loopAccessed, false, 'loopAccessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-2.js index 1df28dfc2560c0a58a5ae5e04bb20bbcdfafe00f..122b79f2feeb9ae90c364f816564f163948f175a 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-2.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-2.js @@ -6,19 +6,9 @@ es5id: 15.4.4.22-4-2 description: > Array.prototype.reduceRight throws ReferenceError if callbackfn is unreferenced -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.reduceRight(foo); - } - catch(e) { - if(e instanceof ReferenceError) - return true; - } - - } -runTestCase(testcase); +assert.throws(ReferenceError, function() { + arr.reduceRight(foo); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-3.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-3.js index dbc1b245f1f1daa9d386b972a770d3f158c4bc00..fc052eeff2d394ef3b68c57dd054559574065fab 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-3.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-3.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.22-4-3 description: Array.prototype.reduceRight throws TypeError if callbackfn is null -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.reduceRight(null); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.reduceRight(null); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-4.js index bce7673863509bbacf00ef0fb3c1739f20572cfc..400b1818bbb64d9c444991937000409b5642fab1 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-4.js @@ -6,19 +6,9 @@ es5id: 15.4.4.22-4-4 description: > Array.prototype.reduceRight throws TypeError if callbackfn is boolean -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.reduceRight(true); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.reduceRight(true); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-5.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-5.js index 98b3424c6c76ed104cba1a889eb1f4dda6fd1677..faef31545059068e27c46e145f1260bbb175eb48 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-5.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-5.js @@ -6,19 +6,9 @@ es5id: 15.4.4.22-4-5 description: > Array.prototype.reduceRight throws TypeError if callbackfn is number -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.reduceRight(5); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.reduceRight(5); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-6.js index e84b73a338ef041e23b129bfaaec3bcf9e0b2644..47db3f93c12aad1b95556e4974622e104a053abe 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-6.js @@ -6,19 +6,9 @@ es5id: 15.4.4.22-4-6 description: > Array.prototype.reduceRight throws TypeError if callbackfn is string -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.reduceRight("abc"); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.reduceRight("abc"); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-7.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-7.js index 9d50aec4f3845abf3477ce5c51572e0b9dbc4daf..20e82d8e3148d313578b559eda19f3c77c46c2d3 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-7.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-7.js @@ -6,19 +6,9 @@ es5id: 15.4.4.22-4-7 description: > Array.prototype.reduceRight throws TypeError if callbackfn is Object without [[Call]] internal method -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.reduceRight(new Object()); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.reduceRight(new Object()); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-8.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-8.js index 91998eb295ed779e9c27b95c041553dd4c2fc735..f75b594b7ee7d0ce85da4f5ae790aec261f44d8e 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-8.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-4-8 description: > Array.prototype.reduceRight - side effects produced by step 2 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; var accessed = false; @@ -22,12 +19,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.reduceRight.call(obj, null); - return false; - } catch (ex) { - return ex instanceof TypeError && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-9.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-9.js index 61dd66012b0362445aa936369c082836c74e3065..888955880c81f65e40f04a5f486801661bfa8a07 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-9.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-9.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-4-9 description: > Array.prototype.reduceRight - side effects produced by step 3 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; var accessed = false; @@ -26,12 +23,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.reduceRight.call(obj, null); - return false; - } catch (ex) { - return ex instanceof TypeError && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-1.js index 0a780ca053e4523ad53eb52d257e9008da0d6a26..ca0e2cb24db4803cfb0301df41780299a309b19b 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-1.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-1.js @@ -6,19 +6,9 @@ es5id: 15.4.4.22-5-1 description: > Array.prototype.reduceRight throws TypeError if 'length' is 0 (empty array), no initVal -includes: [runTestCase.js] ---*/ -function testcase() { function cb(){} - - try { +assert.throws(TypeError, function() { [].reduceRight(cb); - } - catch (e) { - if (e instanceof TypeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-10.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-10.js index 16796f441c2343c8934f4ef7033865967aa77e98..a82ade379b356dd7dc40911c7f902cb0189a665d 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-10.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-10.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-5-10 description: > Array.prototype.reduceRight - side-effects produced by step 2 when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; var accessed = false; @@ -22,12 +19,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.reduceRight.call(obj, function () { }); - return false; - } catch (ex) { - return (ex instanceof TypeError) && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-11.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-11.js index 6f02fd445cb5a62743e8837fede983bbed81cbcd..14c8e99a0fbac6d4bd369bedb2b056c58f75d08f 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-11.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-11.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-5-11 description: > Array.prototype.reduceRight - side-effects produced by step 3 when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; var accessed = false; @@ -26,12 +23,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.reduceRight.call(obj, function () { }); - return false; - } catch (ex) { - return (ex instanceof TypeError) && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-2.js index ba4e1a403fcaa4f4507e0d110bfbdf5f5fd9e989..b930b7a4c0f712f09e3393efecdc0b5491054ba6 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-2.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-2.js @@ -7,23 +7,14 @@ description: > Array.prototype.reduceRight throws TypeError if 'length' is 0 (subclassed Array, length overridden to null (type conversion)), no initVal -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = null; function cb(){} - try { +assert.throws(TypeError, function() { f.reduceRight(cb); - } - catch (e) { - if (e instanceof TypeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-3.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-3.js index b80ff5dc72f76f22643172e5e970a0e37f8704bd..c04b1ae4f4bc7817ea7c062e5c338d41b33bf87d 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-3.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-3.js @@ -7,23 +7,14 @@ description: > Array.prototype.reduceRight throws TypeError if 'length' is 0 (subclassed Array, length overridden to false (type conversion)), no initVal -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = false; function cb(){} - try { +assert.throws(TypeError, function() { f.reduceRight(cb); - } - catch (e) { - if (e instanceof TypeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-4.js index 444232ec5dece33dbcefe04cff42058bf2fcbdb8..1f9553b7a6494ffecc63c9b20f78e7f216cb4c9c 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-4.js @@ -7,23 +7,14 @@ description: > Array.prototype.reduceRight throws TypeError if 'length' is 0 (subclassed Array, length overridden to 0 (type conversion)), no initVal -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = 0; function cb(){} - try { +assert.throws(TypeError, function() { f.reduceRight(cb); - } - catch (e) { - if (e instanceof TypeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-5.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-5.js index 72f23a1d18ffd1f2da3a9efa57db060d68af6fb6..d0e54cdb75e48ea9926687f9e43d6526a0697561 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-5.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-5.js @@ -7,23 +7,14 @@ description: > Array.prototype.reduceRight throws TypeError if 'length' is 0 (subclassed Array, length overridden to '0' (type conversion)), no initVal -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = '0'; function cb(){} - try { +assert.throws(TypeError, function() { f.reduceRight(cb); - } - catch (e) { - if (e instanceof TypeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-6.js index 632c94811ebbfec8e4251ac18fd7f5ffdf5add93..d4a6221a26422d965e8261d685e0e954ce7c52c1 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-6.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduceRight throws TypeError if 'length' is 0 (subclassed Array, length overridden with obj with valueOf), no initVal -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -19,13 +17,6 @@ function testcase() { f.length = o; function cb(){} - try { +assert.throws(TypeError, function() { f.reduceRight(cb); - } - catch (e) { - if (e instanceof TypeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-7.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-7.js index 3a386138572658c8f99bd32f1a13ea8538b8ba6b..e9a8a2a2435a9a01212e92b3e90c7aeb55ed1801 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-7.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-7.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduceRight throws TypeError if 'length' is 0 (subclassed Array, length overridden with obj w/o valueOf (toString)), no initVal -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -25,13 +23,6 @@ function testcase() { // resulting string to a number. function cb(){} - try { +assert.throws(TypeError, function() { f.reduceRight(cb); - } - catch (e) { - if (e instanceof TypeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-8.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-8.js index 63788afc0f7a69e6cddcce87bb519619876a84f0..425a7c6a61bba15b254e95394c349d2eaee5b6be 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-8.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-8.js @@ -6,10 +6,8 @@ es5id: 15.4.4.22-5-8 description: > Array.prototype.reduceRight throws TypeError if 'length' is 0 (subclassed Array, length overridden with []), no initVal -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -31,13 +29,6 @@ function testcase() { // or if its one element is not a number, the array converts to NaN. function cb(){} - try { +assert.throws(TypeError, function() { f.reduceRight(cb); - } - catch (e) { - if (e instanceof TypeError) { - return true; - } - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-32.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-32.js index 950fba740f4030e3504187495e255232387d25aa..3c359614c0e680bd6fb01522f9a772fc3a6c413b 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-32.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-32.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-32 description: > Array.prototype.reduceRight - Exception in getter terminate iteration on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx <= 1) { @@ -25,12 +22,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(RangeError, function() { Array.prototype.reduceRight.call(obj, callbackfn); - return false; - } catch (ex) { - return (ex instanceof RangeError) && !accessed; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-33.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-33.js index 43ed6583d3d3a4edd7629d6d0341fc8ee89d941b..1ed58b73fc4ea4f3b19d7d0ac1914b0b6bae188d 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-33.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-33.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-33 description: > Array.prototype.reduceRight - Exception in getter terminate iteration on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx <= 1) { @@ -26,12 +23,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(RangeError, function() { arr.reduceRight(callbackfn); - return false; - } catch (ex) { - return (ex instanceof RangeError) && !accessed; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-1.js index 59f95a6c408693b2b9a6b357627fb6dee3efc94f..c13b610d77e5af548370587b8da56fd572fd3c33 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-1.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-1.js @@ -6,22 +6,13 @@ es5id: 15.4.4.22-8-c-1 description: > Array.prototype.reduceRight throws TypeError when Array is empty and initialValue is not present -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { } var arr = new Array(10); - try { +assert.throws(TypeError, function() { arr.reduceRight(callbackfn); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-2.js index eb6917ccde265f3e2db952f0ebe17b7336a412d0..8863b6b38dddbc992285ca4bbf00860fee71976c 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-2.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-2.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight throws TypeError when elements assigned values are deleted by reducign array length and initialValue is not present -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { } @@ -19,12 +16,6 @@ function testcase() { var arr = new Array(10); arr[9] = 1; arr.length = 5; - try { +assert.throws(TypeError, function() { arr.reduceRight(callbackfn); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-3.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-3.js index efe0973272484c312bb334b8158d1adb3a11fc00..96d73e6002e2b6d565d46181ff5598fe3968ec0d 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-3.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-3.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-c-3 description: > Array.prototype.reduceRight throws TypeError when elements assigned values are deleted and initialValue is not present -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { } @@ -21,12 +18,6 @@ function testcase() { delete arr[2]; delete arr[3]; delete arr[4]; - try { +assert.throws(TypeError, function() { arr.reduceRight(callbackfn); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-5.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-5.js index 43f3b465f76dda91589f0eb46ddd880b9d5546fd..e59c25c52f879cc8a16a7e6fc67b0488025b9f60 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-5.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-5.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-c-5 description: > Array.prototype.reduceRight - side effects produced by step 2 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { }; var accessed = false; @@ -22,12 +19,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.reduceRight.call(obj, function () { }); - return false; - } catch (ex) { - return (ex instanceof TypeError) && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-6.js index 459118f3c53b79f173a67f5b9db72998d8026b99..7dce7319b7dc6d2d092c3f28b745dfb8b851fa49 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-c-6 description: > Array.prototype.reduceRight - side effects produced by step 3 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; var accessed = false; @@ -26,12 +23,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.reduceRight.call(obj, function () { }); - return false; - } catch (ex) { - return (ex instanceof TypeError) && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-32.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-32.js index dc514733768454d37d7d959c0d2138aae0d20c27..415294f82058ba60650dcb56a55bbc917e963b30 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-32.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-32.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-c-i-32 description: > Array.prototype.reduceRight - unnhandled exceptions happened in getter terminate iteration on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx <= 1) { @@ -26,12 +23,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(RangeError, function() { Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); - return false; - } catch (ex) { - return (ex instanceof RangeError) && !accessed; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-1.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-1.js index 3edbd680b4cb59440f86e65de33b06a54c93aaaf..f6ef912cf104bda68b689f74e56f553cc8f5b34a 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-1.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-1.js @@ -4,15 +4,9 @@ /*--- es5id: 15.4.4.17-1-1 description: Array.prototype.some applied to undefined throws a TypeError -includes: [runTestCase.js] ---*/ -function testcase() { - try { + +assert.throws(TypeError, function() { Array.prototype.some.call(undefined); - return false; - } catch (e) { - return (e instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-2.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-2.js index e7af4d96ccaf571591f3860e88f18613653871bf..1908d748769a8727f1ec8bc82122a6c0fddbeef1 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-2.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-2.js @@ -4,15 +4,9 @@ /*--- es5id: 15.4.4.17-1-2 description: Array.prototype.some applied to null throws a TypeError -includes: [runTestCase.js] ---*/ -function testcase() { - try { + +assert.throws(TypeError, function() { Array.prototype.some.call(null); - return false; - } catch (e) { - return (e instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-22.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-22.js index fa51c0e25b50301f7fd090aac5747b66b064d91f..8795d9a056ad59af0e61791aabbfc64fcda73fe9 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-22.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-22.js @@ -7,11 +7,8 @@ description: > Array.prototype.some throws TypeError exception when 'length' is an object with toString and valueOf methods that don�t return primitive values -includes: [runTestCase.js] ---*/ -function testcase() { - var callbackfnAccessed = false; var toStringAccessed = false; var valueOfAccessed = false; @@ -36,12 +33,9 @@ function testcase() { } } }; - - try { +assert.throws(TypeError, function() { Array.prototype.some.call(obj, callbackfn); - return false; - } catch (ex) { - return (ex instanceof TypeError) && toStringAccessed && valueOfAccessed && !callbackfnAccessed; - } - } -runTestCase(testcase); +}); +assert(toStringAccessed, 'toStringAccessed !== true'); +assert(valueOfAccessed, 'valueOfAccessed !== true'); +assert.sameValue(callbackfnAccessed, false, 'callbackfnAccessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-4-1.js b/test/built-ins/Array/prototype/some/15.4.4.17-4-1.js index 234cd7593eb274aa3d5926df214d6eb256c7ee4c..f6f66c910977845c0ddc5750465de4ad67e4793c 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-4-1.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-4-1.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.17-4-1 description: Array.prototype.some throws TypeError if callbackfn is undefined -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.some(); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.some(); +}); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-4-15.js b/test/built-ins/Array/prototype/some/15.4.4.17-4-15.js index a2e39d124a1f83fa20c71e551bcbdc7d3a609165..546f4c0c708a89d263844f5334ca1d49f6ae4792 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-4-15.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-4-15.js @@ -6,10 +6,8 @@ es5id: 15.4.4.17-4-15 description: > Array.prototype.some - calling with no callbackfn is the same as passing undefined for callbackfn -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { }; var lengthAccessed = false; var loopAccessed = false; @@ -28,12 +26,8 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.some.call(obj); - return false; - } catch (ex) { - return (ex instanceof TypeError) && lengthAccessed && !loopAccessed; - } - } -runTestCase(testcase); +}); +assert(lengthAccessed, 'lengthAccessed !== true'); +assert.sameValue(loopAccessed, false, 'loopAccessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-4-2.js b/test/built-ins/Array/prototype/some/15.4.4.17-4-2.js index f0344bb26ec40c7fe2374db671006ca99556e078..503aea9b4be3c0d59c9840ce0e5f8d5d4a67ca48 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-4-2.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-4-2.js @@ -6,19 +6,9 @@ es5id: 15.4.4.17-4-2 description: > Array.prototype.some throws ReferenceError if callbackfn is unreferenced -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.some(foo); - } - catch(e) { - if(e instanceof ReferenceError) - return true; - } - - } -runTestCase(testcase); +assert.throws(ReferenceError, function() { + arr.some(foo); +}); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-4-3.js b/test/built-ins/Array/prototype/some/15.4.4.17-4-3.js index 0cd339f8a44c405b82edbf31126fc37de7b07262..89efdb1acd82d1e0ae7238cc49fa7e3dde601ee6 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-4-3.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-4-3.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.17-4-3 description: Array.prototype.some throws TypeError if callbackfn is null -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.some(null); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.some(null); +}); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-4-4.js b/test/built-ins/Array/prototype/some/15.4.4.17-4-4.js index e66e09dd6b5d6c35ab7f3ad8eb5e3b08d8055794..d6a7dcaceba13b6c333bc244e446224658e280c2 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-4-4.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-4-4.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.17-4-4 description: Array.prototype.some throws TypeError if callbackfn is boolean -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.some(true); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.some(true); +}); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-4-5.js b/test/built-ins/Array/prototype/some/15.4.4.17-4-5.js index baa73b9a7e1bc541345dc3505137f44c8a0a93f8..5bfa34ff07579859a289a5e7ad78aa5eb02bae88 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-4-5.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-4-5.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.17-4-5 description: Array.prototype.some throws TypeError if callbackfn is number -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.some(5); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.some(5); +}); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-4-6.js b/test/built-ins/Array/prototype/some/15.4.4.17-4-6.js index 6635c18cc1aca52191c998372826a14f2b2fb6c1..12ac7b3d8107b2724dfe1141687063ae7fd8f7c1 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-4-6.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-4-6.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.17-4-6 description: Array.prototype.some throws TypeError if callbackfn is string -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.some("abc"); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.some("abc"); +}); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-4-7.js b/test/built-ins/Array/prototype/some/15.4.4.17-4-7.js index 0e49f17e97b6e5f2b96e7a95b77dd0c14c844b47..f0ab45b37acfa8d0c8464e8d1df747af2490e34e 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-4-7.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-4-7.js @@ -6,19 +6,9 @@ es5id: 15.4.4.17-4-7 description: > Array.prototype.some throws TypeError if callbackfn is Object without a Call internal method -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = new Array(10); - try { - arr.some(new Object()); - } - catch(e) { - if(e instanceof TypeError) - return true; - } - - } -runTestCase(testcase); +assert.throws(TypeError, function() { + arr.some(new Object()); +}); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-4-8.js b/test/built-ins/Array/prototype/some/15.4.4.17-4-8.js index 53cc873524c4fa6692ff0d00551159f87ed61239..ea13a559b15e09cb3fd7e09cb4b58c637cd8d4ff 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-4-8.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-4-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.17-4-8 description: > Array.prototype.some - side effects produced by step 2 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; var accessed = false; @@ -22,12 +19,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.some.call(obj, null); - return false; - } catch (ex) { - return ex instanceof TypeError && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-4-9.js b/test/built-ins/Array/prototype/some/15.4.4.17-4-9.js index beac8d856ca640a25f83effa6db7322370568f75..8e30688b972eefb925389c533556973a9c6751f2 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-4-9.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-4-9.js @@ -6,11 +6,8 @@ es5id: 15.4.4.17-4-9 description: > Array.prototype.some - side effects produced by step 3 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; var accessed = false; @@ -26,12 +23,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(TypeError, function() { Array.prototype.some.call(obj, null); - return false; - } catch (ex) { - return ex instanceof TypeError && accessed; - } - } -runTestCase(testcase); +}); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-30.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-30.js index 56f598f9dcb26c43330a84bb35722f586244c0bd..6b83b9533da49ddf8838b034cdaf43f68aa75a8f 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-30.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-30.js @@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-30 description: > Array.prototype.some - unhandled exceptions happened in getter terminate iteration on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { if (idx > 1) { @@ -26,12 +23,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(RangeError, function() { Array.prototype.some.call(obj, callbackfn); - return false; - } catch (ex) { - return ex instanceof RangeError && !accessed; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-31.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-31.js index 770bab3432a0976451e9429344a1801b19f1056e..8b753da1bc2a4326a3e7dcdfdbf42c2d00b85e95 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-31.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-31.js @@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-31 description: > Array.prototype.some - unhandled exceptions happened in getter terminate iteration on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { if (idx > 0) { @@ -27,12 +24,7 @@ function testcase() { }, configurable: true }); - - try { +assert.throws(RangeError, function() { arr.some(callbackfn); - return false; - } catch (ex) { - return ex instanceof RangeError && !accessed; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-7.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-7.js index f81a458863ee7414c735e93b53143823f8876618..cd488bd7e84075b8208cce2356925070972fcf20 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-7.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-ii-7 description: > Array.prototype.some - unhandled exceptions happened in callbackfn terminate iteration -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -24,12 +21,7 @@ function testcase() { } var obj = { 0: 9, 1: 100, 10: 11, length: 20 }; - - try { +assert.throws(Error, function() { Array.prototype.some.call(obj, callbackfn); - return false; - } catch (ex) { - return ex instanceof Error && !accessed; - } - } -runTestCase(testcase); +}); +assert.sameValue(accessed, false, 'accessed');