diff --git a/test/built-ins/Array/15.4.5-1.js b/test/built-ins/Array/15.4.5-1.js index d8a00abd4a5423efddaa10e6ef388ea7f5cca963..6eb1ae127167b99969c0310704572d96898a703f 100644 --- a/test/built-ins/Array/15.4.5-1.js +++ b/test/built-ins/Array/15.4.5-1.js @@ -6,7 +6,7 @@ es5id: 15.4.5-1 description: Array instances have [[Class]] set to 'Array' ---*/ - var a = []; - var s = Object.prototype.toString.call(a); +var a = []; +var s = Object.prototype.toString.call(a); assert.sameValue(s, '[object Array]', 's'); diff --git a/test/built-ins/Array/15.4.5.1-5-1.js b/test/built-ins/Array/15.4.5.1-5-1.js index 945bf9ae4ed9d30d07c2ed460ddd57453d45ec49..d92747a324f5ca07e23348e386548acc4aa522e3 100644 --- a/test/built-ins/Array/15.4.5.1-5-1.js +++ b/test/built-ins/Array/15.4.5.1-5-1.js @@ -8,7 +8,7 @@ description: > element) ---*/ - var a =[]; - a[4294967295] = "not an array element" ; +var a = []; +a[4294967295] = "not an array element"; assert.sameValue(a[4294967295], "not an array element", 'a[4294967295]'); diff --git a/test/built-ins/Array/15.4.5.1-5-2.js b/test/built-ins/Array/15.4.5.1-5-2.js index 924c48f47933089dfb2c2a53b1e9773cf3189c42..27abd4c55b151d650a4ab4fe62cf3cae2bab8fd6 100644 --- a/test/built-ins/Array/15.4.5.1-5-2.js +++ b/test/built-ins/Array/15.4.5.1-5-2.js @@ -8,7 +8,7 @@ description: > length of the array ---*/ - var a =[0,1,2]; - a[4294967295] = "not an array element" ; +var a = [0, 1, 2]; +a[4294967295] = "not an array element"; assert.sameValue(a.length, 3, 'a.length'); diff --git a/test/built-ins/Array/S15.4.1_A1.1_T2.js b/test/built-ins/Array/S15.4.1_A1.1_T2.js index 95deeeeaee1517616c2287bf2e6fd3887aea5d93..cbee1450ca0841fbcc17c905ef0bee2d86ba6887 100644 --- a/test/built-ins/Array/S15.4.1_A1.1_T2.js +++ b/test/built-ins/Array/S15.4.1_A1.1_T2.js @@ -12,14 +12,14 @@ description: Array.prototype.toString = Object.prototype.toString //CHECK#1 Array.prototype.toString = Object.prototype.toString; -var x = Array(); +var x = Array(); if (x.toString() !== "[object " + "Array" + "]") { $ERROR('#1: Array.prototype.toString = Object.prototype.toString; var x = Array(); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString())); } //CHECK#2 Array.prototype.toString = Object.prototype.toString; -var x = Array(0,1,2); +var x = Array(0, 1, 2); if (x.toString() !== "[object " + "Array" + "]") { $ERROR('#2: Array.prototype.toString = Object.prototype.toString; var x = Array(0,1,2); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString())); } diff --git a/test/built-ins/Array/S15.4.1_A1.2_T1.js b/test/built-ins/Array/S15.4.1_A1.2_T1.js index 424f8eb9b438f84dc4e71db5de94ad33515e740d..abdb5116d100c1d614ec9174efa7a837eb214bd6 100644 --- a/test/built-ins/Array/S15.4.1_A1.2_T1.js +++ b/test/built-ins/Array/S15.4.1_A1.2_T1.js @@ -8,14 +8,14 @@ description: Checking use Object.prototype.toString ---*/ //CHECK#1 -var x = Array(); +var x = Array(); x.getClass = Object.prototype.toString; if (x.getClass() !== "[object " + "Array" + "]") { $ERROR('#1: var x = Array(); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass())); } //CHECK#2 -var x = Array(0,1,2); +var x = Array(0, 1, 2); x.getClass = Object.prototype.toString; if (x.getClass() !== "[object " + "Array" + "]") { $ERROR('#2: var x = Array(0,1,2); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass())); diff --git a/test/built-ins/Array/S15.4.1_A2.1_T1.js b/test/built-ins/Array/S15.4.1_A2.1_T1.js index 89b2934f6340552899a9ac5cf70ebfcdbc951632..0196ec03940634b0f7f732b784b00d52c6624aa6 100644 --- a/test/built-ins/Array/S15.4.1_A2.1_T1.js +++ b/test/built-ins/Array/S15.4.1_A2.1_T1.js @@ -15,8 +15,8 @@ if (Array().length !== 0) { } //CHECK#2 -if (Array(0,1,0,1).length !== 4) { - $ERROR('#2: (Array(0,1,0,1).length === 4. Actual: ' + (Array(0,1,0,1).length)); +if (Array(0, 1, 0, 1).length !== 4) { + $ERROR('#2: (Array(0,1,0,1).length === 4. Actual: ' + (Array(0, 1, 0, 1).length)); } //CHECK#3 diff --git a/test/built-ins/Array/S15.4.1_A2.2_T1.js b/test/built-ins/Array/S15.4.1_A2.2_T1.js index 971ce382cd41d9b622cba5a372f110edb246e09e..92f2c1d917da7eae3eaeebc269b81437685450e7 100644 --- a/test/built-ins/Array/S15.4.1_A2.2_T1.js +++ b/test/built-ins/Array/S15.4.1_A2.2_T1.js @@ -14,16 +14,16 @@ description: Checking correct work this algorithm //CHECK# var x = Array( -0,1,2,3,4,5,6,7,8,9, -10,11,12,13,14,15,16,17,18,19, -20,21,22,23,24,25,26,27,28,29, -30,31,32,33,34,35,36,37,38,39, -40,41,42,43,44,45,46,47,48,49, -50,51,52,53,54,55,56,57,58,59, -60,61,62,63,64,65,66,67,68,69, -70,71,72,73,74,75,76,77,78,79, -80,81,82,83,84,85,86,87,88,89, -90,91,92,93,94,95,96,97,98,99 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 ); for (var i = 0; i < 100; i++) { diff --git a/test/built-ins/Array/S15.4.1_A3.1_T1.js b/test/built-ins/Array/S15.4.1_A3.1_T1.js index 383fefd736d0a76984d734b670e61d5865cf9998..679db6fb473c1abaf10d15e82e17836e70994647 100644 --- a/test/built-ins/Array/S15.4.1_A3.1_T1.js +++ b/test/built-ins/Array/S15.4.1_A3.1_T1.js @@ -12,7 +12,7 @@ description: Checking use typeof, instanceof //CHECK#1 if (typeof Array() !== "object") { $ERROR('#1: typeof Array() === "object". Actual: ' + (typeof Array())); -} +} //CHECK#2 if ((Array() instanceof Array) !== true) { diff --git a/test/built-ins/Array/S15.4.2.1_A1.1_T1.js b/test/built-ins/Array/S15.4.2.1_A1.1_T1.js index 895ae2f4f2f939b129e9d0d59177e4a0309196a2..cd3a2c13de26df98eb9181633aada73cd8c83fa6 100644 --- a/test/built-ins/Array/S15.4.2.1_A1.1_T1.js +++ b/test/built-ins/Array/S15.4.2.1_A1.1_T1.js @@ -14,7 +14,7 @@ description: > //CHECK#1 Array.prototype.myproperty = 1; -var x = new Array(); +var x = new Array(); if (x.myproperty !== 1) { $ERROR('#1: Array.prototype.myproperty = 1; var x = new Array(); x.myproperty === 1. Actual: ' + (x.myproperty)); } diff --git a/test/built-ins/Array/S15.4.2.1_A1.1_T2.js b/test/built-ins/Array/S15.4.2.1_A1.1_T2.js index 74ccc645eb2156e5d523f2f10a50ed7d627fe481..3992943a4a015b786f58bee08c03ae35e594519b 100644 --- a/test/built-ins/Array/S15.4.2.1_A1.1_T2.js +++ b/test/built-ins/Array/S15.4.2.1_A1.1_T2.js @@ -12,14 +12,14 @@ description: Array.prototype.toString = Object.prototype.toString //CHECK#1 Array.prototype.toString = Object.prototype.toString; -var x = new Array(); +var x = new Array(); if (x.toString() !== "[object " + "Array" + "]") { $ERROR('#1: Array.prototype.toString = Object.prototype.toString; var x = new Array(); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString())); } //CHECK#2 Array.prototype.toString = Object.prototype.toString; -var x = new Array(0,1,2); +var x = new Array(0, 1, 2); if (x.toString() !== "[object " + "Array" + "]") { $ERROR('#2: Array.prototype.toString = Object.prototype.toString; var x = new Array(0,1,2); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString())); } diff --git a/test/built-ins/Array/S15.4.2.1_A1.2_T1.js b/test/built-ins/Array/S15.4.2.1_A1.2_T1.js index 59b528f6a32bafacb02e469a62b9f2857d405843..de6c5a1d813763120b3ac1c61d7e300240bfbc08 100644 --- a/test/built-ins/Array/S15.4.2.1_A1.2_T1.js +++ b/test/built-ins/Array/S15.4.2.1_A1.2_T1.js @@ -8,14 +8,14 @@ description: Checking use Object.prototype.toString ---*/ //CHECK#1 -var x = new Array(); +var x = new Array(); x.getClass = Object.prototype.toString; if (x.getClass() !== "[object " + "Array" + "]") { $ERROR('#1: var x = new Array(); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass())); } //CHECK#2 -var x = new Array(0,1,2); +var x = new Array(0, 1, 2); x.getClass = Object.prototype.toString; if (x.getClass() !== "[object " + "Array" + "]") { $ERROR('#2: var x = new Array(0,1,2); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass())); diff --git a/test/built-ins/Array/S15.4.2.1_A2.1_T1.js b/test/built-ins/Array/S15.4.2.1_A2.1_T1.js index 97aaaa52b73ce9403db262754efd36035367e118..e189774b0c0313bee835e5ef558eb6afc015cb21 100644 --- a/test/built-ins/Array/S15.4.2.1_A2.1_T1.js +++ b/test/built-ins/Array/S15.4.2.1_A2.1_T1.js @@ -15,8 +15,8 @@ if (new Array().length !== 0) { } //CHECK#2 -if (new Array(0,1,0,1).length !== 4) { - $ERROR('#2: new Array(0,1,0,1).length === 4. Actual: ' + (new Array(0,1,0,1).length)); +if (new Array(0, 1, 0, 1).length !== 4) { + $ERROR('#2: new Array(0,1,0,1).length === 4. Actual: ' + (new Array(0, 1, 0, 1).length)); } //CHECK#3 diff --git a/test/built-ins/Array/S15.4.2.1_A2.2_T1.js b/test/built-ins/Array/S15.4.2.1_A2.2_T1.js index e4c088a91d73e2d7f3dc4e9fa235185f2114768c..05dbf789d06b473bff5a497c7f08d741c85104b4 100644 --- a/test/built-ins/Array/S15.4.2.1_A2.2_T1.js +++ b/test/built-ins/Array/S15.4.2.1_A2.2_T1.js @@ -14,16 +14,16 @@ description: Checking correct work this algorithm //CHECK# var x = new Array( -0,1,2,3,4,5,6,7,8,9, -10,11,12,13,14,15,16,17,18,19, -20,21,22,23,24,25,26,27,28,29, -30,31,32,33,34,35,36,37,38,39, -40,41,42,43,44,45,46,47,48,49, -50,51,52,53,54,55,56,57,58,59, -60,61,62,63,64,65,66,67,68,69, -70,71,72,73,74,75,76,77,78,79, -80,81,82,83,84,85,86,87,88,89, -90,91,92,93,94,95,96,97,98,99 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 ); for (var i = 0; i < 100; i++) { diff --git a/test/built-ins/Array/S15.4.5.1_A1.2_T2.js b/test/built-ins/Array/S15.4.5.1_A1.2_T2.js index eb722c4ab6c1b2d58ed77e5623c0ddc7c7e5818e..493457eb95c0ee9aa5f19c22392f581adf4dde95 100644 --- a/test/built-ins/Array/S15.4.5.1_A1.2_T2.js +++ b/test/built-ins/Array/S15.4.5.1_A1.2_T2.js @@ -13,13 +13,13 @@ description: Checking an inherited property //CHECK#1 Array.prototype[2] = -1; -var x = [0,1,2]; -if (x[2] !== 2) { - $ERROR('#1: Array.prototype[2] = -1; x = [0,1,3]; x[2] === 2. Actual: ' + (x[2])); +var x = [0, 1, 2]; +if (x[2] !== 2) { + $ERROR('#1: Array.prototype[2] = -1; x = [0,1,3]; x[2] === 2. Actual: ' + (x[2])); } //CHECK#2 x.length = 2; -if (x[2] !== -1) { - $ERROR('#2: Array.prototype[2] = -1; x = [0,1,3]; x.length = 2; x[2] === -1. Actual: ' + (x[2])); +if (x[2] !== -1) { + $ERROR('#2: Array.prototype[2] = -1; x = [0,1,3]; x.length = 2; x[2] === -1. Actual: ' + (x[2])); } diff --git a/test/built-ins/Array/S15.4.5.1_A2.1_T1.js b/test/built-ins/Array/S15.4.5.1_A2.1_T1.js index 3006c94e7db25a11724950204053541684b1f5b9..b48f6d6c421f115c1ef7010aa5699f82e44ddcae 100644 --- a/test/built-ins/Array/S15.4.5.1_A2.1_T1.js +++ b/test/built-ins/Array/S15.4.5.1_A2.1_T1.js @@ -12,32 +12,32 @@ description: P in [4294967295, -1, true] //CHECK#1 var x = []; x[4294967295] = 1; -if (x.length !== 0) { - $ERROR('#1.1: x = []; x[4294967295] = 1; x.length === 0. Actual: ' + (x.length)); +if (x.length !== 0) { + $ERROR('#1.1: x = []; x[4294967295] = 1; x.length === 0. Actual: ' + (x.length)); } -if (x[4294967295] !== 1) { - $ERROR('#1.2: x = []; x[4294967295] = 1; x[4294967295] === 1. Actual: ' + (x[4294967295])); +if (x[4294967295] !== 1) { + $ERROR('#1.2: x = []; x[4294967295] = 1; x[4294967295] === 1. Actual: ' + (x[4294967295])); } //CHECK#2 x = []; x[-1] = 1; -if (x.length !== 0) { - $ERROR('#2.1: x = []; x[-1] = 1; x.length === 0. Actual: ' + (x.length)); +if (x.length !== 0) { + $ERROR('#2.1: x = []; x[-1] = 1; x.length === 0. Actual: ' + (x.length)); } -if (x[-1] !== 1) { - $ERROR('#2.2: x = []; x[-1] = 1; x[-1] === 1. Actual: ' + (x[-1])); +if (x[-1] !== 1) { + $ERROR('#2.2: x = []; x[-1] = 1; x[-1] === 1. Actual: ' + (x[-1])); } //CHECK#3 x = []; x[true] = 1; -if (x.length !== 0) { - $ERROR('#3.1: x = []; x[true] = 1; x.length === 0. Actual: ' + (x.length)); +if (x.length !== 0) { + $ERROR('#3.1: x = []; x[true] = 1; x.length === 0. Actual: ' + (x.length)); } -if (x[true] !== 1) { - $ERROR('#3.2: x = []; x[true] = 1; x[true] === 1. Actual: ' + (x[true])); +if (x[true] !== 1) { + $ERROR('#3.2: x = []; x[true] = 1; x[true] === 1. Actual: ' + (x[true])); } diff --git a/test/built-ins/Array/S15.4.5.1_A2.2_T1.js b/test/built-ins/Array/S15.4.5.1_A2.2_T1.js index b3000c1dba36ad3d2d8fae81b9bbd0329fa6095a..45ebd19d6ae2a91b3eb6e5f15ac2d3356c39b508 100644 --- a/test/built-ins/Array/S15.4.5.1_A2.2_T1.js +++ b/test/built-ins/Array/S15.4.5.1_A2.2_T1.js @@ -12,18 +12,18 @@ description: length === 100, P in [0, 98, 99] //CHECK#1 var x = Array(100); x[0] = 1; -if (x.length !== 100) { - $ERROR('#1: x = Array(100); x[0] = 1; x.length === 100. Actual: ' + (x.length)); +if (x.length !== 100) { + $ERROR('#1: x = Array(100); x[0] = 1; x.length === 100. Actual: ' + (x.length)); } //CHECK#2 x[98] = 1; -if (x.length !== 100) { - $ERROR('#2: x = Array(100); x[0] = 1; x[98] = 1; x.length === 100. Actual: ' + (x.length)); +if (x.length !== 100) { + $ERROR('#2: x = Array(100); x[0] = 1; x[98] = 1; x.length === 100. Actual: ' + (x.length)); } //CHECK#3 x[99] = 1; -if (x.length !== 100) { - $ERROR('#3: x = Array(100); x[0] = 1; x[98] = 1; x[99] = 1; x.length === 100. Actual: ' + (x.length)); +if (x.length !== 100) { + $ERROR('#3: x = Array(100); x[0] = 1; x[98] = 1; x[99] = 1; x.length === 100. Actual: ' + (x.length)); } diff --git a/test/built-ins/Array/S15.4.5.1_A2.3_T1.js b/test/built-ins/Array/S15.4.5.1_A2.3_T1.js index 90525f07ffcb62ff24d4c10531c91856e9b74f24..0c4c807db0b7e7df69f2be8718a4f90e6ccc558d 100644 --- a/test/built-ins/Array/S15.4.5.1_A2.3_T1.js +++ b/test/built-ins/Array/S15.4.5.1_A2.3_T1.js @@ -12,12 +12,12 @@ description: length = 100, P in [100, 199] //CHECK#1 var x = Array(100); x[100] = 1; -if (x.length !== 101) { - $ERROR('#1: x = Array(100); x[100] = 1; x.length === 101. Actual: ' + (x.length)); +if (x.length !== 101) { + $ERROR('#1: x = Array(100); x[100] = 1; x.length === 101. Actual: ' + (x.length)); } //CHECK#2 x[199] = 1; -if (x.length !== 200) { - $ERROR('#2: x = Array(100); x[100] = 1; x[199] = 1; x.length === 100. Actual: ' + (x.length)); +if (x.length !== 200) { + $ERROR('#2: x = Array(100); x[100] = 1; x[199] = 1; x.length === 100. Actual: ' + (x.length)); } diff --git a/test/built-ins/Array/S15.4.5.2_A1_T1.js b/test/built-ins/Array/S15.4.5.2_A1_T1.js index 16e7904b8a8930ca75ec1dcf05c4991bda828906..56ef2426ece7944088947f7ceda6e663a9bac321 100644 --- a/test/built-ins/Array/S15.4.5.2_A1_T1.js +++ b/test/built-ins/Array/S15.4.5.2_A1_T1.js @@ -12,30 +12,30 @@ description: Checking boundary points //CHECK#1 var x = []; -if (x.length !== 0) { - $ERROR('#1: x = []; x.length === 0. Actual: ' + (x.length)); +if (x.length !== 0) { + $ERROR('#1: x = []; x.length === 0. Actual: ' + (x.length)); } //CHECK#2 x[0] = 1; -if (x.length !== 1) { +if (x.length !== 1) { $ERROR('#2: x = []; x[1] = 1; x.length === 1. Actual: ' + (x.length)); } //CHECK#3 x[1] = 1; -if (x.length !== 2) { +if (x.length !== 2) { $ERROR('#3: x = []; x[0] = 1; x[1] = 1; x.length === 2. Actual: ' + (x.length)); } //CHECK#4 x[2147483648] = 1; -if (x.length !== 2147483649) { +if (x.length !== 2147483649) { $ERROR('#4: x = []; x[0] = 1; x[1] = 1; x[2147483648] = 1; x.length === 2147483649. Actual: ' + (x.length)); } //CHECK#5 x[4294967294] = 1; -if (x.length !== 4294967295) { +if (x.length !== 4294967295) { $ERROR('#5: x = []; x[0] = 1; x[1] = 1; x[2147483648] = 1; x[42949672954] = 1; x.length === 4294967295. Actual: ' + (x.length)); } diff --git a/test/built-ins/Array/S15.4.5.2_A1_T2.js b/test/built-ins/Array/S15.4.5.2_A1_T2.js index 12dfb1943b3d5d135202e04b7d6afc740ed072ab..6edcf113b4ac201351d459e7b724ce7fe2cf3207 100644 --- a/test/built-ins/Array/S15.4.5.2_A1_T2.js +++ b/test/built-ins/Array/S15.4.5.2_A1_T2.js @@ -13,14 +13,14 @@ description: P = "2^32 - 1" is not index array //CHECK#1 var x = []; x[4294967295] = 1; -if (x.length !== 0) { - $ERROR('#1: x = []; x[4294967295] = 1; x.length === 0. Actual: ' + (x.length)); +if (x.length !== 0) { + $ERROR('#1: x = []; x[4294967295] = 1; x.length === 0. Actual: ' + (x.length)); } //CHECK#2 -var y =[]; +var y = []; y[1] = 1; y[4294967295] = 1; -if (y.length !== 2) { +if (y.length !== 2) { $ERROR('#2: y = []; y[1] = 1; y[4294967295] = 1; y.length === 2. Actual: ' + (y.length)); } diff --git a/test/built-ins/Array/S15.4.5.2_A2_T1.js b/test/built-ins/Array/S15.4.5.2_A2_T1.js index 8f9ac5b8c98c21985db82ce6343972ca4ed7694e..39a8a330a73bf1c7777ea023c27c491e3f1c6a4f 100644 --- a/test/built-ins/Array/S15.4.5.2_A2_T1.js +++ b/test/built-ins/Array/S15.4.5.2_A2_T1.js @@ -11,24 +11,24 @@ description: Checking length property //CHECK#1 var x = []; -if (x.length !== 0) { - $ERROR('#1: x = []; x.length === 0. Actual: ' + (x.length)); +if (x.length !== 0) { + $ERROR('#1: x = []; x.length === 0. Actual: ' + (x.length)); } //CHECK#2 x[0] = 1; -if (x.length !== 1) { +if (x.length !== 1) { $ERROR('#2: x = []; x[1] = 1; x.length === 1. Actual: ' + (x.length)); } //CHECK#3 x[1] = 1; -if (x.length !== 2) { +if (x.length !== 2) { $ERROR('#3: x = []; x[0] = 1; x[1] = 1; x.length === 2. Actual: ' + (x.length)); } //CHECK#4 x[9] = 1; -if (x.length !== 10) { +if (x.length !== 10) { $ERROR('#4: x = []; x[0] = 1; x[1] = 1; x[9] = 1; x.length === 10. Actual: ' + (x.length)); } diff --git a/test/built-ins/Array/S15.4.5.2_A3_T1.js b/test/built-ins/Array/S15.4.5.2_A3_T1.js index 5ab53b122a81918dec7cc4368c8ac229b668b3dc..f29a2a9b18e13c479ce44b54ca7495262c3251f9 100644 --- a/test/built-ins/Array/S15.4.5.2_A3_T1.js +++ b/test/built-ins/Array/S15.4.5.2_A3_T1.js @@ -14,18 +14,18 @@ description: > //CHECK#1 var x = []; x.length = 1; -if (x.length !== 1) { - $ERROR('#1: x = []; x.length = 1; x.length === 1. Actual: ' + (x.length)); +if (x.length !== 1) { + $ERROR('#1: x = []; x.length = 1; x.length === 1. Actual: ' + (x.length)); } //CHECK#2 x[5] = 1; x.length = 10; -if (x.length !== 10) { +if (x.length !== 10) { $ERROR('#2: x = []; x.length = 1; x[5] = 1; x.length = 10; x.length === 10. Actual: ' + (x.length)); } //CHECK#3 -if (x[5] !== 1) { +if (x[5] !== 1) { $ERROR('#3: x = []; x.length = 1; x[5] = 1; x.length = 10; x[5] = 1'); } diff --git a/test/built-ins/Array/S15.4.5.2_A3_T2.js b/test/built-ins/Array/S15.4.5.2_A3_T2.js index ddd35796995b1555f868042ef1c2496c92dc6015..da278f12bcb5e5c7cf2e1309928f45a974aef014 100644 --- a/test/built-ins/Array/S15.4.5.2_A3_T2.js +++ b/test/built-ins/Array/S15.4.5.2_A3_T2.js @@ -17,34 +17,34 @@ x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; -if (x.length !== 4) { - $ERROR('#1: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x.length === 4. Actual: ' + (x.length)); +if (x.length !== 4) { + $ERROR('#1: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x.length === 4. Actual: ' + (x.length)); } //CHECK#2 -if (x[5] !== undefined) { +if (x[5] !== undefined) { $ERROR('#2: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x[5] === undefined. Actual: ' + (x[5])); } //CHECK#3 -if (x[3] !== 3) { +if (x[3] !== 3) { $ERROR('#3: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x[3] === 3. Actual: ' + (x[3])); } //CHECK#4 x.length = new Number(6); -if (x[5] !== undefined) { +if (x[5] !== undefined) { $ERROR('#4: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x.length = new Number(6); x[5] === undefined. Actual: ' + (x[5])); } //CHECK#5 x.length = 0; -if (x[0] !== undefined) { +if (x[0] !== undefined) { $ERROR('#5: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x.length = new Number(6); x.length = 0; x[0] === undefined. Actual: ' + (x[0])); } //CHECK#6 x.length = 1; -if (x[1] !== undefined) { +if (x[1] !== undefined) { $ERROR('#6: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x.length = new Number(6); x.length = 0; x.length = 1; x[1] === undefined. Actual: ' + (x[1])); } diff --git a/test/built-ins/Array/S15.4.5.2_A3_T3.js b/test/built-ins/Array/S15.4.5.2_A3_T3.js index 6d7eb65791605eb2d87b7dcb07b1635bc48c135d..5b3f13f36958740e79fee0eea177aaf49483d375 100644 --- a/test/built-ins/Array/S15.4.5.2_A3_T3.js +++ b/test/built-ins/Array/S15.4.5.2_A3_T3.js @@ -12,8 +12,8 @@ description: "[[Put]] (length, 4294967296)" //CHECK#1 var x = []; x.length = 4294967295; -if (x.length !== 4294967295) { - $ERROR('#1: x = []; x.length = 4294967295; x.length === 4294967295'); +if (x.length !== 4294967295) { + $ERROR('#1: x = []; x.length = 4294967295; x.length === 4294967295'); } //CHECK#2 @@ -21,8 +21,8 @@ try { x = []; x.length = 4294967296; $ERROR('#2.1: x = []; x.length = 4294967296 throw RangeError. Actual: x.length === ' + (x.length)); -} catch(e) { +} catch (e) { if ((e instanceof RangeError) !== true) { $ERROR('#2.2: x = []; x.length = 4294967296 throw RangeError. Actual: ' + (e)); - } + } } diff --git a/test/built-ins/Array/S15.4_A1.1_T10.js b/test/built-ins/Array/S15.4_A1.1_T10.js index 95ab3851b923ce353b4761a020794bce6696e69e..c2d6d3a75e8d95ec3374a3630bb43897d89697c4 100644 --- a/test/built-ins/Array/S15.4_A1.1_T10.js +++ b/test/built-ins/Array/S15.4_A1.1_T10.js @@ -14,7 +14,7 @@ var x = []; var k = 1; for (var i = 0; i < 32; i++) { k = k * 2; - x[k - 2] = k; + x[k - 2] = k; } k = 1; @@ -22,5 +22,5 @@ for (i = 0; i < 32; i++) { k = k * 2; if (x[k - 2] !== k) { $ERROR('#' + (k - 2) + ': '); - } + } } diff --git a/test/built-ins/Array/S15.4_A1.1_T4.js b/test/built-ins/Array/S15.4_A1.1_T4.js index 74c053efcd849c0983ff87f946ae0f609608def7..fa5dff3e1376ddaaf72ad4d9b8e1e0b31b126aaf 100644 --- a/test/built-ins/Array/S15.4_A1.1_T4.js +++ b/test/built-ins/Array/S15.4_A1.1_T4.js @@ -13,12 +13,12 @@ description: Checking for string primitive var x = []; x["0"] = 0; if (x[0] !== 0) { - $ERROR('#1: x = []; x["0"] = 0; x[0] === 0. Actual: ' + (x[0])); -} + $ERROR('#1: x = []; x["0"] = 0; x[0] === 0. Actual: ' + (x[0])); +} //CHECK#2 var y = []; y["1"] = 1; if (y[1] !== 1) { - $ERROR('#2: y = []; y["1"] = 1; y[1] === 1. Actual: ' + (y[1])); + $ERROR('#2: y = []; y["1"] = 1; y[1] === 1. Actual: ' + (y[1])); } diff --git a/test/built-ins/Array/S15.4_A1.1_T5.js b/test/built-ins/Array/S15.4_A1.1_T5.js index 1a2a3e63bc3f5541a69f7f7ad0036c0351b5020d..7c5f208763043f39c1751cdf773a010134f47f19 100644 --- a/test/built-ins/Array/S15.4_A1.1_T5.js +++ b/test/built-ins/Array/S15.4_A1.1_T5.js @@ -13,22 +13,22 @@ description: Checking for null and undefined var x = []; x[null] = 0; if (x[0] !== undefined) { - $ERROR('#1: x = []; x[null] = 1; x[0] === undefined. Actual: ' + (x[0])); + $ERROR('#1: x = []; x[null] = 1; x[0] === undefined. Actual: ' + (x[0])); } //CHECK#2 if (x["null"] !== 0) { - $ERROR('#2: x = []; x[null] = 1; x["null"] === 0. Actual: ' + (x["null"])); + $ERROR('#2: x = []; x[null] = 1; x["null"] === 0. Actual: ' + (x["null"])); } //CHECK#3 var y = []; y[undefined] = 0; if (y[0] !== undefined) { - $ERROR('#3: y = []; y[undefined] = 0; y[0] === undefined. Actual: ' + (y[0])); + $ERROR('#3: y = []; y[undefined] = 0; y[0] === undefined. Actual: ' + (y[0])); } //CHECK#4 if (y["undefined"] !== 0) { - $ERROR('#4: y = []; y[undefined] = 1; y["undefined"] === 0. Actual: ' + (y["undefined"])); + $ERROR('#4: y = []; y[undefined] = 1; y["undefined"] === 0. Actual: ' + (y["undefined"])); } diff --git a/test/built-ins/Array/S15.4_A1.1_T6.js b/test/built-ins/Array/S15.4_A1.1_T6.js index 8b0478706859b0627ee15db3a28ea205497da4a1..7aaf2b628e26d88f7c67101755aa3c61f76d8ad1 100644 --- a/test/built-ins/Array/S15.4_A1.1_T6.js +++ b/test/built-ins/Array/S15.4_A1.1_T6.js @@ -13,21 +13,21 @@ description: Checking for Boolean object var x = []; x[new Boolean(true)] = 1; if (x[1] !== undefined) { - $ERROR('#1: x = []; x[new Boolean(true)] = 1; x[1] === undefined. Actual: ' + (x[1])); + $ERROR('#1: x = []; x[new Boolean(true)] = 1; x[1] === undefined. Actual: ' + (x[1])); } //CHECK#2 if (x["true"] !== 1) { - $ERROR('#2: x = []; x[true] = 1; x["true"] === 1. Actual: ' + (x["true"])); + $ERROR('#2: x = []; x[true] = 1; x["true"] === 1. Actual: ' + (x["true"])); } //CHECK#3 x[new Boolean(false)] = 0; if (x[0] !== undefined) { - $ERROR('#3: x = []; x[true] = 1; x[new Boolean(false)] = 0; x[0] === undefined. Actual: ' + (x[0])); + $ERROR('#3: x = []; x[true] = 1; x[new Boolean(false)] = 0; x[0] === undefined. Actual: ' + (x[0])); } //CHECK#4 if (x["false"] !== 0) { - $ERROR('#4: x = []; x[false] = 1; x["false"] === 0. Actual: ' + (x["false"])); + $ERROR('#4: x = []; x[false] = 1; x["false"] === 0. Actual: ' + (x["false"])); } diff --git a/test/built-ins/Array/S15.4_A1.1_T7.js b/test/built-ins/Array/S15.4_A1.1_T7.js index a7a3a3caf5782ebc3b537d34bfc29899aeb12482..de1f1cd0ac62ebda8df22db1c04fd5b48d177166 100644 --- a/test/built-ins/Array/S15.4_A1.1_T7.js +++ b/test/built-ins/Array/S15.4_A1.1_T7.js @@ -13,19 +13,19 @@ description: Checking for Number object var x = []; x[new Number(0)] = 0; if (x[0] !== 0) { - $ERROR('#1: x = []; x[new Number(0)] = 0; x[0] === 0. Actual: ' + (x[0])); -} + $ERROR('#1: x = []; x[new Number(0)] = 0; x[0] === 0. Actual: ' + (x[0])); +} //CHECK#2 var y = []; y[new Number(1)] = 1; if (y[1] !== 1) { - $ERROR('#2: y = []; y[new Number(1)] = 1; y[1] === 1. Actual: ' + (y[1])); + $ERROR('#2: y = []; y[new Number(1)] = 1; y[1] === 1. Actual: ' + (y[1])); } //CHECK#3 var z = []; z[new Number(1.1)] = 1; if (z["1.1"] !== 1) { - $ERROR('#3: z = []; z[new Number(1.1)] = 1; z["1.1"] === 1. Actual: ' + (z["1.1"])); + $ERROR('#3: z = []; z[new Number(1.1)] = 1; z["1.1"] === 1. Actual: ' + (z["1.1"])); } diff --git a/test/built-ins/Array/S15.4_A1.1_T8.js b/test/built-ins/Array/S15.4_A1.1_T8.js index 3036b8acc3453e6c321137c1a6bff3b24ddefebd..349c592ee3e45c8b5a42c7465091d6e4af98d674 100644 --- a/test/built-ins/Array/S15.4_A1.1_T8.js +++ b/test/built-ins/Array/S15.4_A1.1_T8.js @@ -13,19 +13,19 @@ description: Checking for Number object var x = []; x[new String("0")] = 0; if (x[0] !== 0) { - $ERROR('#1: x = []; x[new String("0")] = 0; x[0] === 0. Actual: ' + (x[0])); -} + $ERROR('#1: x = []; x[new String("0")] = 0; x[0] === 0. Actual: ' + (x[0])); +} //CHECK#2 var y = []; y[new String("1")] = 1; if (y[1] !== 1) { - $ERROR('#2: y = []; y[new String("1")] = 1; y[1] === 1. Actual: ' + (y[1])); + $ERROR('#2: y = []; y[new String("1")] = 1; y[1] === 1. Actual: ' + (y[1])); } //CHECK#3 var z = []; z[new String("1.1")] = 1; if (z["1.1"] !== 1) { - $ERROR('#3: z = []; z[new String("1.1")] = 1; z["1.1"] === 1. Actual: ' + (z["1.1"])); + $ERROR('#3: z = []; z[new String("1.1")] = 1; z["1.1"] === 1. Actual: ' + (z["1.1"])); } diff --git a/test/built-ins/Array/S15.4_A1.1_T9.js b/test/built-ins/Array/S15.4_A1.1_T9.js index 645a512eebd6314243c4c2118f764807538dbfe8..ec8acc45a3f175927b5f779fe962390211f1d26c 100644 --- a/test/built-ins/Array/S15.4_A1.1_T9.js +++ b/test/built-ins/Array/S15.4_A1.1_T9.js @@ -11,7 +11,11 @@ description: If Type(value) is Object, evaluate ToPrimitive(value, String) //CHECK#1 var x = []; -var object = {valueOf: function() {return 1}}; +var object = { + valueOf: function() { + return 1 + } +}; x[object] = 0; if (x["[object Object]"] !== 0) { $ERROR('#1: x = []; var object = {valueOf: function() {return 1}}; x[object] = 0; x["[object Object]"] === 0. Actual: ' + (x["[object Object]"])); @@ -19,15 +23,29 @@ if (x["[object Object]"] !== 0) { //CHECK#2 x = []; -var object = {valueOf: function() {return 1}, toString: function() {return 0}}; +var object = { + valueOf: function() { + return 1 + }, + toString: function() { + return 0 + } +}; x[object] = 0; if (x[0] !== 0) { $ERROR('#2: x = []; var object = {valueOf: function() {return 1}, toString: function() {return 0}}; x[object] = 0; x[0] === 0. Actual: ' + (x[0])); -} +} //CHECK#3 x = []; -var object = {valueOf: function() {return 1}, toString: function() {return {}}}; +var object = { + valueOf: function() { + return 1 + }, + toString: function() { + return {} + } +}; x[object] = 0; if (x[1] !== 0) { $ERROR('#3: x = []; var object = {valueOf: function() {return 1}, toString: function() {return {}}}; x[object] = 0; x[1] === 0. Actual: ' + (x[1])); @@ -35,8 +53,15 @@ if (x[1] !== 0) { //CHECK#4 try { - x = []; - var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; + x = []; + var object = { + valueOf: function() { + throw "error" + }, + toString: function() { + return 1 + } + }; x[object] = 0; if (x[1] !== 0) { $ERROR('#4.1: x = []; var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x[object] = 0; x[1] === 1. Actual: ' + (x[1])); @@ -52,7 +77,11 @@ catch (e) { //CHECK#5 x = []; -var object = {toString: function() {return 1}}; +var object = { + toString: function() { + return 1 + } +}; x[object] = 0; if (x[1] !== 0) { $ERROR('#5: x = []; var object = {toString: function() {return 1}}; x[object] = 0; x[1] === 0. Actual: ' + (x[1])); @@ -60,7 +89,14 @@ if (x[1] !== 0) { //CHECK#6 x = []; -var object = {valueOf: function() {return {}}, toString: function() {return 1}} +var object = { + valueOf: function() { + return {} + }, + toString: function() { + return 1 + } +} x[object] = 0; if (x[1] !== 0) { $ERROR('#6: x = []; var object = {valueOf: function() {return {}}, toString: function() {return 1}}; x[object] = 0; x[1] === 0. Actual: ' + (x[1])); @@ -69,25 +105,39 @@ if (x[1] !== 0) { //CHECK#7 try { x = []; - var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; - x[object]; + var object = { + valueOf: function() { + return 1 + }, + toString: function() { + throw "error" + } + }; + x[object]; $ERROR('#7.1: x = []; var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; x[object] throw "error". Actual: ' + (x[object])); -} +} catch (e) { if (e !== "error") { $ERROR('#7.2: x = []; var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; x[object] throw "error". Actual: ' + (e)); - } + } } //CHECK#8 try { x = []; - var object = {valueOf: function() {return {}}, toString: function() {return {}}}; + var object = { + valueOf: function() { + return {} + }, + toString: function() { + return {} + } + }; x[object]; $ERROR('#8.1: x = []; var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x[object] throw TypeError. Actual: ' + (x[object])); -} +} catch (e) { if ((e instanceof TypeError) !== true) { $ERROR('#8.2: x = []; var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x[object] throw TypeError. Actual: ' + (e)); - } + } } diff --git a/test/built-ins/Array/from/Array.from_forwards-length-for-array-likes.js b/test/built-ins/Array/from/Array.from_forwards-length-for-array-likes.js index 4718751cb22071b080f617db24108649a6977303..311bc7780fcf9c0aab1feb0284d8c717acc9b201 100644 --- a/test/built-ins/Array/from/Array.from_forwards-length-for-array-likes.js +++ b/test/built-ins/Array/from/Array.from_forwards-length-for-array-likes.js @@ -28,7 +28,9 @@ function MyCollection() { this.args = arguments; } -result = Array.from.call(MyCollection, {length: 42}); +result = Array.from.call(MyCollection, { + length: 42 +}); assert.sameValue(result.args.length, 1); assert.sameValue(result.args[0], 42); diff --git a/test/built-ins/Array/from/calling-from-valid-1-noStrict.js b/test/built-ins/Array/from/calling-from-valid-1-noStrict.js index 201736051e71215732d2563d9ae6e922f43b65d0..eb0d24aa449c49c8d84727829dd60638825c4f3f 100644 --- a/test/built-ins/Array/from/calling-from-valid-1-noStrict.js +++ b/test/built-ins/Array/from/calling-from-valid-1-noStrict.js @@ -34,7 +34,7 @@ var list = { }; var calls = []; -function mapFn (value) { +function mapFn(value) { calls.push({ args: arguments, thisArg: this diff --git a/test/built-ins/Array/from/calling-from-valid-1-onlyStrict.js b/test/built-ins/Array/from/calling-from-valid-1-onlyStrict.js index 8415045f778805b3031a87ffdbb24533857eabfa..68abe0f44a1ef8def538ed7d4337987cc17761d7 100644 --- a/test/built-ins/Array/from/calling-from-valid-1-onlyStrict.js +++ b/test/built-ins/Array/from/calling-from-valid-1-onlyStrict.js @@ -34,7 +34,7 @@ var list = { }; var calls = []; -function mapFn (value) { +function mapFn(value) { calls.push({ args: arguments, thisArg: this diff --git a/test/built-ins/Array/from/calling-from-valid-2.js b/test/built-ins/Array/from/calling-from-valid-2.js index 50be8469c804a9bd1d9dcdc33a52266f9469669f..139c9818c1216fc69d753bf38f460df5274b1c15 100644 --- a/test/built-ins/Array/from/calling-from-valid-2.js +++ b/test/built-ins/Array/from/calling-from-valid-2.js @@ -35,7 +35,7 @@ var list = { var calls = []; var thisArg = {}; -function mapFn (value) { +function mapFn(value) { calls.push({ args: arguments, thisArg: this diff --git a/test/built-ins/Array/from/elements-added-after.js b/test/built-ins/Array/from/elements-added-after.js index 9aafe597ac2c8e1b9bdfd8990004659274e886a8..a8ff21a0c1aa1d01eaa21ad3421e0880938687d1 100644 --- a/test/built-ins/Array/from/elements-added-after.js +++ b/test/built-ins/Array/from/elements-added-after.js @@ -10,23 +10,24 @@ es6id: 22.1.2.1 var arrayIndex = -1; var originalLength = 7; var obj = { - length: originalLength, - 0: 2, - 1: 4, - 2: 8, - 3: 16, - 4: 32, - 5: 64, - 6: 128 + length: originalLength, + 0: 2, + 1: 4, + 2: 8, + 3: 16, + 4: 32, + 5: 64, + 6: 128 }; -var array = [ 2, 4, 8, 16, 32, 64, 128 ]; +var array = [2, 4, 8, 16, 32, 64, 128]; + function mapFn(value, index) { - arrayIndex++; - assert.sameValue(value, obj[arrayIndex], "Value mismatch in mapFn at index " + index + "."); - assert.sameValue(index, arrayIndex, "Index mismatch in mapFn."); - obj[originalLength + arrayIndex] = 2 * arrayIndex + 1; + arrayIndex++; + assert.sameValue(value, obj[arrayIndex], "Value mismatch in mapFn at index " + index + "."); + assert.sameValue(index, arrayIndex, "Index mismatch in mapFn."); + obj[originalLength + arrayIndex] = 2 * arrayIndex + 1; - return obj[arrayIndex]; + return obj[arrayIndex]; } @@ -34,5 +35,5 @@ var a = Array.from(obj, mapFn); assert.sameValue(a.length, array.length, "Length mismatch."); for (var j = 0; j < a.length; j++) { - assert.sameValue(a[j], array[j], "Element mismatch for array at index " + j + "."); + assert.sameValue(a[j], array[j], "Element mismatch for array at index " + j + "."); } diff --git a/test/built-ins/Array/from/elements-deleted-after.js b/test/built-ins/Array/from/elements-deleted-after.js index d2d72e51e6fdacd896af5736940d2ce8e2d28bbd..02f7453293a2ee75cb0c19116b02cbd1836e831b 100644 --- a/test/built-ins/Array/from/elements-deleted-after.js +++ b/test/built-ins/Array/from/elements-deleted-after.js @@ -9,17 +9,18 @@ esid: sec-array.from es6id: 22.1.2.1 ---*/ -var originalArray = [ 0, 1, -2, 4, -8, 16 ]; -var array = [ 0, 1, -2, 4, -8, 16 ]; +var originalArray = [0, 1, -2, 4, -8, 16]; +var array = [0, 1, -2, 4, -8, 16]; var a = []; var arrayIndex = -1; + function mapFn(value, index) { - this.arrayIndex++; - assert.sameValue(value, array[this.arrayIndex], "Value mismatch in mapFn at index " + index + "."); - assert.sameValue(index, this.arrayIndex, "Index mismatch in mapFn."); + this.arrayIndex++; + assert.sameValue(value, array[this.arrayIndex], "Value mismatch in mapFn at index " + index + "."); + assert.sameValue(index, this.arrayIndex, "Index mismatch in mapFn."); - array.splice(array.length - 1, 1); - return 127; + array.splice(array.length - 1, 1); + return 127; } @@ -28,5 +29,5 @@ a = Array.from(array, mapFn, this); assert.sameValue(a.length, originalArray.length / 2, "Length mismatch. Old array : " + (originalArray.length / 2) + ". array : " + a.length + "."); for (var j = 0; j < originalArray.length / 2; j++) { - assert.sameValue(a[j], 127, "Element mismatch for mapped array at index " + j + "."); + assert.sameValue(a[j], 127, "Element mismatch for mapped array at index " + j + "."); } diff --git a/test/built-ins/Array/from/elements-updated-after.js b/test/built-ins/Array/from/elements-updated-after.js index 6c859e23accaa947bb85e903b366152ae1f0110e..358e94b46e19a618fa219e0c214a6572a50c8609 100644 --- a/test/built-ins/Array/from/elements-updated-after.js +++ b/test/built-ins/Array/from/elements-updated-after.js @@ -7,21 +7,22 @@ esid: sec-array.from es6id: 22.1.2.1 ---*/ -var array = [ 127, 4, 8, 16, 32, 64, 128 ]; +var array = [127, 4, 8, 16, 32, 64, 128]; var arrayIndex = -1; + function mapFn(value, index) { - arrayIndex++; - if (index + 1 < array.length) { - array[index + 1] = 127; - } - assert.sameValue(value, 127, "Value mismatch in mapFn at index " + index + "."); - assert.sameValue(index, arrayIndex, "Index mismatch in mapFn."); + arrayIndex++; + if (index + 1 < array.length) { + array[index + 1] = 127; + } + assert.sameValue(value, 127, "Value mismatch in mapFn at index " + index + "."); + assert.sameValue(index, arrayIndex, "Index mismatch in mapFn."); - return value; + return value; } var a = Array.from(array, mapFn); assert.sameValue(a.length, array.length, "Length mismatch."); for (var j = 0; j < a.length; j++) { - assert.sameValue(a[j], 127, "Element mismatch for mapped array."); + assert.sameValue(a[j], 127, "Element mismatch for mapped array."); } diff --git a/test/built-ins/Array/from/iter-cstm-ctor.js b/test/built-ins/Array/from/iter-cstm-ctor.js index dfd64566fcd807491de30f8944ad2a04e58c8673..d9a137695d134e57d77fa3adc723e1502f92a192 100644 --- a/test/built-ins/Array/from/iter-cstm-ctor.js +++ b/test/built-ins/Array/from/iter-cstm-ctor.js @@ -27,7 +27,9 @@ var items = {}; items[Symbol.iterator] = function() { return { next: function() { - return { done: true }; + return { + done: true + }; } }; }; diff --git a/test/built-ins/Array/from/iter-map-fn-args.js b/test/built-ins/Array/from/iter-map-fn-args.js index f63fec612f221f30ee432d3c32de3d413c495f64..56097d708c46effd286aa2a5d268259b664833c6 100644 --- a/test/built-ins/Array/from/iter-map-fn-args.js +++ b/test/built-ins/Array/from/iter-map-fn-args.js @@ -26,8 +26,14 @@ features: [Symbol.iterator] ---*/ var args = []; -var firstResult = { done: false, value: {} }; -var secondResult = { done: false, value: {} }; +var firstResult = { + done: false, + value: {} +}; +var secondResult = { + done: false, + value: {} +}; var mapFn = function(value, idx) { args.push(arguments); }; @@ -40,7 +46,9 @@ items[Symbol.iterator] = function() { next: function() { var result = nextResult; nextResult = nextNextResult; - nextNextResult = { done: true }; + nextNextResult = { + done: true + }; return result; } diff --git a/test/built-ins/Array/from/iter-map-fn-return.js b/test/built-ins/Array/from/iter-map-fn-return.js index 58e175048f718652177d5ddb85990605f8606c51..484ce71746e3335c8a7e1de8b8535a6a6259cee7 100644 --- a/test/built-ins/Array/from/iter-map-fn-return.js +++ b/test/built-ins/Array/from/iter-map-fn-return.js @@ -25,8 +25,14 @@ features: [Symbol.iterator] ---*/ var thisVals = []; -var nextResult = { done: false, value: {} }; -var nextNextResult = { done: false, value: {} }; +var nextResult = { + done: false, + value: {} +}; +var nextNextResult = { + done: false, + value: {} +}; var firstReturnVal = {}; var secondReturnVal = {}; var mapFn = function(value, idx) { @@ -45,7 +51,9 @@ items[Symbol.iterator] = function() { next: function() { var result = nextResult; nextResult = nextNextResult; - nextNextResult = { done: true }; + nextNextResult = { + done: true + }; return result; } diff --git a/test/built-ins/Array/from/iter-map-fn-this-arg.js b/test/built-ins/Array/from/iter-map-fn-this-arg.js index 5e12157bb3506eb45c4e90c6d98c126bad74dc22..d10e9f8626766de2b3dfc1a62abb63dd68602aea 100644 --- a/test/built-ins/Array/from/iter-map-fn-this-arg.js +++ b/test/built-ins/Array/from/iter-map-fn-this-arg.js @@ -23,8 +23,14 @@ features: [Symbol.iterator] ---*/ var thisVals = []; -var nextResult = { done: false, value: {} }; -var nextNextResult = { done: false, value: {} }; +var nextResult = { + done: false, + value: {} +}; +var nextNextResult = { + done: false, + value: {} +}; var mapFn = function() { thisVals.push(this); }; @@ -36,7 +42,9 @@ items[Symbol.iterator] = function() { next: function() { var result = nextResult; nextResult = nextNextResult; - nextNextResult = { done: true }; + nextNextResult = { + done: true + }; return result; } diff --git a/test/built-ins/Array/from/iter-map-fn-this-non-strict.js b/test/built-ins/Array/from/iter-map-fn-this-non-strict.js index 81022307aa4fc7da70c9b6edec07e0caf0853254..0bb30453eaa2936052020f152a42f17318502ef3 100644 --- a/test/built-ins/Array/from/iter-map-fn-this-non-strict.js +++ b/test/built-ins/Array/from/iter-map-fn-this-non-strict.js @@ -24,20 +24,30 @@ flags: [noStrict] ---*/ var thisVals = []; -var nextResult = { done: false, value: {} }; -var nextNextResult = { done: false, value: {} }; +var nextResult = { + done: false, + value: {} +}; +var nextNextResult = { + done: false, + value: {} +}; var mapFn = function() { thisVals.push(this); }; var items = {}; -var global = function() { return this; }(); +var global = function() { + return this; +}(); items[Symbol.iterator] = function() { return { next: function() { var result = nextResult; nextResult = nextNextResult; - nextNextResult = { done: true }; + nextNextResult = { + done: true + }; return result; } diff --git a/test/built-ins/Array/from/iter-map-fn-this-strict.js b/test/built-ins/Array/from/iter-map-fn-this-strict.js index cfe576a5bbac094066056d8180303ad68b441b70..d9a62dabc2ee56d8f6bbc00b3f7edfa8b169d0f8 100644 --- a/test/built-ins/Array/from/iter-map-fn-this-strict.js +++ b/test/built-ins/Array/from/iter-map-fn-this-strict.js @@ -24,8 +24,14 @@ flags: [onlyStrict] ---*/ var thisVals = []; -var nextResult = { done: false, value: {} }; -var nextNextResult = { done: false, value: {} }; +var nextResult = { + done: false, + value: {} +}; +var nextNextResult = { + done: false, + value: {} +}; var mapFn = function() { thisVals.push(this); }; @@ -36,7 +42,9 @@ items[Symbol.iterator] = function() { next: function() { var result = nextResult; nextResult = nextNextResult; - nextNextResult = { done: true }; + nextNextResult = { + done: true + }; return result; } diff --git a/test/built-ins/Array/from/iter-set-elem-prop-err.js b/test/built-ins/Array/from/iter-set-elem-prop-err.js index 07f2c59422e94b849234b834c49ddd51764522b8..2f23b4f0cfdabfca0bae398af2fbafdbcb2067e6 100644 --- a/test/built-ins/Array/from/iter-set-elem-prop-err.js +++ b/test/built-ins/Array/from/iter-set-elem-prop-err.js @@ -18,11 +18,15 @@ features: [Symbol.iterator] ---*/ var C = function() { - Object.defineProperty(this, '0', { configurable: false }); + Object.defineProperty(this, '0', { + configurable: false + }); }; var closeCount = 0; var items = {}; -var nextResult = { done: false }; +var nextResult = { + done: false +}; items[Symbol.iterator] = function() { return { @@ -32,7 +36,9 @@ items[Symbol.iterator] = function() { next: function() { var result = nextResult; - nextResult = { done: true }; + nextResult = { + done: true + }; return result; } diff --git a/test/built-ins/Array/from/iter-set-elem-prop.js b/test/built-ins/Array/from/iter-set-elem-prop.js index 7658bdd13c60eb4fe602b21c1c05062fa6cb7863..6f56116dbfd509d0cc0ecb7e9a17dd9d6032ac13 100644 --- a/test/built-ins/Array/from/iter-set-elem-prop.js +++ b/test/built-ins/Array/from/iter-set-elem-prop.js @@ -16,9 +16,18 @@ features: [Symbol.iterator] ---*/ var items = {}; -var firstIterResult = { done: false, value: {} }; -var secondIterResult = { done: false, value: {} }; -var thirdIterResult = { done: true, value: {} }; +var firstIterResult = { + done: false, + value: {} +}; +var secondIterResult = { + done: false, + value: {} +}; +var thirdIterResult = { + done: true, + value: {} +}; var nextIterResult = firstIterResult; var nextNextIterResult = secondIterResult; var result; diff --git a/test/built-ins/Array/from/iter-set-length-err.js b/test/built-ins/Array/from/iter-set-length-err.js index d15631db9bcc9990d5750e809b958a5153a7eaec..4cd0e0001af185febbe5afcd34e6946862429354 100644 --- a/test/built-ins/Array/from/iter-set-length-err.js +++ b/test/built-ins/Array/from/iter-set-length-err.js @@ -25,7 +25,11 @@ Object.defineProperty(C.prototype, 'length', { }); items[Symbol.iterator] = function() { return { - next: function() { return { done: true }; } + next: function() { + return { + done: true + }; + } }; }; diff --git a/test/built-ins/Array/from/iter-set-length.js b/test/built-ins/Array/from/iter-set-length.js index ab0e221bf6706024de9b06fc56a10cc8714d7d3d..c00ac5698f0a87258ee7ca940bcd23751910fe13 100644 --- a/test/built-ins/Array/from/iter-set-length.js +++ b/test/built-ins/Array/from/iter-set-length.js @@ -29,13 +29,19 @@ items[Symbol.iterator] = function() { }; }; -nextIterResult = lastIterResult = { done: true }; +nextIterResult = lastIterResult = { + done: true +}; result = Array.from(items); assert.sameValue(result.length, 0); -nextIterResult = { done: false }; -lastIterResult = { done: true }; +nextIterResult = { + done: false +}; +lastIterResult = { + done: true +}; result = Array.from(items); assert.sameValue(result.length, 1); diff --git a/test/built-ins/Array/from/mapfn-throws-exception.js b/test/built-ins/Array/from/mapfn-throws-exception.js index a655126726e7102f9d52aa78747df289e5aaf9b2..a87898bf853ae697cab5742e83e9e31561df47c2 100644 --- a/test/built-ins/Array/from/mapfn-throws-exception.js +++ b/test/built-ins/Array/from/mapfn-throws-exception.js @@ -7,9 +7,12 @@ esid: sec-array.from es6id: 22.1.2.1 ---*/ -var array = [ 2, 4, 8, 16, 32, 64, 128 ]; +var array = [2, 4, 8, 16, 32, 64, 128]; + function mapFn(value, index, obj) { - throw new Test262Error(); + throw new Test262Error(); } -assert.throws(Test262Error, function(){Array.from(array, mapFn);}); +assert.throws(Test262Error, function() { + Array.from(array, mapFn); +}); diff --git a/test/built-ins/Array/from/source-array-boundary.js b/test/built-ins/Array/from/source-array-boundary.js index 4c0587a3203b676e29bb1b248af20e32f1ac9f11..9dad81729358733781d37ab4b6115ce1519e6058 100644 --- a/test/built-ins/Array/from/source-array-boundary.js +++ b/test/built-ins/Array/from/source-array-boundary.js @@ -7,14 +7,15 @@ esid: sec-array.from es6id: 22.1.2.1 ---*/ -var array = [ Number.MAX_VALUE, Number.MIN_VALUE, Number.NaN, Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY ]; +var array = [Number.MAX_VALUE, Number.MIN_VALUE, Number.NaN, Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY]; var arrayIndex = -1; + function mapFn(value, index) { - this.arrayIndex++; - assert.sameValue(value, array[this.arrayIndex], "Value mismatch in mapFn at index " + index + "."); - assert.sameValue(index, this.arrayIndex, "Index mismatch in mapFn."); + this.arrayIndex++; + assert.sameValue(value, array[this.arrayIndex], "Value mismatch in mapFn at index " + index + "."); + assert.sameValue(index, this.arrayIndex, "Index mismatch in mapFn."); - return value; + return value; } var a = Array.from(array, mapFn, this); diff --git a/test/built-ins/Array/from/source-object-iterator-1.js b/test/built-ins/Array/from/source-object-iterator-1.js index 94834b5cf023256ac7e68b5a8a73df5aae5436c2..6ac364ac5411983543891dd7d36056c9d1283aad 100644 --- a/test/built-ins/Array/from/source-object-iterator-1.js +++ b/test/built-ins/Array/from/source-object-iterator-1.js @@ -8,23 +8,25 @@ es6id: 22.1.2.1 features: [Symbol.iterator] ---*/ -var array = [ 2, 4, 8, 16, 32, 64, 128 ]; +var array = [2, 4, 8, 16, 32, 64, 128]; var obj = { - [Symbol.iterator]() { - return { - index: 0, - next() { - throw new Test262Error(); - }, - isDone : false, - get val() { - this.index++; - if (this.index > 7) { - this.isDone = true; - } - return 1 << this.index; - } - }; - } + [Symbol.iterator]() { + return { + index: 0, + next() { + throw new Test262Error(); + }, + isDone: false, + get val() { + this.index++; + if (this.index > 7) { + this.isDone = true; + } + return 1 << this.index; + } + }; + } }; -assert.throws(Test262Error, function(){Array.from(obj);}); +assert.throws(Test262Error, function() { + Array.from(obj); +}); diff --git a/test/built-ins/Array/from/source-object-iterator-2.js b/test/built-ins/Array/from/source-object-iterator-2.js index 9bcd57053783dd04c0ffcc3fda61dbb836eefc01..619405c34778faec13eb64144f980057bab2d082 100644 --- a/test/built-ins/Array/from/source-object-iterator-2.js +++ b/test/built-ins/Array/from/source-object-iterator-2.js @@ -8,30 +8,30 @@ es6id: 22.1.2.1 features: [Symbol.iterator] ---*/ -var array = [ 2, 4, 8, 16, 32, 64, 128 ]; +var array = [2, 4, 8, 16, 32, 64, 128]; var obj = { - [Symbol.iterator]() { + [Symbol.iterator]() { + return { + index: 0, + next() { return { - index: 0, - next() { - return { - value: this.val, - done: this.isDone - }; - }, - isDone : false, - get val() { - this.index++; - if (this.index > 7) { - this.isDone = true; - } - return 1 << this.index; - } + value: this.val, + done: this.isDone }; - } + }, + isDone: false, + get val() { + this.index++; + if (this.index > 7) { + this.isDone = true; + } + return 1 << this.index; + } + }; + } }; var a = Array.from.call(Object, obj); assert.sameValue(typeof a, typeof {}, "The returned type is expected to be object."); for (var j = 0; j < a.length; j++) { - assert.sameValue(a[j], array[j], "Elements mismatch at " + j + "."); + assert.sameValue(a[j], array[j], "Elements mismatch at " + j + "."); } diff --git a/test/built-ins/Array/from/source-object-length.js b/test/built-ins/Array/from/source-object-length.js index 75c46dfc4ba6dbf8fc89b1125f50cd0a2bd78820..4127f5ec07195a9122ad41d6eb116f990ebffae0 100644 --- a/test/built-ins/Array/from/source-object-length.js +++ b/test/built-ins/Array/from/source-object-length.js @@ -12,14 +12,14 @@ es6id: 22.1.2.1 var array = [2, 4, 0, 16]; var expectedArray = [2, 4, , 16]; var obj = { - length : 4, - 0 : 2, - 1 : 4, - 2 : 0, - 3 : 16 + length: 4, + 0: 2, + 1: 4, + 2: 0, + 3: 16 }; delete obj[2]; var a = Array.from(obj); for (var j = 0; j < expectedArray.length; j++) { - assert.sameValue(a[j], expectedArray[j], "Elements mismatch at " + j + "."); + assert.sameValue(a[j], expectedArray[j], "Elements mismatch at " + j + "."); } diff --git a/test/built-ins/Array/from/source-object-missing.js b/test/built-ins/Array/from/source-object-missing.js index ad5a6055dc7ed755f0b25172b1c908f8e74e7ba9..3c55030dac798d4a3ee2209b9163ce471a8a8822 100644 --- a/test/built-ins/Array/from/source-object-missing.js +++ b/test/built-ins/Array/from/source-object-missing.js @@ -9,14 +9,14 @@ es6id: 22.1.2.1 var array = [2, 4, , 16]; var obj = { - length: 4, - 0: 2, - 1: 4, - 3: 16 + length: 4, + 0: 2, + 1: 4, + 3: 16 }; var a = Array.from.call(Object, obj); assert.sameValue(typeof a, "object", "The returned type is expected to be object."); for (var j = 0; j < a.length; j++) { - assert.sameValue(a[j], array[j], "Elements mismatch at " + j + "."); + assert.sameValue(a[j], array[j], "Elements mismatch at " + j + "."); } diff --git a/test/built-ins/Array/from/source-object-without.js b/test/built-ins/Array/from/source-object-without.js index 96ec31c25a7258729905399f28007ba8142f79f4..fbb1877822392990964020913124ce1f829f552c 100644 --- a/test/built-ins/Array/from/source-object-without.js +++ b/test/built-ins/Array/from/source-object-without.js @@ -8,10 +8,10 @@ es6id: 22.1.2.1 ---*/ var obj = { - 0: 2, - 1: 4, - 2: 8, - 3: 16 + 0: 2, + 1: 4, + 2: 8, + 3: 16 } var a = Array.from(obj); diff --git a/test/built-ins/Array/isArray/15.4.3.2-0-4.js b/test/built-ins/Array/isArray/15.4.3.2-0-4.js index f422cc1442d2ae1f953a2b586e3b02f4544f4c66..79302299fb07b5f53a7334268d1f4e39d1a4a523 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-0-4.js +++ b/test/built-ins/Array/isArray/15.4.3.2-0-4.js @@ -7,12 +7,12 @@ es5id: 15.4.3.2-0-4 description: Array.isArray return false if its argument is not an Array ---*/ -var b_num = Array.isArray(42); +var b_num = Array.isArray(42); var b_undef = Array.isArray(undefined); -var b_bool = Array.isArray(true); -var b_str = Array.isArray("abc"); -var b_obj = Array.isArray({}); -var b_null = Array.isArray(null); +var b_bool = Array.isArray(true); +var b_str = Array.isArray("abc"); +var b_obj = Array.isArray({}); +var b_null = Array.isArray(null); assert.sameValue(b_num, false, 'b_num'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-13.js b/test/built-ins/Array/isArray/15.4.3.2-1-13.js index 9a55d9a0c6cdcd489a759711673f339a7f204c43..cbc0721a670bd738ef9678c3907f8be0d229fec3 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-13.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-13.js @@ -10,7 +10,7 @@ description: Array.isArray applied to Arguments object var arg; (function fun() { - arg = arguments; + arg = arguments; }(1, 2, 3)); assert.sameValue(Array.isArray(arg), false, 'Array.isArray(arg)'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-7.js b/test/built-ins/Array/isArray/15.4.3.2-1-7.js index 6f807595c9ef2c114692c2aa47c1b389320b7fe4..412226c33066d981becc1764a3969636e99b3bbd 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-7.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-7.js @@ -7,4 +7,4 @@ es5id: 15.4.3.2-1-7 description: Array.isArray applied to Function object ---*/ -assert.sameValue(Array.isArray(function () { }), false, 'Array.isArray(function () { })'); +assert.sameValue(Array.isArray(function() {}), false, 'Array.isArray(function () { })'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-2-1.js b/test/built-ins/Array/isArray/15.4.3.2-2-1.js index 302f9cbe8112b7f79e77bbcf0811555e5386c24a..d0a5ed7fcaea6f2cdcfb8973cdc15146ed0acf2e 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-2-1.js +++ b/test/built-ins/Array/isArray/15.4.3.2-2-1.js @@ -8,7 +8,7 @@ description: Array.isArray applied to an object with an array as the prototype ---*/ var proto = []; -var Con = function () { }; +var Con = function() {}; Con.prototype = proto; var child = new Con(); diff --git a/test/built-ins/Array/isArray/15.4.3.2-2-2.js b/test/built-ins/Array/isArray/15.4.3.2-2-2.js index 84a6e929ea2f0aa8151167b3ee6142638fe44eae..d0bec2d46886150def4e71ba5087b54a166f1a5b 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-2-2.js +++ b/test/built-ins/Array/isArray/15.4.3.2-2-2.js @@ -9,10 +9,10 @@ description: > prototype ---*/ - var proto = Array.prototype; - var Con = function () { }; - Con.prototype = proto; +var proto = Array.prototype; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); +var child = new Con(); assert.sameValue(Array.isArray(child), false, 'Array.isArray(child)'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-2-3.js b/test/built-ins/Array/isArray/15.4.3.2-2-3.js index 626e837206bf097f4044517aa564fbbe0ec30fb4..02da7c14310dc53b7f764c72cabbf454871220e0 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-2-3.js +++ b/test/built-ins/Array/isArray/15.4.3.2-2-3.js @@ -9,4 +9,8 @@ description: > indexed properties ---*/ -assert.sameValue(Array.isArray({ 0: 12, 1: 9, length: 2 }), false, 'Array.isArray({ 0: 12, 1: 9, length: 2 })'); +assert.sameValue(Array.isArray({ + 0: 12, + 1: 9, + length: 2 +}), false, 'Array.isArray({ 0: 12, 1: 9, length: 2 })'); diff --git a/test/built-ins/Array/length/15.4.5.1-3.d-1.js b/test/built-ins/Array/length/15.4.5.1-3.d-1.js index 651cf5c1177c9481e308d2a464164ec553ae00ce..95258567205586d36711a7ae6a57476ef9bf4a08 100644 --- a/test/built-ins/Array/length/15.4.5.1-3.d-1.js +++ b/test/built-ins/Array/length/15.4.5.1-3.d-1.js @@ -11,5 +11,5 @@ description: > assert.throws(RangeError, function() { - [].length = 4294967296 ; + [].length = 4294967296; }); diff --git a/test/built-ins/Array/length/15.4.5.1-3.d-2.js b/test/built-ins/Array/length/15.4.5.1-3.d-2.js index 7e1dc6a255b063983a9f742b8fc3a0699fb5cd10..2162edb4a2cf4bad81adb4bc07cff851076d5bf0 100644 --- a/test/built-ins/Array/length/15.4.5.1-3.d-2.js +++ b/test/built-ins/Array/length/15.4.5.1-3.d-2.js @@ -11,5 +11,5 @@ description: > assert.throws(RangeError, function() { - [].length = 4294967297 ; + [].length = 4294967297; }); diff --git a/test/built-ins/Array/length/15.4.5.1-3.d-3.js b/test/built-ins/Array/length/15.4.5.1-3.d-3.js index 38e35422471a911d3a7271beced0808b079aed56..7c03867da7d8f88b3b26467bcc22882abd9c2007 100644 --- a/test/built-ins/Array/length/15.4.5.1-3.d-3.js +++ b/test/built-ins/Array/length/15.4.5.1-3.d-3.js @@ -7,7 +7,7 @@ es5id: 15.4.5.1-3.d-3 description: Set array length property to max value 4294967295 (2**32-1,) ---*/ - var a =[]; - a.length = 4294967295 ; +var a = []; +a.length = 4294967295; assert.sameValue(a.length, 4294967295, 'a.length'); diff --git a/test/built-ins/Array/length/S15.4.2.2_A2.2_T1.js b/test/built-ins/Array/length/S15.4.2.2_A2.2_T1.js index 0b659bf9bc6f9fa3408f05c68991066ca7e3908b..d0c216a9677286c6df33b2a53f6f099b7139ea0f 100644 --- a/test/built-ins/Array/length/S15.4.2.2_A2.2_T1.js +++ b/test/built-ins/Array/length/S15.4.2.2_A2.2_T1.js @@ -14,7 +14,7 @@ description: Use try statement. len = -1, 4294967296, 4294967297 try { new Array(-1); $ERROR('#1.1: new Array(-1) throw RangeError. Actual: ' + (new Array(-1))); -} catch(e) { +} catch (e) { if ((e instanceof RangeError) !== true) { $ERROR('#1.2: new Array(-1) throw RangeError. Actual: ' + (e)); } @@ -24,7 +24,7 @@ try { try { new Array(4294967296); $ERROR('#2.1: new Array(4294967296) throw RangeError. Actual: ' + (new Array(4294967296))); -} catch(e) { +} catch (e) { if ((e instanceof RangeError) !== true) { $ERROR('#2.2: new Array(4294967296) throw RangeError. Actual: ' + (e)); } @@ -34,7 +34,7 @@ try { try { new Array(4294967297); $ERROR('#3.1: new Array(4294967297) throw RangeError. Actual: ' + (new Array(4294967297))); -} catch(e) { +} catch (e) { if ((e instanceof RangeError) !== true) { $ERROR('#3.2: new Array(4294967297) throw RangeError. Actual: ' + (e)); } diff --git a/test/built-ins/Array/length/S15.4.2.2_A2.2_T2.js b/test/built-ins/Array/length/S15.4.2.2_A2.2_T2.js index abe3b60e716e53de5dcb2f9aae99ccd871229c96..3c117d19c661024d3963836e4a25eb5014f4a0ff 100644 --- a/test/built-ins/Array/length/S15.4.2.2_A2.2_T2.js +++ b/test/built-ins/Array/length/S15.4.2.2_A2.2_T2.js @@ -14,7 +14,7 @@ description: Use try statement. len = NaN, +/-Infinity try { new Array(NaN); $ERROR('#1.1: new Array(NaN) throw RangeError. Actual: ' + (new Array(NaN))); -} catch(e) { +} catch (e) { if ((e instanceof RangeError) !== true) { $ERROR('#1.2: new Array(NaN) throw RangeError. Actual: ' + (e)); } @@ -24,7 +24,7 @@ try { try { new Array(Number.POSITIVE_INFINITY); $ERROR('#2.1: new Array(Number.POSITIVE_INFINITY) throw RangeError. Actual: ' + (new Array(Number.POSITIVE_INFINITY))); -} catch(e) { +} catch (e) { if ((e instanceof RangeError) !== true) { $ERROR('#2.2: new Array(Number.POSITIVE_INFINITY) throw RangeError. Actual: ' + (e)); } @@ -34,7 +34,7 @@ try { try { new Array(Number.NEGATIVE_INFINITY); $ERROR('#3.1: new Array(Number.NEGATIVE_INFINITY) throw RangeError. Actual: ' + (new Array(Number.NEGATIVE_INFINITY))); -} catch(e) { +} catch (e) { if ((e instanceof RangeError) !== true) { $ERROR('#3.2: new Array(Number.NEGATIVE_INFINITY) throw RangeError. Actual: ' + (e)); } diff --git a/test/built-ins/Array/length/S15.4.2.2_A2.2_T3.js b/test/built-ins/Array/length/S15.4.2.2_A2.2_T3.js index 9822c925c3a338bc8638e719d305938b5efe3d2c..6cd213037255323632db0156b0c4e4682f623c8b 100644 --- a/test/built-ins/Array/length/S15.4.2.2_A2.2_T3.js +++ b/test/built-ins/Array/length/S15.4.2.2_A2.2_T3.js @@ -14,7 +14,7 @@ description: Use try statement. len = 1.5, Number.MAX_VALUE, Number.MIN_VALUE try { new Array(1.5); $ERROR('#1.1: new Array(1.5) throw RangeError. Actual: ' + (new Array(1.5))); -} catch(e) { +} catch (e) { if ((e instanceof RangeError) !== true) { $ERROR('#1.2: new Array(1.5) throw RangeError. Actual: ' + (e)); } @@ -24,7 +24,7 @@ try { try { new Array(Number.MAX_VALUE); $ERROR('#2.1: new Array(Number.MAX_VALUE) throw RangeError. Actual: ' + (new Array(Number.MAX_VALUE))); -} catch(e) { +} catch (e) { if ((e instanceof RangeError) !== true) { $ERROR('#2.2: new Array(Number.MAX_VALUE) throw RangeError. Actual: ' + (e)); } @@ -34,7 +34,7 @@ try { try { new Array(Number.MIN_VALUE); $ERROR('#3.1: new Array(Number.MIN_VALUE) throw RangeError. Actual: ' + (new Array(Number.MIN_VALUE))); -} catch(e) { +} catch (e) { if ((e instanceof RangeError) !== true) { $ERROR('#3.2: new Array(Number.MIN_VALUE) throw RangeError. Actual: ' + (e)); } diff --git a/test/built-ins/Array/length/S15.4.5.1_A1.1_T1.js b/test/built-ins/Array/length/S15.4.5.1_A1.1_T1.js index 7435827c66f9ee4cf077ae77065d13556998e3e3..c09ba6e72fb594d26f2a6a22199e4e1fdb0aa62c 100644 --- a/test/built-ins/Array/length/S15.4.5.1_A1.1_T1.js +++ b/test/built-ins/Array/length/S15.4.5.1_A1.1_T1.js @@ -13,7 +13,7 @@ try { var x = []; x.length = 4294967296; $ERROR('#1.1: x = []; x.length = 4294967296 throw RangeError. Actual: x.length === ' + (x.length)); -} catch(e) { +} catch (e) { if ((e instanceof RangeError) !== true) { $ERROR('#1.2: x = []; x.length = 4294967296 throw RangeError. Actual: ' + (e)); } @@ -24,7 +24,7 @@ try { x = []; x.length = -1; $ERROR('#2.1: x = []; x.length = -1 throw RangeError. Actual: x.length === ' + (x.length)); -} catch(e) { +} catch (e) { if ((e instanceof RangeError) !== true) { $ERROR('#2.2: x = []; x.length = -1 throw RangeError. Actual: ' + (e)); } @@ -35,7 +35,7 @@ try { x = []; x.length = 1.5; $ERROR('#3.1: x = []; x.length = 1.5 throw RangeError. Actual: x.length === ' + (x.length)); -} catch(e) { +} catch (e) { if ((e instanceof RangeError) !== true) { $ERROR('#3.2: x = []; x.length = 1.5 throw RangeError. Actual: ' + (e)); } diff --git a/test/built-ins/Array/length/S15.4.5.1_A1.1_T2.js b/test/built-ins/Array/length/S15.4.5.1_A1.1_T2.js index 55ce904877620fb5a3caf78675411115b22d3a4d..e8ac8faa904d620ab9a9a87e761eef133e728afd 100644 --- a/test/built-ins/Array/length/S15.4.5.1_A1.1_T2.js +++ b/test/built-ins/Array/length/S15.4.5.1_A1.1_T2.js @@ -13,7 +13,7 @@ try { var x = []; x.length = NaN; $ERROR('#1.1: x = []; x.length = NaN throw RangeError. Actual: x.length === ' + (x.length)); -} catch(e) { +} catch (e) { if ((e instanceof RangeError) !== true) { $ERROR('#1.2: x = []; x.length = NaN throw RangeError. Actual: ' + (e)); } @@ -24,7 +24,7 @@ try { x = []; x.length = Number.POSITIVE_INFINITY; $ERROR('#2.1: x = []; x.length = Number.POSITIVE_INFINITY throw RangeError. Actual: x.length === ' + (x.length)); -} catch(e) { +} catch (e) { if ((e instanceof RangeError) !== true) { $ERROR('#2.2: x = []; x.length = Number.POSITIVE_INFINITY throw RangeError. Actual: ' + (e)); } @@ -35,7 +35,7 @@ try { x = []; x.length = Number.NEGATIVE_INFINITY; $ERROR('#3.1: x = []; x.length = Number.NEGATIVE_INFINITY throw RangeError. Actual: x.length === ' + (x.length)); -} catch(e) { +} catch (e) { if ((e instanceof RangeError) !== true) { $ERROR('#3.2: x = []; x.length = Number.NEGATIVE_INFINITY throw RangeError. Actual: ' + (e)); } @@ -46,7 +46,7 @@ try { x = []; x.length = undefined; $ERROR('#4.1: x = []; x.length = undefined throw RangeError. Actual: x.length === ' + (x.length)); -} catch(e) { +} catch (e) { if ((e instanceof RangeError) !== true) { $ERROR('#4.2: x = []; x.length = undefined throw RangeError. Actual: ' + (e)); } diff --git a/test/built-ins/Array/length/S15.4.5.1_A1.2_T1.js b/test/built-ins/Array/length/S15.4.5.1_A1.2_T1.js index d213067fe765382a39a0c24290af08814576df4f..24bccec08fdc4b34385b92ece76112d41a5eb41e 100644 --- a/test/built-ins/Array/length/S15.4.5.1_A1.2_T1.js +++ b/test/built-ins/Array/length/S15.4.5.1_A1.2_T1.js @@ -13,7 +13,7 @@ description: Change length of array ---*/ //CHECK#1 -var x = [0,,2,,4]; +var x = [0, , 2, , 4]; x.length = 4; if (x[4] !== undefined) { $ERROR('#1: x = [0,,2,,4]; x.length = 4; x[4] === undefined. Actual: ' + (x[4])); diff --git a/test/built-ins/Array/length/S15.4.5.1_A1.2_T3.js b/test/built-ins/Array/length/S15.4.5.1_A1.2_T3.js index 0594a6b6a185e7b9a1a812216646b12b19ef274d..f9800a66e31e86622e32dacd19bb0b386a53f382 100644 --- a/test/built-ins/Array/length/S15.4.5.1_A1.2_T3.js +++ b/test/built-ins/Array/length/S15.4.5.1_A1.2_T3.js @@ -14,7 +14,7 @@ description: Checking an inherited property //CHECK#1 Array.prototype[2] = 2; -var x = [0,1]; +var x = [0, 1]; x.length = 3; if (x.hasOwnProperty('2') !== false) { $ERROR('#1: Array.prototype[2] = 2; x = [0,1]; x.length = 3; x.hasOwnProperty(\'2\') === false. Actual: ' + (x.hasOwnProperty('2'))); diff --git a/test/built-ins/Array/length/S15.4.5.1_A1.3_T2.js b/test/built-ins/Array/length/S15.4.5.1_A1.3_T2.js index c9b7615f954ea615989a110900366daed5cc5733..534484231895eca9385e122dc55270b8203c8c90 100644 --- a/test/built-ins/Array/length/S15.4.5.1_A1.3_T2.js +++ b/test/built-ins/Array/length/S15.4.5.1_A1.3_T2.js @@ -10,21 +10,39 @@ description: Uint32 use ToNumber and ToPrimitve //CHECK#1 var x = []; -x.length = {valueOf: function() {return 2}}; +x.length = { + valueOf: function() { + return 2 + } +}; if (x.length !== 2) { $ERROR('#1: x = []; x.length = {valueOf: function() {return 2}}; x.length === 2. Actual: ' + (x.length)); } //CHECK#2 x = []; -x.length = {valueOf: function() {return 2}, toString: function() {return 1}}; +x.length = { + valueOf: function() { + return 2 + }, + toString: function() { + return 1 + } +}; if (x.length !== 2) { $ERROR('#0: x = []; x.length = {valueOf: function() {return 2}, toString: function() {return 1}}; x.length === 2. Actual: ' + (x.length)); } //CHECK#3 x = []; -x.length = {valueOf: function() {return 2}, toString: function() {return {}}}; +x.length = { + valueOf: function() { + return 2 + }, + toString: function() { + return {} + } +}; if (x.length !== 2) { $ERROR('#3: x = []; x.length = {valueOf: function() {return 2}, toString: function() {return {}}}; x.length === 2. Actual: ' + (x.length)); } @@ -32,7 +50,14 @@ if (x.length !== 2) { //CHECK#4 try { x = []; - x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}}; + x.length = { + valueOf: function() { + return 2 + }, + toString: function() { + throw "error" + } + }; if (x.length !== 2) { $ERROR('#4.1: x = []; x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}}; x.length === ",". Actual: ' + (x.length)); } @@ -47,14 +72,25 @@ catch (e) { //CHECK#5 x = []; -x.length = {toString: function() {return 1}}; +x.length = { + toString: function() { + return 1 + } +}; if (x.length !== 1) { $ERROR('#5: x = []; x.length = {toString: function() {return 1}}; x.length === 1. Actual: ' + (x.length)); } //CHECK#6 x = []; -x.length = {valueOf: function() {return {}}, toString: function() {return 1}} +x.length = { + valueOf: function() { + return {} + }, + toString: function() { + return 1 + } +} if (x.length !== 1) { $ERROR('#6: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return 1}}; x.length === 1. Actual: ' + (x.length)); } @@ -62,7 +98,14 @@ if (x.length !== 1) { //CHECK#7 try { x = []; - x.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; + x.length = { + valueOf: function() { + throw "error" + }, + toString: function() { + return 1 + } + }; x.length; $ERROR('#7.1: x = []; x.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x.length throw "error". Actual: ' + (x.length)); } @@ -75,7 +118,14 @@ catch (e) { //CHECK#8 try { x = []; - x.length = {valueOf: function() {return {}}, toString: function() {return {}}}; + x.length = { + valueOf: function() { + return {} + }, + toString: function() { + return {} + } + }; x.length; $ERROR('#8.1: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return {}}} x.length throw TypeError. Actual: ' + (x.length)); } diff --git a/test/built-ins/Array/length/S15.4.5.2_A3_T4.js b/test/built-ins/Array/length/S15.4.5.2_A3_T4.js index 1bcbb6f975f71e45e259b560e9db956b656f6a75..afd9985b10d19c632216ec8a0c2390c7869cf8b5 100644 --- a/test/built-ins/Array/length/S15.4.5.2_A3_T4.js +++ b/test/built-ins/Array/length/S15.4.5.2_A3_T4.js @@ -13,7 +13,7 @@ description: > ---*/ //CHECK#1 -var x = [0,1,2]; +var x = [0, 1, 2]; x[4294967294] = 4294967294; x.length = 2; diff --git a/test/built-ins/Array/prototype/concat/15.4.4.4-5-b-iii-3-b-1.js b/test/built-ins/Array/prototype/concat/15.4.4.4-5-b-iii-3-b-1.js index 121bcd6df908b24af389ff1d308bb18e886c0fd4..3910be2f085385ce779807253f9420858d9f4385 100644 --- a/test/built-ins/Array/prototype/concat/15.4.4.4-5-b-iii-3-b-1.js +++ b/test/built-ins/Array/prototype/concat/15.4.4.4-5-b-iii-3-b-1.js @@ -9,33 +9,33 @@ description: > (read-only) exists in Array.prototype (Step 5.b.iii.3.b) ---*/ - Object.defineProperty(Array.prototype, "0", { - value: 100, - writable: false, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + value: 100, + writable: false, + configurable: true +}); - var oldArr = [101]; +var oldArr = [101]; - var newArr = Array.prototype.concat.call(oldArr); +var newArr = Array.prototype.concat.call(oldArr); - var verifyValue = false; - verifyValue = newArr[0] === 101; +var verifyValue = false; +verifyValue = newArr[0] === 101; - var verifyEnumerable = false; - for (var p in newArr) { - if (p === "0" && newArr.hasOwnProperty("0")) { - verifyEnumerable = true; - } - } +var verifyEnumerable = false; +for (var p in newArr) { + if (p === "0" && newArr.hasOwnProperty("0")) { + verifyEnumerable = true; + } +} - var verifyWritable = false; - newArr[0] = 12; - verifyWritable = newArr[0] === 12; +var verifyWritable = false; +newArr[0] = 12; +verifyWritable = newArr[0] === 12; - var verifyConfigurable = false; - delete newArr[0]; - verifyConfigurable = newArr.hasOwnProperty("0"); +var verifyConfigurable = false; +delete newArr[0]; +verifyConfigurable = newArr.hasOwnProperty("0"); assert(verifyValue, 'verifyValue !== true'); assert.sameValue(verifyConfigurable, false, 'verifyConfigurable'); diff --git a/test/built-ins/Array/prototype/concat/15.4.4.4-5-c-i-1.js b/test/built-ins/Array/prototype/concat/15.4.4.4-5-c-i-1.js index f51ca7107e27384692856332d22df76b2d69b914..61ecb1a260db1a80b89b1fbce604d35d05daf60c 100644 --- a/test/built-ins/Array/prototype/concat/15.4.4.4-5-c-i-1.js +++ b/test/built-ins/Array/prototype/concat/15.4.4.4-5-c-i-1.js @@ -9,35 +9,35 @@ description: > (read-only) exists in Array.prototype (Step 5.c.i) ---*/ - Object.defineProperty(Array.prototype, "0", { - value: 100, - writable: false, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + value: 100, + writable: false, + configurable: true +}); - var newArr = Array.prototype.concat.call(101); +var newArr = Array.prototype.concat.call(101); - var hasProperty = newArr.hasOwnProperty("0"); +var hasProperty = newArr.hasOwnProperty("0"); - var instanceOfVerify = typeof newArr[0]==="object"; +var instanceOfVerify = typeof newArr[0] === "object"; - var verifyValue = false; - verifyValue = newArr[0] == 101; +var verifyValue = false; +verifyValue = newArr[0] == 101; - var verifyEnumerable = false; - for (var p in newArr) { - if (p === "0" && newArr.hasOwnProperty("0")) { - verifyEnumerable = true; - } - } +var verifyEnumerable = false; +for (var p in newArr) { + if (p === "0" && newArr.hasOwnProperty("0")) { + verifyEnumerable = true; + } +} - var verifyWritable = false; - newArr[0] = 12; - verifyWritable = newArr[0] === 12; +var verifyWritable = false; +newArr[0] = 12; +verifyWritable = newArr[0] === 12; - var verifyConfigurable = false; - delete newArr[0]; - verifyConfigurable = newArr.hasOwnProperty("0"); +var verifyConfigurable = false; +delete newArr[0]; +verifyConfigurable = newArr.hasOwnProperty("0"); assert(hasProperty, 'hasProperty !== true'); assert(instanceOfVerify, 'instanceOfVerify !== true'); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-length-to-string-throws.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-length-to-string-throws.js index 00fea1dd7af9d1924338b9c3df4ce9e56414dcf7..3baf72a4a614cf1dab0ce749742b969320b12e70 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-length-to-string-throws.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-length-to-string-throws.js @@ -10,9 +10,11 @@ features: [Symbol.isConcatSpreadable] ---*/ function MyError() {} var obj = { - "length": { toString: function() { + "length": { + toString: function() { throw new MyError(); - }, valueOf: null + }, + valueOf: null }, "1": "A", "3": "B", diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-primitive-non-number-length.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-primitive-non-number-length.js index 14de922be89be1ca3a3d3a090fc5fdc304dcdbd8..82cf5a76777cfaff60289864622ccb20a379ea25 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-primitive-non-number-length.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-primitive-non-number-length.js @@ -15,7 +15,17 @@ var obj = { "5": "C" }; obj[Symbol.isConcatSpreadable] = true; -obj.length = {toString: function() { return "SIX"; }, valueOf: null }; +obj.length = { + toString: function() { + return "SIX"; + }, + valueOf: null +}; assert(compareArray([].concat(obj), [])); -obj.length = {toString: null, valueOf: function() { return "SIX"; } }; +obj.length = { + toString: null, + valueOf: function() { + return "SIX"; + } +}; assert(compareArray([].concat(obj), [])); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-string-length.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-string-length.js index 1c63b62f4c4eb5b706a16b8b74dfa1e6900f2957..8b94d65940ffc7d9ca5c900c99de4b1f83ccceb7 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-string-length.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-string-length.js @@ -16,7 +16,12 @@ var obj = { "5": "C" }; obj[Symbol.isConcatSpreadable] = true; -var obj2 = { length: 3, "0": "0", "1": "1", "2": "2" }; +var obj2 = { + length: 3, + "0": "0", + "1": "1", + "2": "2" +}; var arr = ["X", "Y", "Z"]; var expected = [ diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-to-length-throws.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-to-length-throws.js index 0322eaf1e28738cc17cb86d5eaea9da29d056f2a..907a30b7b336d37ceb835a2e6ec884852073700a 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-to-length-throws.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-to-length-throws.js @@ -9,13 +9,21 @@ description: Array.prototype.concat array like to length throws features: [Symbol.isConcatSpreadable] ---*/ var obj = { - "length": {valueOf: null, toString: null}, + "length": { + valueOf: null, + toString: null + }, "1": "A", "3": "B", "5": "C" }; obj[Symbol.isConcatSpreadable] = true; -var obj2 = { length: 3, "0": "0", "1": "1", "2": "2" }; +var obj2 = { + length: 3, + "0": "0", + "1": "1", + "2": "2" +}; var arr = ["X", "Y", "Z"]; assert.throws(TypeError, function() { Array.prototype.concat.call(obj, obj2, arr); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like.js index 3b747f931f0c7c1455d893516461102df87d636b..bfdf3c8e9d87da1fa33cfee8738346004c606d02 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like.js @@ -17,7 +17,12 @@ var obj = { "5": "C" }; obj[Symbol.isConcatSpreadable] = true; -var obj2 = { length: 3, "0": "0", "1": "1", "2": "2" }; +var obj2 = { + length: 3, + "0": "0", + "1": "1", + "2": "2" +}; var arr = ["X", "Y", "Z"]; var expected = [ diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_holey-sloppy-arguments.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_holey-sloppy-arguments.js index d8bab8d4afba898f6c681e1e2b62d45dcb51509f..44082769bb2002b4a457815c8a2c7b5836fde2a0 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_holey-sloppy-arguments.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_holey-sloppy-arguments.js @@ -10,7 +10,9 @@ description: Array.prototype.concat holey sloppy arguments includes: [compareArray.js] features: [Symbol.isConcatSpreadable] ---*/ -var args = (function(a) { return arguments; })(1,2,3); +var args = (function(a) { + return arguments; +})(1, 2, 3); delete args[1]; args[Symbol.isConcatSpreadable] = true; assert(compareArray([1, void 0, 3, 1, void 0, 3], [].concat(args, args))); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_large-typed-array.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_large-typed-array.js index dcf593907889c075c10e6f3c3aaf60b80be91826..cb37746a29e3c2a6996ef4f7b213d4d94d3400b3 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_large-typed-array.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_large-typed-array.js @@ -31,7 +31,9 @@ function concatTypedArray(type, elems, modulo) { var expected = new Array(4000); expected[0] = defValue; - Object.defineProperty(ta, "length", { value: 4000 }); + Object.defineProperty(ta, "length", { + value: 4000 + }); ta[Symbol.isConcatSpreadable] = true; assert(compareArray([].concat(ta), expected)); } diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_length-throws.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_length-throws.js index 3aef5b7827912a6fbc92d1b3f7e91f5477be44b2..c040d94a1f39517039e3b5403e360d4f2b8b464a 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_length-throws.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_length-throws.js @@ -13,7 +13,9 @@ function MyError() {} var obj = {}; obj[Symbol.isConcatSpreadable] = true; Object.defineProperty(obj, "length", { - get: function() { throw new MyError(); } + get: function() { + throw new MyError(); + } }); assert.throws(MyError, function() { diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_non-array.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_non-array.js index f6ed9cf11a8c1353661de9ddd7c0e6d9654adabb..bd080ee42bef9bf70dee59953e2ee0dcb87801f9 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_non-array.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_non-array.js @@ -19,8 +19,8 @@ class NonArray { } } -var obj = new NonArray(1,2,3); +var obj = new NonArray(1, 2, 3); var result = Array.prototype.concat.call(obj, 4, 5, 6); assert.sameValue(Array, result.constructor); assert.sameValue(result instanceof NonArray, false); -assert(compareArray(result, [obj,4,5,6])); +assert(compareArray(result, [obj, 4, 5, 6])); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments-throws.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments-throws.js index 8aefe98dafcf7602db6fd32260317c19551f0f7f..605330051cd6f9791246a85b86c6f8907eb11f3b 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments-throws.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments-throws.js @@ -10,9 +10,13 @@ description: Array.prototype.concat sloppy arguments throws features: [Symbol.isConcatSpreadable] ---*/ function MyError() {} -var args = (function(a) { return arguments; })(1,2,3); +var args = (function(a) { + return arguments; +})(1, 2, 3); Object.defineProperty(args, 0, { - get: function() { throw new MyError(); } + get: function() { + throw new MyError(); + } }); args[Symbol.isConcatSpreadable] = true; assert.throws(MyError, function() { diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments-with-dupes.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments-with-dupes.js index effb606b315546233545590fadbd1cfe27a4adc3..a6bca8a0d2ca1632d82b4635b0de61023a650e60 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments-with-dupes.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments-with-dupes.js @@ -11,9 +11,13 @@ flags: [noStrict] includes: [compareArray.js] features: [Symbol.isConcatSpreadable] ---*/ -var args = (function(a, a, a) { return arguments; })(1,2,3); +var args = (function(a, a, a) { + return arguments; +})(1, 2, 3); args[Symbol.isConcatSpreadable] = true; assert(compareArray([].concat(args, args), [1, 2, 3, 1, 2, 3])); -Object.defineProperty(args, "length", { value: 6 }); +Object.defineProperty(args, "length", { + value: 6 +}); assert(compareArray([].concat(args), [1, 2, 3, void 0, void 0, void 0])); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments.js index d805456206c08354278c0d247db96790a81b0b33..54e80acef21845cab95cd4da04b3a777403c0097 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments.js @@ -10,9 +10,13 @@ description: Array.prototype.concat sloppy arguments includes: [compareArray.js] features: [Symbol.isConcatSpreadable] ---*/ -var args = (function(a, b, c) { return arguments; })(1,2,3); +var args = (function(a, b, c) { + return arguments; +})(1, 2, 3); args[Symbol.isConcatSpreadable] = true; assert(compareArray([].concat(args, args), [1, 2, 3, 1, 2, 3])); -Object.defineProperty(args, "length", { value: 6 }); +Object.defineProperty(args, "length", { + value: 6 +}); assert(compareArray([].concat(args), [1, 2, 3, void 0, void 0, void 0])); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_small-typed-array.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_small-typed-array.js index 09fc40e0b05a1773b1e9dad1d62ded7b9b920344..1d5c1ecbbf170d825724a800fa0b618fb1430cc9 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_small-typed-array.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_small-typed-array.js @@ -31,7 +31,9 @@ function concatTypedArray(type, elems, modulo) { var expected = new Array(4000); expected[0] = defValue; - Object.defineProperty(ta, "length", { value: 4000 }); + Object.defineProperty(ta, "length", { + value: 4000 + }); ta[Symbol.isConcatSpreadable] = true; assert(compareArray([].concat(ta), expected)); } diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-boolean-wrapper.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-boolean-wrapper.js index 00ec7689b101f36d86d40f34d40640df98986db9..ed021358fb8ec4ba6fa3861e0734d4ee371365c1 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-boolean-wrapper.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-boolean-wrapper.js @@ -27,7 +27,7 @@ Boolean.prototype[0] = 1; Boolean.prototype[1] = 2; Boolean.prototype[2] = 3; Boolean.prototype.length = 3; -assert(compareArray([1,2,3], [].concat(new Boolean(true)))); +assert(compareArray([1, 2, 3], [].concat(new Boolean(true)))); // Boolean values are never concat-spreadable assert(compareArray([true], [].concat(true))); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-function.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-function.js index 5b5b5aca45444a1286520b2f6c2dcc9dd1d80e13..8ed6bf21cf77ce3bc6b188860685848d04cd4993 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-function.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-function.js @@ -21,11 +21,11 @@ assert(compareArray([1, 2, 3], [].concat(fn))); Function.prototype[Symbol.isConcatSpreadable] = true; // Functions may be concat-spreadable -assert(compareArray([void 0, void 0, void 0], [].concat(function(a,b,c) {}))); +assert(compareArray([void 0, void 0, void 0], [].concat(function(a, b, c) {}))); Function.prototype[0] = 1; Function.prototype[1] = 2; Function.prototype[2] = 3; -assert(compareArray([1,2,3], [].concat(function(a, b, c) {}))); +assert(compareArray([1, 2, 3], [].concat(function(a, b, c) {}))); delete Function.prototype[Symbol.isConcatSpreadable]; delete Function.prototype[0]; diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-getter-throws.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-getter-throws.js index 626f6d29217d3564f13ac5746124addc904d3c31..8a0b64deee88a02ce6139724efdef96292db384e 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-getter-throws.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-getter-throws.js @@ -12,7 +12,9 @@ features: [Symbol.isConcatSpreadable] function MyError() {} var obj = {}; Object.defineProperty(obj, Symbol.isConcatSpreadable, { - get: function() { throw new MyError(); } + get: function() { + throw new MyError(); + } }); assert.throws(MyError, function() { diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-number-wrapper.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-number-wrapper.js index 9ea803b4b60a2928a25b67f6ea52940b75ce6dd4..d28acb7d15d336197f8a11651167eb0ea3490c43 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-number-wrapper.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-number-wrapper.js @@ -27,7 +27,7 @@ Number.prototype[0] = 1; Number.prototype[1] = 2; Number.prototype[2] = 3; Number.prototype.length = 3; -assert(compareArray([1,2,3], [].concat(new Number(123)))); +assert(compareArray([1, 2, 3], [].concat(new Number(123)))); // Number values are never concat-spreadable assert(compareArray([true], [].concat(true))); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-reg-exp.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-reg-exp.js index 4003fe33cd06210de6667de388482c97225d4dbc..6a11c8eca0706c65665ce0553de2c0ac46e0048b 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-reg-exp.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-reg-exp.js @@ -27,7 +27,7 @@ assert(compareArray([].concat(/abc/), [void 0, void 0, void 0])); RegExp.prototype[0] = 1; RegExp.prototype[1] = 2; RegExp.prototype[2] = 3; -assert(compareArray([].concat(/abc/), [1,2,3])); +assert(compareArray([].concat(/abc/), [1, 2, 3])); delete RegExp.prototype[Symbol.isConcatSpreadable]; delete RegExp.prototype[0]; diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-sparse-object.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-sparse-object.js index 4b3f40d18898889debb0de6bddaac58940b98807..1c4aa7f2db2468ccd384a01cc8b74b0dafaf1169 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-sparse-object.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-sparse-object.js @@ -10,7 +10,9 @@ description: Array.prototype.concat Symbol.isConcatSpreadable sparse object includes: [compareArray.js] features: [Symbol.isConcatSpreadable] ---*/ -var obj = { length: 5 }; +var obj = { + length: 5 +}; obj[Symbol.isConcatSpreadable] = true; assert(compareArray([void 0, void 0, void 0, void 0, void 0], [].concat(obj))); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_strict-arguments.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_strict-arguments.js index 2d8b5868a93a3eaf10c5ae74136710e83bff76e9..49dfc415c90a2f661c111b81662ed767b0a45192 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_strict-arguments.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_strict-arguments.js @@ -10,9 +10,14 @@ description: Array.prototype.concat strict arguments includes: [compareArray.js] features: [Symbol.isConcatSpreadable] ---*/ -var args = (function(a, b, c) { "use strict"; return arguments; })(1,2,3); +var args = (function(a, b, c) { + "use strict"; + return arguments; +})(1, 2, 3); args[Symbol.isConcatSpreadable] = true; assert(compareArray([].concat(args, args), [1, 2, 3, 1, 2, 3])); -Object.defineProperty(args, "length", { value: 6 }); +Object.defineProperty(args, "length", { + value: 6 +}); assert(compareArray([].concat(args), [1, 2, 3, void 0, void 0, void 0])); diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T1.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T1.js index 7a590596d8c699c7cfdcf59ac62d6f5328d70526..e06836b67874050accd21991ef167a66abdc9601 100644 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T1.js +++ b/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T1.js @@ -12,9 +12,9 @@ description: Checking this algorithm, items are Array object ---*/ var x = new Array(); -var y = new Array(0,1); -var z = new Array(2,3,4); -var arr = x.concat(y,z); +var y = new Array(0, 1); +var z = new Array(2, 3, 4); +var arr = x.concat(y, z); //CHECK#0 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T2.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T2.js index 4024275a2dfa23ff64c1582c40d363e6c24a3f4c..100ecaa9d19fcf9e892ab56008c8642e90903060 100644 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T2.js +++ b/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T2.js @@ -13,8 +13,8 @@ description: Checking this algorithm, items are objects and primitives var x = [0]; var y = new Object(); -var z = new Array(1,2); -var arr = x.concat(y,z, -1, true, "NaN"); +var z = new Array(1, 2); +var arr = x.concat(y, z, -1, true, "NaN"); //CHECK#0 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T3.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T3.js index bb88eba5e44aeeaa6996718d5d6fe65aa78ee882..82a8d6f002573c523d48b67b316dd3edeacd0361 100644 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T3.js +++ b/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T3.js @@ -11,7 +11,7 @@ es5id: 15.4.4.4_A1_T3 description: Checking this algorithm with no items ---*/ -var x = [0,1]; +var x = [0, 1]; var arr = x.concat(); //CHECK#0 diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T4.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T4.js index 0282070519869af967e52149ac5dd81e62bf5f39..44ca8f91f0cd28fc28828823d58d18f32d1c5cd7 100644 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T4.js +++ b/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T4.js @@ -11,8 +11,8 @@ es5id: 15.4.4.4_A1_T4 description: Checking this algorithm, items are [], [,] ---*/ -var x = [,1]; -var arr = x.concat([], [,]); +var x = [, 1]; +var arr = x.concat([], [, ]); //CHECK#0 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A2_T1.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A2_T1.js index ce825917a9009c961d3d69e4d5067743fb5d9532..a77b0e07caf1cbf6309524af73e92dc2b436940d 100644 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A2_T1.js +++ b/test/built-ins/Array/prototype/concat/S15.4.4.4_A2_T1.js @@ -13,8 +13,8 @@ description: Checking this for Object object, items are objects and primitives var x = {}; x.concat = Array.prototype.concat; var y = new Object(); -var z = new Array(1,2); -var arr = x.concat(y,z, -1, true, "NaN"); +var z = new Array(1, 2); +var arr = x.concat(y, z, -1, true, "NaN"); //CHECK#0 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T1.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T1.js index e98d9e41d87c1ce3e2288b8d07ef6bff4f563278..ed7c03c9f24e26ae1bfde2a782bf840bf9a8899b 100644 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T1.js +++ b/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T1.js @@ -33,7 +33,9 @@ if (arr.hasOwnProperty('1') !== true) { Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.concat = Array.prototype.concat; -x = {0:0}; +x = { + 0: 0 +}; var arr = x.concat(); //CHECK#4 diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T2.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T2.js index b58435329b9c4e268ed90c4cc1a0995839a718cb..8434102963acd332b10a4db775571dbaddcdc66d 100644 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T2.js +++ b/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T2.js @@ -62,4 +62,3 @@ if (b.hasOwnProperty('1') !== false) { if (b.hasOwnProperty('2') !== true) { $ERROR("expected b.hasOwnProperty('2') === true, actually " + b.hasOwnProperty('2')); } - diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T3.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T3.js index c86f736cbe114b849af87b12a607ea324a10ec0d..e1eacc545e1b1d926ba261a79c977f79100d134e 100644 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T3.js +++ b/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T3.js @@ -62,4 +62,3 @@ if (b.hasOwnProperty('1') !== false) { if (b.hasOwnProperty('2') !== true) { $ERROR("expected b.hasOwnProperty('2') === true, actually " + b.hasOwnProperty('2')); } - diff --git a/test/built-ins/Array/prototype/concat/create-non-array.js b/test/built-ins/Array/prototype/concat/create-non-array.js index 171e2baab4190b6c2a9011fd0f97e22a488ec0f5..b33667a9a8f7d915b0abe5a791b937bdd1d384df 100644 --- a/test/built-ins/Array/prototype/concat/create-non-array.js +++ b/test/built-ins/Array/prototype/concat/create-non-array.js @@ -15,7 +15,9 @@ info: | 4. If isArray is false, return ? ArrayCreate(length). ---*/ -var obj = { length: 0 }; +var obj = { + length: 0 +}; var callCount = 0; var result; Object.defineProperty(obj, 'constructor', { diff --git a/test/built-ins/Array/prototype/copyWithin/coerced-values-end.js b/test/built-ins/Array/prototype/copyWithin/coerced-values-end.js index 9cb416ae1dd6538be470adc89aacc5c50a446792..a1d4e04a47146995d4a5456cb642f2d5fc3bee9e 100644 --- a/test/built-ins/Array/prototype/copyWithin/coerced-values-end.js +++ b/test/built-ins/Array/prototype/copyWithin/coerced-values-end.js @@ -17,48 +17,42 @@ includes: [compareArray.js] assert( compareArray( - [0, 1, 2, 3].copyWithin(1, 0, null), - [0, 1, 2, 3] + [0, 1, 2, 3].copyWithin(1, 0, null), [0, 1, 2, 3] ), 'null value coerced to 0' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(1, 0, NaN), - [0, 1, 2, 3] + [0, 1, 2, 3].copyWithin(1, 0, NaN), [0, 1, 2, 3] ), 'NaN value coerced to 0' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(1, 0, false), - [0, 1, 2, 3] + [0, 1, 2, 3].copyWithin(1, 0, false), [0, 1, 2, 3] ), 'false value coerced to 0' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(1, 0, true), - [0, 0, 2, 3] + [0, 1, 2, 3].copyWithin(1, 0, true), [0, 0, 2, 3] ), 'true value coerced to 1' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(1, 0, '-2'), - [0, 0, 1, 3] + [0, 1, 2, 3].copyWithin(1, 0, '-2'), [0, 0, 1, 3] ), 'string "-2" value coerced to integer -2' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(1, 0, -2.5), - [0, 0, 1, 3] + [0, 1, 2, 3].copyWithin(1, 0, -2.5), [0, 0, 1, 3] ), 'float -2.5 value coerced to integer -2' ); diff --git a/test/built-ins/Array/prototype/copyWithin/coerced-values-start.js b/test/built-ins/Array/prototype/copyWithin/coerced-values-start.js index 182655bf5f3e902f8a851737a66656b97969ca54..5789f7edea68dff6d732f16735b3b04abccad6ff 100644 --- a/test/built-ins/Array/prototype/copyWithin/coerced-values-start.js +++ b/test/built-ins/Array/prototype/copyWithin/coerced-values-start.js @@ -16,32 +16,28 @@ includes: [compareArray.js] assert( compareArray( - [0, 1, 2, 3].copyWithin(1, undefined), - [0, 0, 1, 2] + [0, 1, 2, 3].copyWithin(1, undefined), [0, 0, 1, 2] ), 'undefined value coerced to 0' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(1, false), - [0, 0, 1, 2] + [0, 1, 2, 3].copyWithin(1, false), [0, 0, 1, 2] ), 'false value coerced to 0' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(1, NaN), - [0, 0, 1, 2] + [0, 1, 2, 3].copyWithin(1, NaN), [0, 0, 1, 2] ), 'NaN value coerced to 0' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(1, null), - [0, 0, 1, 2] + [0, 1, 2, 3].copyWithin(1, null), [0, 0, 1, 2] ), 'null value coerced to 0' ); @@ -49,8 +45,7 @@ assert( assert( compareArray( - [0, 1, 2, 3].copyWithin(0, true), - [1, 2, 3, 3] + [0, 1, 2, 3].copyWithin(0, true), [1, 2, 3, 3] ), 'true value coerced to 1' ); @@ -58,24 +53,21 @@ assert( assert( compareArray( - [0, 1, 2, 3].copyWithin(0, '1'), - [1, 2, 3, 3] + [0, 1, 2, 3].copyWithin(0, '1'), [1, 2, 3, 3] ), 'string "1" value coerced to 1' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(1, 0.5), - [0, 0, 1, 2] + [0, 1, 2, 3].copyWithin(1, 0.5), [0, 0, 1, 2] ), '0.5 float value coerced to integer 0' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(0, 1.5), - [1, 2, 3, 3] + [0, 1, 2, 3].copyWithin(0, 1.5), [1, 2, 3, 3] ), '1.5 float value coerced to integer 1' ); diff --git a/test/built-ins/Array/prototype/copyWithin/coerced-values-target.js b/test/built-ins/Array/prototype/copyWithin/coerced-values-target.js index 2646b19f221a9c2ec7fbd7bdfaac46ba486e2ca6..54465b97ab1bab99c4701c9ece82dac167be55e0 100644 --- a/test/built-ins/Array/prototype/copyWithin/coerced-values-target.js +++ b/test/built-ins/Array/prototype/copyWithin/coerced-values-target.js @@ -16,32 +16,28 @@ includes: [compareArray.js] assert( compareArray( - [0, 1, 2, 3].copyWithin(undefined, 1), - [1, 2, 3, 3] + [0, 1, 2, 3].copyWithin(undefined, 1), [1, 2, 3, 3] ), 'undefined value coerced to 0' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(false, 1), - [1, 2, 3, 3] + [0, 1, 2, 3].copyWithin(false, 1), [1, 2, 3, 3] ), 'false value coerced to 0' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(NaN, 1), - [1, 2, 3, 3] + [0, 1, 2, 3].copyWithin(NaN, 1), [1, 2, 3, 3] ), 'NaN value coerced to 0' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(null, 1), - [1, 2, 3, 3] + [0, 1, 2, 3].copyWithin(null, 1), [1, 2, 3, 3] ), 'null value coerced to 0' ); @@ -49,8 +45,7 @@ assert( assert( compareArray( - [0, 1, 2, 3].copyWithin(true, 0), - [0, 0, 1, 2] + [0, 1, 2, 3].copyWithin(true, 0), [0, 0, 1, 2] ), 'true value coerced to 1' ); @@ -58,24 +53,21 @@ assert( assert( compareArray( - [0, 1, 2, 3].copyWithin('1', 0), - [0, 0, 1, 2] + [0, 1, 2, 3].copyWithin('1', 0), [0, 0, 1, 2] ), 'string "1" value coerced to 1' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(0.5, 1), - [1, 2, 3, 3] + [0, 1, 2, 3].copyWithin(0.5, 1), [1, 2, 3, 3] ), '0.5 float value coerced to integer 0' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(1.5, 0), - [0, 0, 1, 2] + [0, 1, 2, 3].copyWithin(1.5, 0), [0, 0, 1, 2] ), '1.5 float value coerced to integer 1' ); diff --git a/test/built-ins/Array/prototype/copyWithin/negative-end.js b/test/built-ins/Array/prototype/copyWithin/negative-end.js index 70aa0e0e23ab4f2ac8caeff9681fc482c672fd1e..81e97abfd8e4f71556853e8f8b8591d0ea11c07c 100644 --- a/test/built-ins/Array/prototype/copyWithin/negative-end.js +++ b/test/built-ins/Array/prototype/copyWithin/negative-end.js @@ -20,64 +20,56 @@ includes: [compareArray.js] assert( compareArray( - [0, 1, 2, 3].copyWithin(0, 1, -1), - [1, 2, 2, 3] + [0, 1, 2, 3].copyWithin(0, 1, -1), [1, 2, 2, 3] ), '[0, 1, 2, 3].copyWithin(0, 1, -1) -> [1, 2, 2, 3]' ); assert( compareArray( - [0, 1, 2, 3, 4].copyWithin(2, 0, -1), - [0, 1, 0, 1, 2] + [0, 1, 2, 3, 4].copyWithin(2, 0, -1), [0, 1, 0, 1, 2] ), '[0, 1, 2, 3, 4].copyWithin(2, 0, -1) -> [0, 1, 0, 1, 2]' ); assert( compareArray( - [0, 1, 2, 3, 4].copyWithin(1, 2, -2), - [0, 2, 2, 3, 4] + [0, 1, 2, 3, 4].copyWithin(1, 2, -2), [0, 2, 2, 3, 4] ), '[0, 1, 2, 3, 4].copyWithin(1, 2, -2) -> [0, 2, 2, 3, 4]' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(0, -2, -1), - [2, 1, 2, 3] + [0, 1, 2, 3].copyWithin(0, -2, -1), [2, 1, 2, 3] ), '[0, 1, 2, 3].copyWithin(0, -2, -1) -> [2, 1, 2, 3]' ); assert( compareArray( - [0, 1, 2, 3, 4].copyWithin(2, -2, -1), - [0, 1, 3, 3, 4] + [0, 1, 2, 3, 4].copyWithin(2, -2, -1), [0, 1, 3, 3, 4] ), '[0, 1, 2, 3, 4].copyWithin(2, -2, 1) -> [0, 1, 3, 3, 4]' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(-3, -2, -1), - [0, 2, 2, 3] + [0, 1, 2, 3].copyWithin(-3, -2, -1), [0, 2, 2, 3] ), '[0, 1, 2, 3].copyWithin(-3, -2, -1) -> [0, 2, 2, 3]' ); assert( compareArray( - [0, 1, 2, 3, 4].copyWithin(-2, -3, -1), - [0, 1, 2, 2, 3] + [0, 1, 2, 3, 4].copyWithin(-2, -3, -1), [0, 1, 2, 2, 3] ), '[0, 1, 2, 3, 4].copyWithin(-2, -3, -1) -> [0, 1, 2, 2, 3]' ); assert( compareArray( - [0, 1, 2, 3, 4].copyWithin(-5, -2, -1), - [3, 1, 2, 3, 4] + [0, 1, 2, 3, 4].copyWithin(-5, -2, -1), [3, 1, 2, 3, 4] ), '[0, 1, 2, 3, 4].copyWithin(-5, -2, -1) -> [3, 1, 2, 3, 4]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-end.js b/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-end.js index 072d03e704242ddfc6d53a0954d9d07f9e386703..34b8374611230c496df9208ea6fcb21549a88362 100644 --- a/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-end.js +++ b/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-end.js @@ -20,80 +20,70 @@ includes: [compareArray.js] assert( compareArray( - [0, 1, 2, 3].copyWithin(0, 1, -10), - [0, 1, 2, 3] + [0, 1, 2, 3].copyWithin(0, 1, -10), [0, 1, 2, 3] ), '[0, 1, 2, 3].copyWithin(0, 1, -10) -> [0, 1, 2, 3]' ); assert( compareArray( - [1, 2, 3, 4, 5].copyWithin(0, 1, -Infinity), - [1, 2, 3, 4, 5] + [1, 2, 3, 4, 5].copyWithin(0, 1, -Infinity), [1, 2, 3, 4, 5] ), '[1, 2, 3, 4, 5].copyWithin(0, 1, -Infinity) -> [1, 2, 3, 4, 5]' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(0, -2, -10), - [0, 1, 2, 3] + [0, 1, 2, 3].copyWithin(0, -2, -10), [0, 1, 2, 3] ), '[0, 1, 2, 3].copyWithin(0, -2, -10) -> [0, 1, 2, 3]' ); assert( compareArray( - [1, 2, 3, 4, 5].copyWithin(0, -2, -Infinity), - [1, 2, 3, 4, 5] + [1, 2, 3, 4, 5].copyWithin(0, -2, -Infinity), [1, 2, 3, 4, 5] ), '[1, 2, 3, 4, 5].copyWithin(0, -2, -Infinity) -> [1, 2, 3, 4, 5]' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(0, -9, -10), - [0, 1, 2, 3] + [0, 1, 2, 3].copyWithin(0, -9, -10), [0, 1, 2, 3] ), '[0, 1, 2, 3].copyWithin(0, -9, -10) -> [0, 1, 2, 3]' ); assert( compareArray( - [1, 2, 3, 4, 5].copyWithin(0, -9, -Infinity), - [1, 2, 3, 4, 5] + [1, 2, 3, 4, 5].copyWithin(0, -9, -Infinity), [1, 2, 3, 4, 5] ), '[1, 2, 3, 4, 5].copyWithin(0, -9, -Infinity) -> [1, 2, 3, 4, 5]' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(-3, -2, -10), - [0, 1, 2, 3] + [0, 1, 2, 3].copyWithin(-3, -2, -10), [0, 1, 2, 3] ), '[0, 1, 2, 3].copyWithin(-3, -2, -10) -> [0, 1, 2, 3]' ); assert( compareArray( - [1, 2, 3, 4, 5].copyWithin(-3, -2, -Infinity), - [1, 2, 3, 4, 5] + [1, 2, 3, 4, 5].copyWithin(-3, -2, -Infinity), [1, 2, 3, 4, 5] ), '[1, 2, 3, 4, 5].copyWithin(-3, -2, -Infinity) -> [1, 2, 3, 4, 5]' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(-7, -8, -9), - [0, 1, 2, 3] + [0, 1, 2, 3].copyWithin(-7, -8, -9), [0, 1, 2, 3] ), '[0, 1, 2, 3].copyWithin(-7, -8, -9) -> [0, 1, 2, 3]' ); assert( compareArray( - [1, 2, 3, 4, 5].copyWithin(-7, -8, -Infinity), - [1, 2, 3, 4, 5] + [1, 2, 3, 4, 5].copyWithin(-7, -8, -Infinity), [1, 2, 3, 4, 5] ), '[1, 2, 3, 4, 5].copyWithin(-7, -8, -Infinity) -> [1, 2, 3, 4, 5]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-start.js b/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-start.js index 1f31fc9eb9f2c2629d648ac0bbdc7a7c18f30bfa..e3002b70f09d0aaefd6d9b1c996458c2c60da9ab 100644 --- a/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-start.js +++ b/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-start.js @@ -17,32 +17,28 @@ includes: [compareArray.js] assert( compareArray( - [0, 1, 2, 3].copyWithin(0, -10), - [0, 1, 2, 3] + [0, 1, 2, 3].copyWithin(0, -10), [0, 1, 2, 3] ), '[0, 1, 2, 3].copyWithin(0, -10) -> [0, 1, 2, 3]' ); assert( compareArray( - [1, 2, 3, 4, 5].copyWithin(0, -Infinity), - [1, 2, 3, 4, 5] + [1, 2, 3, 4, 5].copyWithin(0, -Infinity), [1, 2, 3, 4, 5] ), '[1, 2, 3, 4, 5].copyWithin(0, -Infinity) -> [1, 2, 3, 4, 5]' ); assert( compareArray( - [0, 1, 2, 3, 4].copyWithin(2, -10), - [0, 1, 0, 1, 2] + [0, 1, 2, 3, 4].copyWithin(2, -10), [0, 1, 0, 1, 2] ), '[0, 1, 2, 3, 4].copyWithin(2, -2) -> [0, 1, 0, 1, 2]' ); assert( compareArray( - [1, 2, 3, 4, 5].copyWithin(2, -Infinity), - [1, 2, 1, 2, 3] + [1, 2, 3, 4, 5].copyWithin(2, -Infinity), [1, 2, 1, 2, 3] ), '[1, 2, 3, 4, 5].copyWithin(2, -Infinity) -> [1, 2, 1, 2, 3]' ); @@ -50,16 +46,14 @@ assert( assert( compareArray( - [0, 1, 2, 3, 4].copyWithin(10, -10), - [0, 1, 2, 3, 4] + [0, 1, 2, 3, 4].copyWithin(10, -10), [0, 1, 2, 3, 4] ), '[0, 1, 2, 3, 4].copyWithin(10, -10) -> [0, 1, 2, 3, 4]' ); assert( compareArray( - [1, 2, 3, 4, 5].copyWithin(10, -Infinity), - [1, 2, 3, 4, 5] + [1, 2, 3, 4, 5].copyWithin(10, -Infinity), [1, 2, 3, 4, 5] ), '[1, 2, 3, 4, 5].copyWithin(10, -Infinity) -> [1, 2, 3, 4, 5]' ); @@ -67,16 +61,14 @@ assert( assert( compareArray( - [0, 1, 2, 3].copyWithin(-9, -10), - [0, 1, 2, 3] + [0, 1, 2, 3].copyWithin(-9, -10), [0, 1, 2, 3] ), '[0, 1, 2, 3].copyWithin(-9, -10) -> [0, 1, 2, 3]' ); assert( compareArray( - [1, 2, 3, 4, 5].copyWithin(-9, -Infinity), - [1, 2, 3, 4, 5] + [1, 2, 3, 4, 5].copyWithin(-9, -Infinity), [1, 2, 3, 4, 5] ), '[1, 2, 3, 4, 5].copyWithin(-9, -Infinity) -> [1, 2, 3, 4, 5]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-target.js b/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-target.js index 72b95dcace2176f9d622b3bc27763254d3edc2fe..f17ab8a8a68406b560aa0ef7eeca378e15b0b43c 100644 --- a/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-target.js +++ b/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-target.js @@ -17,32 +17,28 @@ includes: [compareArray.js] assert( compareArray( - [0, 1, 2, 3].copyWithin(-10, 0), - [0, 1, 2, 3] + [0, 1, 2, 3].copyWithin(-10, 0), [0, 1, 2, 3] ), '[0, 1, 2, 3].copyWithin(-10, 0) -> [0, 1, 2, 3]' ); assert( compareArray( - [1, 2, 3, 4, 5].copyWithin(-Infinity, 0), - [1, 2, 3, 4, 5] + [1, 2, 3, 4, 5].copyWithin(-Infinity, 0), [1, 2, 3, 4, 5] ), '[1, 2, 3, 4, 5].copyWithin(-Infinity, 0) -> [1, 2, 3, 4, 5]' ); assert( compareArray( - [0, 1, 2, 3, 4].copyWithin(-10, 2), - [2, 3, 4, 3, 4] + [0, 1, 2, 3, 4].copyWithin(-10, 2), [2, 3, 4, 3, 4] ), '[0, 1, 2, 3, 4].copyWithin(-10, 2) -> [2, 3, 4, 3, 4]' ); assert( compareArray( - [1, 2, 3, 4, 5].copyWithin(-Infinity, 2), - [3, 4, 5, 4, 5] + [1, 2, 3, 4, 5].copyWithin(-Infinity, 2), [3, 4, 5, 4, 5] ), '[1, 2, 3, 4, 5].copyWithin(-Infinity, 2) -> [3, 4, 5, 4, 5]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/negative-start.js b/test/built-ins/Array/prototype/copyWithin/negative-start.js index 4cec365ad5d0aea63f04738f0c2a3eaa2cb78244..3989b288db4fa52fe299d856a375117504ea7f50 100644 --- a/test/built-ins/Array/prototype/copyWithin/negative-start.js +++ b/test/built-ins/Array/prototype/copyWithin/negative-start.js @@ -17,48 +17,42 @@ includes: [compareArray.js] assert( compareArray( - [0, 1, 2, 3].copyWithin(0, -1), - [3, 1, 2, 3] + [0, 1, 2, 3].copyWithin(0, -1), [3, 1, 2, 3] ), '[0, 1, 2, 3].copyWithin(0, -1) -> [3, 1, 2, 3]' ); assert( compareArray( - [0, 1, 2, 3, 4].copyWithin(2, -2), - [0, 1, 3, 4, 4] + [0, 1, 2, 3, 4].copyWithin(2, -2), [0, 1, 3, 4, 4] ), '[0, 1, 2, 3, 4].copyWithin(2, -2) -> [0, 1, 3, 4, 4]' ); assert( compareArray( - [0, 1, 2, 3, 4].copyWithin(1, -2), - [0, 3, 4, 3, 4] + [0, 1, 2, 3, 4].copyWithin(1, -2), [0, 3, 4, 3, 4] ), '[0, 1, 2, 3, 4].copyWithin(1, -2) -> [0, 3, 4, 3, 4]' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(-1, -2), - [0, 1, 2, 2] + [0, 1, 2, 3].copyWithin(-1, -2), [0, 1, 2, 2] ), '[0, 1, 2, 3].copyWithin(-1, -2) -> [ 0, 1, 2, 2 ]' ); assert( compareArray( - [0, 1, 2, 3, 4].copyWithin(-2, -3), - [0, 1, 2, 2, 3] + [0, 1, 2, 3, 4].copyWithin(-2, -3), [0, 1, 2, 2, 3] ), '[0, 1, 2, 3, 4].copyWithin(-2, -3) -> [0, 1, 2, 2, 3]' ); assert( compareArray( - [0, 1, 2, 3, 4].copyWithin(-5, -2), - [3, 4, 2, 3, 4] + [0, 1, 2, 3, 4].copyWithin(-5, -2), [3, 4, 2, 3, 4] ), '[0, 1, 2, 3, 4].copyWithin(-5, -2) -> [3, 4, 2, 3, 4]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/negative-target.js b/test/built-ins/Array/prototype/copyWithin/negative-target.js index 29fd2497550af1bda08e7e02d8f5ebf3600ef1d7..99844a4b8e38686781625aaa2f19149e90c7ba31 100644 --- a/test/built-ins/Array/prototype/copyWithin/negative-target.js +++ b/test/built-ins/Array/prototype/copyWithin/negative-target.js @@ -17,24 +17,21 @@ includes: [compareArray.js] assert( compareArray( - [0, 1, 2, 3].copyWithin(-1, 0), - [0, 1, 2, 0] + [0, 1, 2, 3].copyWithin(-1, 0), [0, 1, 2, 0] ), '[0, 1, 2, 3].copyWithin(-1, 0) -> [0, 1, 2, 0]' ); assert( compareArray( - [0, 1, 2, 3, 4].copyWithin(-2, 2), - [0, 1, 2, 2, 3] + [0, 1, 2, 3, 4].copyWithin(-2, 2), [0, 1, 2, 2, 3] ), '[0, 1, 2, 3, 4].copyWithin(-2, 2) -> [0, 1, 2, 2, 3]' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(-1, 2), - [0, 1, 2, 2] + [0, 1, 2, 3].copyWithin(-1, 2), [0, 1, 2, 2] ), '[0, 1, 2, 3].copyWithin(-1, 2) -> [0, 1, 2, 2]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/non-negative-out-of-bounds-end.js b/test/built-ins/Array/prototype/copyWithin/non-negative-out-of-bounds-end.js index 6af95e724411a51a8832bd490fba47c88893a38e..d20bc64c24da9f4a706e7b8ee0297bc24658887b 100644 --- a/test/built-ins/Array/prototype/copyWithin/non-negative-out-of-bounds-end.js +++ b/test/built-ins/Array/prototype/copyWithin/non-negative-out-of-bounds-end.js @@ -36,32 +36,28 @@ includes: [compareArray.js] assert( compareArray( - [0, 1, 2, 3].copyWithin(0, 1, 6), - [1, 2, 3, 3] + [0, 1, 2, 3].copyWithin(0, 1, 6), [1, 2, 3, 3] ), '[0, 1, 2, 3].copyWithin(0, 1, 6) -> [1, 2, 3, 3]' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(0, 1, Infinity), - [1, 2, 3, 3] + [0, 1, 2, 3].copyWithin(0, 1, Infinity), [1, 2, 3, 3] ), '[0, 1, 2, 3].copyWithin(0, 1, Infinity) -> [1, 2, 3, 3]' ); assert( compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(1, 3, 6), - [0, 3, 4, 5, 4, 5] + [0, 1, 2, 3, 4, 5].copyWithin(1, 3, 6), [0, 3, 4, 5, 4, 5] ), '[0, 1, 2, 3, 4, 5].copyWithin(1, 3, 6) -> [0, 3, 4, 5, 4, 5]' ); assert( compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(1, 3, Infinity), - [0, 3, 4, 5, 4, 5] + [0, 1, 2, 3, 4, 5].copyWithin(1, 3, Infinity), [0, 3, 4, 5, 4, 5] ), '[0, 1, 2, 3, 4, 5].copyWithin(1, 3, Infinity) -> [0, 3, 4, 5, 4, 5]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/non-negative-out-of-bounds-target-and-start.js b/test/built-ins/Array/prototype/copyWithin/non-negative-out-of-bounds-target-and-start.js index e38edecd72b4dee9ec42105fc78c22c34b383328..64f3c58540abc3068cf7edfe08d7c114c068fe59 100644 --- a/test/built-ins/Array/prototype/copyWithin/non-negative-out-of-bounds-target-and-start.js +++ b/test/built-ins/Array/prototype/copyWithin/non-negative-out-of-bounds-target-and-start.js @@ -30,64 +30,56 @@ includes: [compareArray.js] assert( compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(6, 0), - [0, 1, 2, 3, 4, 5] + [0, 1, 2, 3, 4, 5].copyWithin(6, 0), [0, 1, 2, 3, 4, 5] ), '[0, 1, 2, 3, 4, 5].copyWithin(6, 0) => [0, 1, 2, 3, 4, 5]' ); assert( compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(7, 0), - [0, 1, 2, 3, 4, 5] + [0, 1, 2, 3, 4, 5].copyWithin(7, 0), [0, 1, 2, 3, 4, 5] ), '[0, 1, 2, 3, 4, 5].copyWithin(6, 0) => [0, 1, 2, 3, 4, 5]' ); assert( compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(Infinity, 0), - [0, 1, 2, 3, 4, 5] + [0, 1, 2, 3, 4, 5].copyWithin(Infinity, 0), [0, 1, 2, 3, 4, 5] ), '[0, 1, 2, 3, 4, 5].copyWithin(Infinity, 0) => [0, 1, 2, 3, 4, 5]' ); assert( compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(6, 2), - [0, 1, 2, 3, 4, 5] + [0, 1, 2, 3, 4, 5].copyWithin(6, 2), [0, 1, 2, 3, 4, 5] ), '[0, 1, 2, 3, 4, 5].copyWithin(6, 2) => [0, 1, 2, 3, 4, 5]' ); assert( compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(7, 2), - [0, 1, 2, 3, 4, 5] + [0, 1, 2, 3, 4, 5].copyWithin(7, 2), [0, 1, 2, 3, 4, 5] ), '[0, 1, 2, 3, 4, 5].copyWithin(7, 2) => [0, 1, 2, 3, 4, 5]' ); assert( compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(Infinity, 2), - [0, 1, 2, 3, 4, 5] + [0, 1, 2, 3, 4, 5].copyWithin(Infinity, 2), [0, 1, 2, 3, 4, 5] ), '[0, 1, 2, 3, 4, 5].copyWithin(Infinity, 2) => [0, 1, 2, 3, 4, 5]' ); assert( compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(0, 6), - [0, 1, 2, 3, 4, 5] + [0, 1, 2, 3, 4, 5].copyWithin(0, 6), [0, 1, 2, 3, 4, 5] ), '[0, 1, 2, 3, 4, 5].copyWithin(0, 6) => [0, 1, 2, 3, 4, 5]' ); assert( compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(0, 7), - [0, 1, 2, 3, 4, 5] + [0, 1, 2, 3, 4, 5].copyWithin(0, 7), [0, 1, 2, 3, 4, 5] ), '[0, 1, 2, 3, 4, 5].copyWithin(0, 7) => [0, 1, 2, 3, 4, 5]' ); @@ -95,24 +87,21 @@ assert( assert( compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(0, Infinity), - [0, 1, 2, 3, 4, 5] + [0, 1, 2, 3, 4, 5].copyWithin(0, Infinity), [0, 1, 2, 3, 4, 5] ), '[0, 1, 2, 3, 4, 5].copyWithin(0, Infinity) => [0, 1, 2, 3, 4, 5]' ); assert( compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(2, 6), - [0, 1, 2, 3, 4, 5] + [0, 1, 2, 3, 4, 5].copyWithin(2, 6), [0, 1, 2, 3, 4, 5] ), '[0, 1, 2, 3, 4, 5].copyWithin(2, 6) => [0, 1, 2, 3, 4, 5]' ); assert( compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(1, 7), - [0, 1, 2, 3, 4, 5] + [0, 1, 2, 3, 4, 5].copyWithin(1, 7), [0, 1, 2, 3, 4, 5] ), '[0, 1, 2, 3, 4, 5].copyWithin(1, 7) => [0, 1, 2, 3, 4, 5]' ); @@ -120,32 +109,28 @@ assert( assert( compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(3, Infinity), - [0, 1, 2, 3, 4, 5] + [0, 1, 2, 3, 4, 5].copyWithin(3, Infinity), [0, 1, 2, 3, 4, 5] ), '[0, 1, 2, 3, 4, 5].copyWithin(3, Infinity) => [0, 1, 2, 3, 4, 5]' ); assert( compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(6, 6), - [0, 1, 2, 3, 4, 5] + [0, 1, 2, 3, 4, 5].copyWithin(6, 6), [0, 1, 2, 3, 4, 5] ), '[0, 1, 2, 3, 4, 5].copyWithin(6, 6) => [0, 1, 2, 3, 4, 5]' ); assert( compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(10, 10), - [0, 1, 2, 3, 4, 5] + [0, 1, 2, 3, 4, 5].copyWithin(10, 10), [0, 1, 2, 3, 4, 5] ), '[0, 1, 2, 3, 4, 5].copyWithin(10, 10) => [0, 1, 2, 3, 4, 5]' ); assert( compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(Infinity, Infinity), - [0, 1, 2, 3, 4, 5] + [0, 1, 2, 3, 4, 5].copyWithin(Infinity, Infinity), [0, 1, 2, 3, 4, 5] ), '[0, 1, 2, 3, 4, 5].copyWithin(Infinity, Infinity) => [0, 1, 2, 3, 4, 5]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/non-negative-target-and-start.js b/test/built-ins/Array/prototype/copyWithin/non-negative-target-and-start.js index 9704fcc62264239962df955a850e4195169fda8f..02a6bc4e7871be9c3ae2bc2e2c9ee09c331d39c7 100644 --- a/test/built-ins/Array/prototype/copyWithin/non-negative-target-and-start.js +++ b/test/built-ins/Array/prototype/copyWithin/non-negative-target-and-start.js @@ -34,28 +34,24 @@ includes: [compareArray.js] assert( compareArray( - ['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(0, 0), - ['a', 'b', 'c', 'd', 'e', 'f'] + ['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(0, 0), ['a', 'b', 'c', 'd', 'e', 'f'] ) ); assert( compareArray( - ['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(0, 2), - ['c', 'd', 'e', 'f', 'e', 'f'] + ['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(0, 2), ['c', 'd', 'e', 'f', 'e', 'f'] ) ); assert( compareArray( - ['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(3, 0), - ['a', 'b', 'c', 'a', 'b', 'c'] + ['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(3, 0), ['a', 'b', 'c', 'a', 'b', 'c'] ) ); assert( compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(1, 4), - [0, 4, 5, 3, 4, 5] + [0, 1, 2, 3, 4, 5].copyWithin(1, 4), [0, 4, 5, 3, 4, 5] ) ); diff --git a/test/built-ins/Array/prototype/copyWithin/non-negative-target-start-and-end.js b/test/built-ins/Array/prototype/copyWithin/non-negative-target-start-and-end.js index 89a665ad5d0e7f58de7832dc5e5dc9122f8c690c..4dbc5479cd511d9be4fb515366c840dbbc748933 100644 --- a/test/built-ins/Array/prototype/copyWithin/non-negative-target-start-and-end.js +++ b/test/built-ins/Array/prototype/copyWithin/non-negative-target-start-and-end.js @@ -36,24 +36,21 @@ includes: [compareArray.js] assert( compareArray( - [0, 1, 2, 3].copyWithin(0, 0, 0), - [0, 1, 2, 3] + [0, 1, 2, 3].copyWithin(0, 0, 0), [0, 1, 2, 3] ), '[0, 1, 2, 3].copyWithin(0, 0, 0) -> [0, 1, 2, 3]' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(0, 0, 2), - [0, 1, 2, 3] + [0, 1, 2, 3].copyWithin(0, 0, 2), [0, 1, 2, 3] ), '[0, 1, 2, 3].copyWithin(0, 0, 2) -> [0, 1, 2, 3]' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(0, 1, 2), - [1, 1, 2, 3] + [0, 1, 2, 3].copyWithin(0, 1, 2), [1, 1, 2, 3] ), '[0, 1, 2, 3].copyWithin(0, 1, 2) -> [1, 1, 2, 3]' ); @@ -71,16 +68,14 @@ assert( */ assert( compareArray( - [0, 1, 2, 3].copyWithin(1, 0, 2), - [0, 0, 1, 3] + [0, 1, 2, 3].copyWithin(1, 0, 2), [0, 0, 1, 3] ), '[0, 1, 2, 3].copyWithin(1, 0, 2) -> [0, 0, 1, 3]' ); assert( compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(1, 3, 5), - [0, 3, 4, 3, 4, 5] + [0, 1, 2, 3, 4, 5].copyWithin(1, 3, 5), [0, 3, 4, 3, 4, 5] ), '[0, 1, 2, 3, 4, 5].copyWithin(1, 3, 5) -> [0, 3, 4, 3, 4, 5]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/return-abrupt-from-end.js b/test/built-ins/Array/prototype/copyWithin/return-abrupt-from-end.js index 6d69262ff57477e802de62341a755bf0eccc1889..a81b4ac32e166aa2c086a661e84b7c58d2dbd6ff 100644 --- a/test/built-ins/Array/prototype/copyWithin/return-abrupt-from-end.js +++ b/test/built-ins/Array/prototype/copyWithin/return-abrupt-from-end.js @@ -23,4 +23,3 @@ var o1 = { assert.throws(Test262Error, function() { [].copyWithin(0, 0, o1); }); - diff --git a/test/built-ins/Array/prototype/copyWithin/return-abrupt-from-start.js b/test/built-ins/Array/prototype/copyWithin/return-abrupt-from-start.js index 37768729c6920118dc277ed40ff957495e759a43..66940444178a4f2f6c919a609df6d846c0f744f6 100644 --- a/test/built-ins/Array/prototype/copyWithin/return-abrupt-from-start.js +++ b/test/built-ins/Array/prototype/copyWithin/return-abrupt-from-start.js @@ -22,4 +22,3 @@ var o1 = { assert.throws(Test262Error, function() { [].copyWithin(0, o1); }); - diff --git a/test/built-ins/Array/prototype/copyWithin/undefined-end.js b/test/built-ins/Array/prototype/copyWithin/undefined-end.js index 93c75620ee422138331b9fccf854d2a9dc4857d3..6ef024c7565cd0fa6a04fb8a4774ac509f4b3c0e 100644 --- a/test/built-ins/Array/prototype/copyWithin/undefined-end.js +++ b/test/built-ins/Array/prototype/copyWithin/undefined-end.js @@ -17,16 +17,14 @@ includes: [compareArray.js] assert( compareArray( - [0, 1, 2, 3].copyWithin(0, 1, undefined), - [1, 2, 3, 3] + [0, 1, 2, 3].copyWithin(0, 1, undefined), [1, 2, 3, 3] ), '[0, 1, 2, 3].copyWithin(0, 1, undefined) -> [1, 2, 3]' ); assert( compareArray( - [0, 1, 2, 3].copyWithin(0, 1), - [1, 2, 3, 3] + [0, 1, 2, 3].copyWithin(0, 1), [1, 2, 3, 3] ), '[0, 1, 2, 3].copyWithin(0, 1) -> [1, 2, 3, 3]' ); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-1-4.js b/test/built-ins/Array/prototype/every/15.4.4.16-1-4.js index 32c5b4f6a8641eb7bbbc7e10e43abe1c47a9ca9f..0d88f961ed18c1714e8e90e98eef0d775b2228c9 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-1-4.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-1-4.js @@ -8,6 +8,7 @@ description: Array.prototype.every applied to Boolean object ---*/ var accessed = false; + function callbackfn(val, idx, obj) { accessed = true; return obj instanceof Boolean; diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-1-5.js b/test/built-ins/Array/prototype/every/15.4.4.16-1-5.js index 91827adfcd31df170bbcb03af91174dc1bdf6bc4..7bd133c7407047a6e0e3857517efd0fa2c2befb6 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-1-5.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-1-5.js @@ -8,6 +8,7 @@ description: Array.prototype.every applied to number primitive ---*/ var accessed = false; + function callbackfn(val, idx, obj) { accessed = true; return obj instanceof Number; diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-1-6.js b/test/built-ins/Array/prototype/every/15.4.4.16-1-6.js index 09439db09c6c1cc761a9ff9418627941d2350b4d..255a5afc246b7286e552f4bb3dce0d946fea1f5b 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-1-6.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-1-6.js @@ -8,6 +8,7 @@ description: Array.prototype.every applied to Number object ---*/ var accessed = false; + function callbackfn(val, idx, obj) { accessed = true; return obj instanceof Number; diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-1-9.js b/test/built-ins/Array/prototype/every/15.4.4.16-1-9.js index f33885b890523ec8dd26c415822d2aba3d339fdd..bf6992cf132b1a69fca06bce4656ed85684e6228 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-1-9.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-1-9.js @@ -11,7 +11,7 @@ function callbackfn(val, idx, obj) { return !(obj instanceof Function); } -var obj = function (a, b) { +var obj = function(a, b) { return a + b; }; obj[0] = 11; diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-10.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-10.js index 88dc9700a502ddec15df544fc990a517e5d20d22..c895c286c2cbaae2cf02e1af7acac5c010b9515d 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-10.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-10.js @@ -17,16 +17,16 @@ function callbackfn2(val, idx, obj) { return val > 11; } -var proto = { }; +var proto = {}; Object.defineProperty(proto, "length", { - get: function () { - return 2; + get: function() { + return 2; }, configurable: true }); -var Con = function () { }; +var Con = function() {}; Con.prototype = proto; var child = new Con(); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-11.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-11.js index 135cc936d0dcdba39ef799ed7ffe28a926d40274..9f2497b6aa3e0dd9c0eda57433eb3ac557496dc6 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-11.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-11.js @@ -21,7 +21,7 @@ var obj = { 1: 8 }; Object.defineProperty(obj, "length", { - set: function () { }, + set: function() {}, configurable: true }); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-12.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-12.js index 2f71539f4226edf2aebbca78c8daf85fdf95bf97..4cc13deab834e6946cd7f376bd074595bf34965c 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-12.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-12.js @@ -17,16 +17,19 @@ function callbackfn(val, idx, obj) { } Object.defineProperty(Object.prototype, "length", { - get: function () { - return 2; - }, - configurable: true + get: function() { + return 2; + }, + configurable: true }); -var obj = { 0: 9, 1: 8 }; +var obj = { + 0: 9, + 1: 8 +}; Object.defineProperty(obj, "length", { - set: function () { }, - configurable: true + set: function() {}, + configurable: true }); assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-13.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-13.js index 07dc5015eb66c49bf82b5f094eae12d8fe52e12a..0c03deb22dce93eaf91f8145f45738e1e90eed0b 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-13.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-13.js @@ -12,17 +12,17 @@ description: > var accessed = false; function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; + accessed = true; + return val > 10; } var proto = {}; Object.defineProperty(proto, "length", { - set: function () { }, - configurable: true + set: function() {}, + configurable: true }); -var Con = function () { }; +var Con = function() {}; Con.prototype = proto; var child = new Con(); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-14.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-14.js index f885895242e7cff370b8d5e71f1f2a66870d6109..eb91b3e56c8509e7c9f880d60cb76ed0b256bf36 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-14.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-14.js @@ -16,7 +16,10 @@ function callbackfn(val, idx, obj) { return val > 10; } -var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-17.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-17.js index bf6fcd0c87c6a7a777b269903bd0db45acc1bd6c..7d4e3200c29c7059479a1d9b8bf76623cb461d6c 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-17.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-17.js @@ -17,10 +17,10 @@ function callbackfn2(val, idx, obj) { return val > 11; } -var func = function (a, b) { +var func = function(a, b) { arguments[2] = 9; return Array.prototype.every.call(arguments, callbackfn1) && - !Array.prototype.every.call(arguments, callbackfn2); + !Array.prototype.every.call(arguments, callbackfn2); }; assert(func(12, 11), 'func(12, 11) !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-19.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-19.js index 89977f2223c6fc89d49e40fe30a16013a1bb7eba..c7c9512351b037c7a404f7aa6329a102be578327 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-19.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-19.js @@ -17,7 +17,7 @@ function callbackfn2(val, idx, obj) { return val > 11; } -var fun = function (a, b) { +var fun = function(a, b) { return a + b; }; fun[0] = 12; diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-3.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-3.js index 57c559260ce21bd65c0e2fdf8e8c80e0960fc101..203eaee8a3d063984450d1d42cf9d6917c7ebabe 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-3.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-3.js @@ -17,9 +17,11 @@ function callbackfn2(val, idx, obj) { return val > 11; } -var proto = { length: 3 }; +var proto = { + length: 3 +}; -var Con = function () { }; +var Con = function() {}; Con.prototype = proto; var child = new Con(); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-4.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-4.js index c071a88752ed41538467e152a936a67c874e233f..cebdab0872e8017df8136e3eda5332b7fbb4bae5 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-4.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-4.js @@ -10,6 +10,7 @@ description: > ---*/ var arrProtoLen = 0; + function callbackfn1(val, idx, obj) { return val > 10; } diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-5.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-5.js index 6cd638bdb8cf5a5c4e6b2b256152318bdf51f41c..1f4ffc7a8282e00a34696f73a79057191f2122ed 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-5.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-5.js @@ -17,16 +17,16 @@ function callbackfn2(val, idx, obj) { return val > 11; } -var proto = { }; +var proto = {}; Object.defineProperty(proto, "length", { - get: function () { - return 3; + get: function() { + return 3; }, configurable: true }); -var Con = function () { }; +var Con = function() {}; Con.prototype = proto; var child = new Con(); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-6.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-6.js index b464e415123a37c5200ad62d1000945c4770039a..264d43dd2b49259359cd4b633b5a69f35195cc42 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-6.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-6.js @@ -17,9 +17,11 @@ function callbackfn2(val, idx, obj) { return val > 11; } -var proto = { length: 2 }; +var proto = { + length: 2 +}; -var Con = function () { }; +var Con = function() {}; Con.prototype = proto; var child = new Con(); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-7.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-7.js index bcc252a2be47a167ff11b7e8485381c856e020c0..9e29cd71518c136742baa097600c26998cfa59ce 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-7.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-7.js @@ -17,11 +17,11 @@ function callbackfn2(val, idx, obj) { return val > 11; } -var obj = { }; +var obj = {}; Object.defineProperty(obj, "length", { - get: function () { - return 2; + get: function() { + return 2; }, configurable: true }); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-8.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-8.js index 298e148b079739f672cbfc894f78716c0e73a9ee..d3a3e96abc247a5e2a6c65bcf174e6bd4a5f38bc 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-8.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-8.js @@ -17,16 +17,18 @@ function callbackfn2(val, idx, obj) { return val > 11; } -var proto = { length: 3 }; +var proto = { + length: 3 +}; -var Con = function () { }; +var Con = function() {}; Con.prototype = proto; var child = new Con(); Object.defineProperty(child, "length", { - get: function () { - return 2; + get: function() { + return 2; }, configurable: true }); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-9.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-9.js index 48387126bfb42052bd5209249e9f19244f4ab857..4dd430d1b1f637dc497b28e36743aff9781a1c96 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-9.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-9.js @@ -20,20 +20,20 @@ function callbackfn2(val, idx, obj) { var proto = {}; Object.defineProperty(proto, "length", { - get: function () { - return 3; + get: function() { + return 3; }, configurable: true }); -var Con = function () { }; +var Con = function() {}; Con.prototype = proto; var child = new Con(); Object.defineProperty(child, "length", { - get: function () { - return 2; + get: function() { + return 2; }, configurable: true }); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-1.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-1.js index b745f20c1f8f7795fb15f1a8e1e582a62eb7dcbb..a72ca6863d4e2153af9e9122d0cbb0848f24467c 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-1.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-1.js @@ -14,7 +14,10 @@ function callbackfn(val, idx, obj) { return val > 10; } -var obj = { 0: 9, length: undefined }; +var obj = { + 0: 9, + length: undefined +}; assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-10.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-10.js index c8029d4a0f6767d25e8cba6961eab229a3c5b98d..b381ef7d233363ceeeeb440d9fbc561c0c7e61ff 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-10.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-10.js @@ -16,7 +16,10 @@ function callbackfn(val, idx, obj) { return val > 10; } -var obj = { 0: 9, length: NaN }; +var obj = { + 0: 9, + length: NaN +}; assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-11.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-11.js index 9b27d025a848fc534a253beab11a64441b8e6213..ab5fa5744c6d40aab5e755a36ff2b037bef55d7d 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-11.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-11.js @@ -17,7 +17,12 @@ function callbackfn2(val, idx, obj) { return val > 11; } -var obj = { 0: 12, 1: 11, 2: 9, length: "2" }; +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: "2" +}; assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-12.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-12.js index 0c2a3f97e1ae9e5e8addc623bfd8649ca20ed7ad..bdf1ee93ebb4ac08236faf0c21f869c24387f90d 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-12.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-12.js @@ -17,7 +17,12 @@ function callbackfn2(val, idx, obj) { return val > 11; } -var obj = { 0: 11, 1: 12, 2: 9, length: "-4294967294" }; +var obj = { + 0: 11, + 1: 12, + 2: 9, + length: "-4294967294" +}; assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true'); assert(Array.prototype.every.call(obj, callbackfn2), 'Array.prototype.every.call(obj, callbackfn2) !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-13.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-13.js index 0043f34eecead0024a22513b868a07435a9e2c54..23c73425105f8244c0fc45ff1d53da7a0ff8491d 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-13.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-13.js @@ -17,7 +17,12 @@ function callbackfn2(val, idx, obj) { return val > 11; } -var obj = { 0: 12, 1: 11, 2: 9, length: "2.5" }; +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: "2.5" +}; assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-14.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-14.js index 1d99f1e2e3be27d3f0533e1ca5305e01d61a0d7a..c20b8194a24e3d601fc28e95da42352ed5782e6c 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-14.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-14.js @@ -10,13 +10,22 @@ description: Array.prototype.every - 'length' is a string containing +/-Infinity var accessed = false; function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; + accessed = true; + return val > 10; } -var objOne = { 0: 9, length: "Infinity" }; -var objTwo = { 0: 9, length: "+Infinity" }; -var objThree = { 0: 9, length: "-Infinity" }; +var objOne = { + 0: 9, + length: "Infinity" +}; +var objTwo = { + 0: 9, + length: "+Infinity" +}; +var objThree = { + 0: 9, + length: "-Infinity" +}; assert.sameValue(Array.prototype.every.call(objOne, callbackfn), false, 'Array.prototype.every.call(objOne, callbackfn)'); assert.sameValue(Array.prototype.every.call(objTwo, callbackfn), false, 'Array.prototype.every.call(objTwo, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-15.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-15.js index dcdda5faee155a6af58b2bee07c25ffd8f7830c4..63ceb586e8a7df053629ad32142e46254c1206fd 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-15.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-15.js @@ -17,7 +17,12 @@ function callbackfn2(val, idx, obj) { return val > 11; } -var obj = { 0: 12, 1: 11, 2: 9, length: "2E0" }; +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: "2E0" +}; assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-16.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-16.js index 4e7f6f97cb969d972563ecea6e9369efcf698ab7..ea0e8386cd694007495e70f8912ed644fb860fed 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-16.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-16.js @@ -17,7 +17,12 @@ function callbackfn2(val, idx, obj) { return val > 11; } -var obj = { 0: 12, 1: 11, 2: 9, length: "0x0002" }; +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: "0x0002" +}; assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-17.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-17.js index eb35d70b13f3e1dbd0249ecac1e0094f675e4ea0..0125b2b77b8f950ac20acdad09897dceb73ee851 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-17.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-17.js @@ -17,7 +17,12 @@ function callbackfn2(val, idx, obj) { return val > 11; } -var obj = { 0: 12, 1: 11, 2: 9, length: "0002.00" }; +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: "0002.00" +}; assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-18.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-18.js index 96846f1062aa43f440351693eebbb323843229f1..c06bc6c27ff193c5be92f2c452661d994ff9fa00 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-18.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-18.js @@ -16,7 +16,11 @@ function callbackfn(val, idx, obj) { return val > 10; } -var obj = { 0: 9, 1: 8, length: "two" }; +var obj = { + 0: 9, + 1: 8, + length: "two" +}; assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-19.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-19.js index 15d3f5af93d789866715ab5370ad3ef5f81a8e08..a2bc1211f7387204542caaa9a9497ac1a925e8cf 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-19.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-19.js @@ -10,25 +10,25 @@ description: > ---*/ function callbackfn1(val, idx, obj) { - return val > 10; + return val > 10; } function callbackfn2(val, idx, obj) { - return val > 11; + return val > 11; } var toStringAccessed = false; var obj = { - 0: 12, - 1: 11, - 2: 9, + 0: 12, + 1: 11, + 2: 9, - length: { - toString: function () { - toStringAccessed = true; - return '2'; - } + length: { + toString: function() { + toStringAccessed = true; + return '2'; } + } }; // objects inherit the default valueOf() method from Object diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-2.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-2.js index bb2431acb9c69d224cd01fff712e0f304d86d44f..fb8444d54de8d48c421e456ca8d6063c6b7af91d 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-2.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-2.js @@ -17,7 +17,11 @@ function callbackfn2(val, idx, obj) { return val > 11; } -var obj = { 0: 11, 1: 9, length: true }; +var obj = { + 0: 11, + 1: 9, + length: true +}; assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-20.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-20.js index 4f12b7bd7d115b19a656d39b3f6f70822ce66b32..a642c0ad1ce4a8e07c6a4e8a335991f7ec88ff63 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-20.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-20.js @@ -24,10 +24,10 @@ var obj = { 1: 11, 2: 9, length: { - valueOf: function () { - valueOfAccessed = true; - return 2; - } + valueOf: function() { + valueOfAccessed = true; + return 2; + } } }; diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-21.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-21.js index cc83597903dd734200b86d75a54b3ad05969c808..7f57fb9f280d19d129d2f87548489934f63a6ff2 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-21.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-21.js @@ -11,30 +11,30 @@ description: > ---*/ function callbackfn1(val, idx, obj) { - return val > 10; + return val > 10; } function callbackfn2(val, idx, obj) { - return val > 11; + return val > 11; } var toStringAccessed = false; var valueOfAccessed = false; var obj = { - 0: 12, - 1: 11, - 2: 9, - length: { - valueOf: function () { - valueOfAccessed = true; - return {}; - }, - toString: function () { - toStringAccessed = true; - return '2'; - } + 0: 12, + 1: 11, + 2: 9, + length: { + valueOf: function() { + valueOfAccessed = true; + return {}; + }, + toString: function() { + toStringAccessed = true; + return '2'; } + } }; assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true'); 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 44c8deb75826df5405c9f4d821b4110411bfd20b..a0f549b953daf0fb26db89e7709b399fc7f3c607 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 @@ -10,32 +10,32 @@ description: > primitive values ---*/ - var callbackfnAccessed = false; - var toStringAccessed = false; - var valueOfAccessed = false; +var callbackfnAccessed = false; +var toStringAccessed = false; +var valueOfAccessed = false; - function callbackfn(val, idx, obj) { - callbackfnAccessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + callbackfnAccessed = true; + return val > 10; +} - var obj = { - 0: 11, - 1: 12, +var obj = { + 0: 11, + 1: 12, - length: { - valueOf: function () { - valueOfAccessed = true; - return {}; - }, - toString: function () { - toStringAccessed = true; - return {}; - } - } - }; + length: { + valueOf: function() { + valueOfAccessed = true; + return {}; + }, + toString: function() { + toStringAccessed = true; + return {}; + } + } +}; assert.throws(TypeError, function() { - Array.prototype.every.call(obj, callbackfn); + Array.prototype.every.call(obj, callbackfn); }); assert(toStringAccessed, 'toStringAccessed !== true'); assert(valueOfAccessed, 'valueOfAccessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-23.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-23.js index e282dd269e53f3cbf2befd26c480fc5c196cb85c..19f4be0b2df90aa804fe75109da25b85c779051b 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-23.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-23.js @@ -9,40 +9,40 @@ description: > is an object with an own toString and inherited valueOf methods ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } - - function callbackfn2(val, idx, obj) { - return val > 11; - } - - var valueOfAccessed = false; - var toStringAccessed = false; - - var proto = { - valueOf: function () { - valueOfAccessed = true; - return 2; - } - }; - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - - child.toString = function () { - toStringAccessed = true; - return '1'; - }; - - var obj = { - 0: 12, - 1: 11, - 2: 9, - length: child - }; +function callbackfn1(val, idx, obj) { + return val > 10; +} + +function callbackfn2(val, idx, obj) { + return val > 11; +} + +var valueOfAccessed = false; +var toStringAccessed = false; + +var proto = { + valueOf: function() { + valueOfAccessed = true; + return 2; + } +}; + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); + +child.toString = function() { + toStringAccessed = true; + return '1'; +}; + +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: child +}; assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-24.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-24.js index 61c2e627b4d2b04829530d0560eee6a07a68a0ca..88db175593f0086be645c06dd34dc530fcb4e0f0 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-24.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-24.js @@ -9,15 +9,20 @@ description: > non-integer, ensure truncation occurs in the proper direction ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var obj = { 0: 12, 1: 11, 2: 9, length: 2.685 }; +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: 2.685 +}; assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-25.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-25.js index 3d052320a451e561b9d43751c4344d076c473639..d6a174f8751253b74ced13b81511a6a210d9e56a 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-25.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-25.js @@ -7,20 +7,20 @@ es5id: 15.4.4.16-3-25 description: Array.prototype.every - value of 'length' is a negative non-integer ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var obj = { - 0: 12, - 1: 11, - 2: 9, - length: -4294967294.5 - }; +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: -4294967294.5 +}; assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true'); assert(Array.prototype.every.call(obj, callbackfn2), 'Array.prototype.every.call(obj, callbackfn2) !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-29.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-29.js index 9abe0e9365a278e8e2166be60be132ddaf8db6a9..eaf990b5b721243531da2f42f86085d97c87f10b 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-29.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-29.js @@ -9,19 +9,19 @@ description: > + 1) ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var obj = { - 0: 11, - 1: 9, - length: 4294967297 - }; +var obj = { + 0: 11, + 1: 9, + length: 4294967297 +}; assert.sameValue(Array.prototype.every.call(obj, callbackfn1), false, 'Array.prototype.every.call(obj, callbackfn1)'); assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-3.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-3.js index c792c27c6684476516283619c9d14edbf227944b..4636ccf3ecef6308286d83e23b3647f62a1c609f 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-3.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-3.js @@ -7,14 +7,17 @@ es5id: 15.4.4.16-3-3 description: Array.prototype.every - value of 'length' is a number (value is 0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var obj = { 0: 9, length: 0 }; +var obj = { + 0: 9, + length: 0 +}; assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-4.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-4.js index c17e335a4e920547228d134c0a8d7c6411bcbb2b..68a0bf50a7ad4c0a01638e847b882f63b3a74daa 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-4.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-4.js @@ -7,14 +7,17 @@ es5id: 15.4.4.16-3-4 description: Array.prototype.every - value of 'length' is a number (value is +0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var obj = { 0: 9, length: +0 }; +var obj = { + 0: 9, + length: +0 +}; assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-5.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-5.js index eb9f48ba3c76b07c56bb6aeeb66dde1070d474d7..d041e7add383cb25280fe600de3e4a3076993cb0 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-5.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-5.js @@ -7,14 +7,17 @@ es5id: 15.4.4.16-3-5 description: Array.prototype.every - value of 'length' is a number (value is -0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var obj = { 0: 9, length: -0 }; +var obj = { + 0: 9, + length: -0 +}; assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-6.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-6.js index 1d1b15ef184114e8008d9490e616bddfc4e9b5c6..0ea6839cb50f58d4a384c39c0ddea0441cfab6bd 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-6.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-6.js @@ -9,15 +9,20 @@ description: > positive) ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var obj = { 0: 12, 1: 11, 2: 9, length: 2 }; +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: 2 +}; assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-7.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-7.js index 977bb65f9f9b3fe176d256dc86280d875b9df680..880c26aab841227a0c76b5b94fb3fe6a486f8e84 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-7.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-7.js @@ -9,15 +9,20 @@ description: > negative) ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var obj = { 0: 12, 1: 11, 2: 9, length: -4294967294 }; //length used to exec while loop is 0 +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: -4294967294 +}; //length used to exec while loop is 0 assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true'); assert(Array.prototype.every.call(obj, callbackfn2), 'Array.prototype.every.call(obj, callbackfn2) !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-8.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-8.js index 6496da4f0a1a284a7c58f1aede93b8dd3fa3a5b1..47a09300da5d1d516dc4a520a37bdfa9b85defb3 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-8.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-8.js @@ -9,14 +9,17 @@ description: > Infinity) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var obj = { 0: 9, length: Infinity }; +var obj = { + 0: 9, + length: Infinity +}; assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-3-9.js b/test/built-ins/Array/prototype/every/15.4.4.16-3-9.js index 9499801b8ea210e606cc06696f1ef77c9399affe..7166e98b84497fde9e05b7666dc4f751085b50cd 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-3-9.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-3-9.js @@ -9,14 +9,17 @@ description: > -Infinity) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var obj = { 0: 9, length: -Infinity }; +var obj = { + 0: 9, + length: -Infinity +}; assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-4-1.js b/test/built-ins/Array/prototype/every/15.4.4.16-4-1.js index 8cefedbe04cad8a194e47c74ca7dd06ad6621349..c0d6ba0cb424ce46564e35d0c6f2bd0160d92bfc 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.16-4-1 description: Array.prototype.every throws TypeError if callbackfn is undefined ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.every(); + arr.every(); }); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-4-10.js b/test/built-ins/Array/prototype/every/15.4.4.16-4-10.js index abbff39d21bc0093080abb9b14ac00e7d348d8db..2f458442b873d55c79eb2e89eec6c8aad567fae3 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-4-10.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-4-10.js @@ -9,15 +9,18 @@ description: > was thrown by step 2 ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - Object.defineProperty(obj, "length", { - get: function () { - throw new Test262Error(); - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + throw new Test262Error(); + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.every.call(obj, undefined); + Array.prototype.every.call(obj, undefined); }); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-4-11.js b/test/built-ins/Array/prototype/every/15.4.4.16-4-11.js index 4e4b09b69c9234e35b9ceac657d45f9c20597716..2cd9bba54c1f85251576418d37e3127011e7b276 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-4-11.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-4-11.js @@ -9,19 +9,22 @@ description: > was thrown by step 3 ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - throw new Test262Error(); - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + throw new Test262Error(); + } + }; + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.every.call(obj, undefined); + Array.prototype.every.call(obj, undefined); }); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-4-12.js b/test/built-ins/Array/prototype/every/15.4.4.16-4-12.js index ded81c8a4378149e2d1f22732260f2b0c307765b..a137acbc31f1093ff51aa3535139c51fff0fcf84 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-4-12.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-4-12.js @@ -7,8 +7,8 @@ es5id: 15.4.4.16-4-12 description: Array.prototype.every - 'callbackfn' is a function ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} assert.sameValue([11, 9].every(callbackfn), false, '[11, 9].every(callbackfn)'); 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 2f4fa8f8ca5168c1e8ffc7af4eb5e408b1ba48d0..207a615ffea1129f03caa1d083c4435f0ec6849e 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 @@ -9,27 +9,29 @@ description: > passing undefined for callbackfn ---*/ - var obj = { 10: 10 }; - var lengthAccessed = false; - var loopAccessed = false; +var obj = { + 10: 10 +}; +var lengthAccessed = false; +var loopAccessed = false; - Object.defineProperty(obj, "length", { - get: function () { - lengthAccessed = true; - return 20; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + lengthAccessed = true; + return 20; + }, + configurable: true +}); - Object.defineProperty(obj, "0", { - get: function () { - loopAccessed = true; - return 10; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + loopAccessed = true; + return 10; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.every.call(obj); + Array.prototype.every.call(obj); }); 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 103f22d6a04867a55b77bdb853b992aadd10012e..2613f1cf33a77e048350e1ec16e106ad7b1d86ba 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.16-4-3 description: Array.prototype.every throws TypeError if callbackfn is null ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.every(null); + 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 1b76313323be4dff10fe8aee4e78a858bb01d377..6a1c037720d8b9d24b51c29d4dcefbf2770f228e 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.16-4-4 description: Array.prototype.every throws TypeError if callbackfn is boolean ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.every(true); + 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 deb04c6f25d117708152cc1a4bfaaf3b30d7de96..a2d5c7aefafa0a228b863376fa61c426b48a82b1 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.16-4-5 description: Array.prototype.every throws TypeError if callbackfn is number ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.every(5); + 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 6597e45998172de92c96b6bdcfb83bb2f8c04e24..eb07314b17d0eff64a464d89fee310cadeb266af 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.16-4-6 description: Array.prototype.every throws TypeError if callbackfn is string ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.every("abc"); + 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 f512f2151b6605f4586d75ddfeb9b826abe0e5ce..51e13d6d182bc172d54a4e6d4ae8147ac875fc9a 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 @@ -9,7 +9,7 @@ description: > without a Call internal method ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.every( {} ); + 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 a3e75ff59eefb2c791aac4ff250d1c419d1f80a3..cb6ef73b10f4fd3f9591e29619a69f12bf2e35f6 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 @@ -9,18 +9,21 @@ description: > visible when an exception occurs ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - accessed = true; - return 2; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + accessed = true; + return 2; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.every.call(obj, null); + Array.prototype.every.call(obj, null); }); 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 fc1acaa02d2d05fc7b53c46f51d01a643e52dfc4..efe205eb4a56c2fdb2eddfcdbc5d5324a393dd00 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 @@ -9,22 +9,25 @@ description: > visible when an exception occurs ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - accessed = true; - return "2"; - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + accessed = true; + return "2"; + } + }; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.every.call(obj, null); + Array.prototype.every.call(obj, null); }); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-1-s.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-1-s.js index 989a6ee203b83e7e7ae3272cc8685f399b3fa15b..2d906315f2f2e587f5bf2dab0f62dad98f5f22ac 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-1-s.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-1-s.js @@ -8,14 +8,14 @@ description: Array.prototype.every - thisArg not passed to strict callbackfn flags: [noStrict] ---*/ - var innerThisCorrect = false; +var innerThisCorrect = false; - function callbackfn(val, idx, obj) { - "use strict"; - innerThisCorrect = this===undefined; - return true; - } +function callbackfn(val, idx, obj) { + "use strict"; + innerThisCorrect = this === undefined; + return true; +} - [1].every(callbackfn); +[1].every(callbackfn); assert(innerThisCorrect, 'innerThisCorrect !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-1.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-1.js index 360f9850fb0a85526d2923bbf83ed98baf648896..a3bdbc170cc79a100ce54bf500bd423462576d70 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-1.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-1.js @@ -10,11 +10,11 @@ flags: [noStrict] var global = this; - function callbackfn(val, idx, obj) - { - return this === global; - } +function callbackfn(val, idx, obj) +{ + return this === global; +} - var arr = [1]; +var arr = [1]; assert.sameValue(arr.every(callbackfn), true, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-10.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-10.js index 5d7c8a6e9aa491a481c6ae8631d6ca2a8fc76bd2..087f9c2a386aaa3f2e4ec395cc2d4a3e7c21e086 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-10.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-10.js @@ -7,13 +7,13 @@ es5id: 15.4.4.16-5-10 description: Array.prototype.every - Array Object can be used as thisArg ---*/ - var accessed = false; - var objArray = []; +var accessed = false; +var objArray = []; - function callbackfn(val, idx, obj) { - accessed = true; - return this === objArray; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === objArray; +} diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-11.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-11.js index 41792ec1d0fbe5dd6cc2e105ae0d66d25616ed67..dce15d0f4644e2579a8437894e842548ed3c75e6 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-11.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-11.js @@ -7,13 +7,13 @@ es5id: 15.4.4.16-5-11 description: Array.prototype.every - String Object can be used as thisArg ---*/ - var accessed = false; - var objString = new String(); +var accessed = false; +var objString = new String(); - function callbackfn(val, idx, obj) { - accessed = true; - return this === objString; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === objString; +} diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-12.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-12.js index cbb7ddf8b097369ab85ff9ab0da52b2ce7b43b0a..97b5771b3fb8b778e8bbcf1accdbaf6f247373e3 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-12.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-12.js @@ -7,13 +7,13 @@ es5id: 15.4.4.16-5-12 description: Array.prototype.every - Boolean Object can be used as thisArg ---*/ - var accessed = false; - var objBoolean = new Boolean(); +var accessed = false; +var objBoolean = new Boolean(); - function callbackfn(val, idx, obj) { - accessed = true; - return this === objBoolean; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === objBoolean; +} diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-13.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-13.js index 34e73df321a9eb930e2b34a554dd318900ddf2aa..da8f799386f72f9de98a8947140df38a4b252af5 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-13.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-13.js @@ -7,13 +7,13 @@ es5id: 15.4.4.16-5-13 description: Array.prototype.every - Number Object can be used as thisArg ---*/ - var accessed = false; - var objNumber = new Number(); +var accessed = false; +var objNumber = new Number(); - function callbackfn(val, idx, obj) { - accessed = true; - return this === objNumber; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === objNumber; +} assert([11].every(callbackfn, objNumber), '[11].every(callbackfn, objNumber) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-14.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-14.js index 697ef848e9e222c214b55bf2a5c68c0714f0e734..a5cc48fbf7115175a6acc6b62c7324abc1b340d3 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-14.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-14.js @@ -7,12 +7,12 @@ es5id: 15.4.4.16-5-14 description: Array.prototype.every - the Math object can be used as thisArg ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return this === Math; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === Math; +} assert([11].every(callbackfn, Math), '[11].every(callbackfn, Math) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-15.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-15.js index 66a64d987fcfda28028efb030432bc896642cc6c..7133cd487a17be5dfc6dc8dd08c82bbcb0494df3 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-15.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-15.js @@ -7,13 +7,13 @@ es5id: 15.4.4.16-5-15 description: Array.prototype.every - Date Object can be used as thisArg ---*/ - var accessed = false; - var objDate = new Date(); +var accessed = false; +var objDate = new Date(); - function callbackfn(val, idx, obj) { - accessed = true; - return this === objDate; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === objDate; +} assert([11].every(callbackfn, objDate), '[11].every(callbackfn, objDate) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-16.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-16.js index 091caa14c31c28b0f5814af9b3559fd4a7b8f34f..1edd76714c8b8e0922d0d9a237dca17b5871082f 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-16.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-16.js @@ -7,13 +7,13 @@ es5id: 15.4.4.16-5-16 description: Array.prototype.every - RegExp Object can be used as thisArg ---*/ - var accessed = false; - var objRegExp = new RegExp(); +var accessed = false; +var objRegExp = new RegExp(); - function callbackfn(val, idx, obj) { - accessed = true; - return this === objRegExp; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === objRegExp; +} assert([11].every(callbackfn, objRegExp), '[11].every(callbackfn, objRegExp) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-17.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-17.js index 9e9bd18e83e02e1a4bc57a8eafa3baccfe0f8124..2a5162a9cda2826a0389bd49e2eaf3cb0274583c 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-17.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-17.js @@ -7,12 +7,12 @@ es5id: 15.4.4.16-5-17 description: Array.prototype.every - the JSON object can be used as thisArg ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return this === JSON; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === JSON; +} assert([11].every(callbackfn, JSON), '[11].every(callbackfn, JSON) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-18.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-18.js index a944bff817d04a697165985830233af105805745..bae882c7c634d4821d8213412147bfbe82de6ba3 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-18.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-18.js @@ -7,13 +7,13 @@ es5id: 15.4.4.16-5-18 description: Array.prototype.every - Error Object can be used as thisArg ---*/ - var accessed = false; - var objError = new RangeError(); +var accessed = false; +var objError = new RangeError(); - function callbackfn(val, idx, obj) { - accessed = true; - return this === objError; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === objError; +} assert([11].every(callbackfn, objError), '[11].every(callbackfn, objError) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-19.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-19.js index 7a3e06e099aa335f6364bb787924f5989785a9a4..3b39e1826f88e1a66f99b4e8ed1cdffe0836fab6 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-19.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-19.js @@ -7,17 +7,17 @@ es5id: 15.4.4.16-5-19 description: Array.prototype.every - the Arguments object can be used as thisArg ---*/ - var accessed = false; - var arg; +var accessed = false; +var arg; - function callbackfn(val, idx, obj) { - accessed = true; - return this === arg; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === arg; +} - (function fun() { - arg = arguments; - }(1, 2, 3)); +(function fun() { + arg = arguments; +}(1, 2, 3)); assert([11].every(callbackfn, arg), '[11].every(callbackfn, arg) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-2.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-2.js index f15102c64193b91c96d8197a0dfe4f6becf7f4ec..96c0d39a49b33e1dc7c81685df136aa33fdabb86 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-2.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-2.js @@ -7,14 +7,15 @@ es5id: 15.4.4.16-5-2 description: Array.prototype.every - thisArg is Object ---*/ - var res = false; - var o = new Object(); - o.res = true; - function callbackfn(val, idx, obj) - { - return this.res; - } +var res = false; +var o = new Object(); +o.res = true; - var arr = [1]; +function callbackfn(val, idx, obj) +{ + return this.res; +} + +var arr = [1]; assert.sameValue(arr.every(callbackfn, o), true, 'arr.every(callbackfn, o)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-21.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-21.js index 7da5e819304969be78cf29a7d644646f4fa60c55..50d36ddce6903908689db9a8a9b460884435ae56 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-21.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-21.js @@ -8,12 +8,12 @@ description: Array.prototype.every - the global object can be used as thisArg ---*/ var global = this; - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return this === global; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === global; +} assert([11].every(callbackfn, global), '[11].every(callbackfn, global) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-22.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-22.js index d580818a683ae9a5869dd3a2c1ff5f6e93d04b78..90dcfb2dfd1ffaf228d7ba9b9ad6a8709d2b6d0c 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-22.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-22.js @@ -7,12 +7,12 @@ es5id: 15.4.4.16-5-22 description: Array.prototype.every - boolean primitive can be used as thisArg ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return this.valueOf() === false; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this.valueOf() === false; +} assert([11].every(callbackfn, false), '[11].every(callbackfn, false) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-23.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-23.js index 7953a70064d94b5f6102b61b1f2bcf07049ff2fc..ba19fd209fed5a855778cb9c3250aaf8fb9c991c 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-23.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-23.js @@ -7,12 +7,12 @@ es5id: 15.4.4.16-5-23 description: Array.prototype.every - number primitive can be used as thisArg ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return this.valueOf() === 101; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this.valueOf() === 101; +} assert([11].every(callbackfn, 101), '[11].every(callbackfn, 101) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-24.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-24.js index c9da3d9910f5c2fc818546b17d4c9893e82b29bd..4439dca25a111f219d7347d7e5cd68c6b2b061a9 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-24.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-24.js @@ -7,12 +7,12 @@ es5id: 15.4.4.16-5-24 description: Array.prototype.every - string primitive can be used as thisArg ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return this.valueOf() === "abc"; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this.valueOf() === "abc"; +} assert([11].every(callbackfn, "abc"), '[11].every(callbackfn, "abc") !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-3.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-3.js index 69f614ff848c4b00dd3934446275005d401ff734..1a1bb9b7da930ad31e1b228feadabad3ab563284 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-3.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-3.js @@ -7,14 +7,15 @@ es5id: 15.4.4.16-5-3 description: Array.prototype.every - thisArg is Array ---*/ - var res = false; - var a = new Array(); - a.res = true; - function callbackfn(val, idx, obj) - { - return this.res; - } +var res = false; +var a = new Array(); +a.res = true; - var arr = [1]; +function callbackfn(val, idx, obj) +{ + return this.res; +} + +var arr = [1]; assert.sameValue(arr.every(callbackfn, a), true, 'arr.every(callbackfn, a)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-4.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-4.js index 45ee186d178d7223f57fca4ff420b1549c036c78..b3e03058ab8c8c78e2830c7e78b64c64a87f75d8 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-4.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-4.js @@ -9,15 +9,16 @@ description: > template(prototype) ---*/ - var res = false; - function callbackfn(val, idx, obj) - { - return this.res; - } +var res = false; - function foo(){} - foo.prototype.res = true; - var f = new foo(); - var arr = [1]; +function callbackfn(val, idx, obj) +{ + return this.res; +} -assert.sameValue(arr.every(callbackfn,f), true, 'arr.every(callbackfn,f)'); +function foo() {} +foo.prototype.res = true; +var f = new foo(); +var arr = [1]; + +assert.sameValue(arr.every(callbackfn, f), true, 'arr.every(callbackfn,f)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-5.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-5.js index c0447933fd2d1878b15f7dc3eb47d06e91ed83ea..47ce23ac6480c978769840409d91852e336b23f5 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-5.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-5.js @@ -7,15 +7,16 @@ es5id: 15.4.4.16-5-5 description: Array.prototype.every - thisArg is object from object template ---*/ - var res = false; - function callbackfn(val, idx, obj) - { - return this.res; - } +var res = false; - function foo(){} - var f = new foo(); - f.res = true; - var arr = [1]; +function callbackfn(val, idx, obj) +{ + return this.res; +} -assert.sameValue(arr.every(callbackfn,f), true, 'arr.every(callbackfn,f)'); +function foo() {} +var f = new foo(); +f.res = true; +var arr = [1]; + +assert.sameValue(arr.every(callbackfn, f), true, 'arr.every(callbackfn,f)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-6.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-6.js index f871e3a43fcc65517579228ba02cd2152761588e..a71c98ee2ff3a41d81a8895084161d06e8bece8d 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-6.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-6.js @@ -7,14 +7,15 @@ es5id: 15.4.4.16-5-6 description: Array.prototype.every - thisArg is function ---*/ - var res = false; - function callbackfn(val, idx, obj) - { - return this.res; - } +var res = false; - function foo(){} - foo.res = true; - var arr = [1]; +function callbackfn(val, idx, obj) +{ + return this.res; +} -assert.sameValue(arr.every(callbackfn,foo), true, 'arr.every(callbackfn,foo)'); +function foo() {} +foo.res = true; +var arr = [1]; + +assert.sameValue(arr.every(callbackfn, foo), true, 'arr.every(callbackfn,foo)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-7.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-7.js index 3fa6fc9e7be2f01e5fc793e5c593655595d4647f..ff38fcdc42e5f5666cc09d31e7d8825c1c9fd5a4 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-7.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-7.js @@ -7,12 +7,12 @@ es5id: 15.4.4.16-5-7 description: Array.prototype.every - built-in functions can be used as thisArg ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return this === eval; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === eval; +} assert([11].every(callbackfn, eval), '[11].every(callbackfn, eval) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-5-9.js b/test/built-ins/Array/prototype/every/15.4.4.16-5-9.js index 400c0ca8450c6e9fe3a35480383091b376db71e1..2757891428b9e9ea54f07325256052069676340a 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-5-9.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-5-9.js @@ -7,13 +7,13 @@ es5id: 15.4.4.16-5-9 description: Array.prototype.every - Function Object can be used as thisArg ---*/ - var accessed = false; - var objFunction = function () { }; +var accessed = false; +var objFunction = function() {}; - function callbackfn(val, idx, obj) { - accessed = true; - return this === objFunction; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === objFunction; +} assert([11].every(callbackfn, objFunction), '[11].every(callbackfn, objFunction) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-1.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-1.js index e8d6745ddeb8bb16deb262a585016b32ed8f9554..22bcfaff63c6ce38f1ad5c142f54d6edda8081a5 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-1.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-1.js @@ -9,18 +9,18 @@ description: > the call ---*/ - var calledForThree = false; +var calledForThree = false; - function callbackfn(val, Idx, obj) - { - arr[2] = 3; - if(val == 3) - calledForThree = true; - return true; - } +function callbackfn(val, Idx, obj) +{ + arr[2] = 3; + if (val == 3) + calledForThree = true; + return true; +} - var arr = [1,2,,4,5]; +var arr = [1, 2, , 4, 5]; - var res = arr.every(callbackfn); +var res = arr.every(callbackfn); assert(calledForThree, 'calledForThree !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-2.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-2.js index fcb91af1765fe038be2807ee0516eed534c266fc..47d3ed4e52d7f032341d8581b98c46786b141e71 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-2.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-2.js @@ -9,16 +9,16 @@ description: > after the call ---*/ - function callbackfn(val, Idx, obj) - { - arr[4] = 6; - if(val < 6) - return true; - else - return false; - } +function callbackfn(val, Idx, obj) +{ + arr[4] = 6; + if (val < 6) + return true; + else + return false; +} - var arr = [1,2,3,4,5]; +var arr = [1, 2, 3, 4, 5]; assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-3.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-3.js index 214575295963a21d1181830739b66db66d4a8c90..08531fe6197aea5efeb1bb33390ae8071dd17407 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-3.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-3.js @@ -9,16 +9,16 @@ description: > after the call ---*/ - function callbackfn(val, Idx, obj) - { - delete arr[2]; - if(val == 3) - return false; - else - return true; - } +function callbackfn(val, Idx, obj) +{ + delete arr[2]; + if (val == 3) + return false; + else + return true; +} - var arr = [1,2,3,4,5]; +var arr = [1, 2, 3, 4, 5]; assert.sameValue(arr.every(callbackfn), true, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-4.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-4.js index 0cfdd4ebce30e8b780fc826018003f249a0438b8..9cbb2eda08df4ff97b003f1bfed56fa7685f94c3 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-4.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-4.js @@ -9,16 +9,16 @@ description: > Array.length is decreased ---*/ - function callbackfn(val, Idx, obj) - { - arr.length = 3; - if(val < 4) - return true; - else - return false; - } +function callbackfn(val, Idx, obj) +{ + arr.length = 3; + if (val < 4) + return true; + else + return false; +} - var arr = [1,2,3,4,6]; +var arr = [1, 2, 3, 4, 6]; assert.sameValue(arr.every(callbackfn), true, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-5.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-5.js index c7cfcd23eef68a3b904d56bdfb1df1ec8385b503..c4c062bdffaa93b68ba08a4c820a090f51ac4b44 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-5.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-5.js @@ -9,18 +9,18 @@ description: > sparse array ---*/ - function callbackfn(val, Idx, obj) - { - arr[1000] = 3; - if(val < 3) - return true; - else - return false; - } +function callbackfn(val, Idx, obj) +{ + arr[1000] = 3; + if (val < 3) + return true; + else + return false; +} - var arr = new Array(10); - arr[1] = 1; - arr[2] = 2; +var arr = new Array(10); +arr[1] = 1; +arr[2] = 2; assert.sameValue(arr.every(callbackfn), true, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-6.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-6.js index 1cf937c7cd2d721fa532f98fa4046e8d787857da..45bcdd29a160e3a568314be20b0560a95e3ee4c9 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-6.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-6.js @@ -9,19 +9,19 @@ description: > call when same index is also present in prototype ---*/ - function callbackfn(val, Idx, obj) - { - delete arr[2]; - if(val == 3) - return false; - else - return true; - } +function callbackfn(val, Idx, obj) +{ + delete arr[2]; + if (val == 3) + return false; + else + return true; +} - Array.prototype[2] = 3; - var arr = [1,2,3,4,5]; +Array.prototype[2] = 3; +var arr = [1, 2, 3, 4, 5]; - var res = arr.every(callbackfn); - delete Array.prototype[2]; +var res = arr.every(callbackfn); +delete Array.prototype[2]; assert.sameValue(res, false, 'res'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-7.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-7.js index 7eaab50788c758b997eca593c197e8169beb78c1..d25bd744d2be197292dc34af0f5eed6abef2b461 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-7.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-7.js @@ -10,16 +10,16 @@ description: > Array.prototype.every is called for all elements ---*/ - var o = new Object(); - o.arr = [1, 2, 3, 4, 5]; +var o = new Object(); +o.arr = [1, 2, 3, 4, 5]; - function callbackfn(val, Idx, obj) { - delete o.arr; - if (val === Idx + 1) - return true; - else - return false; - } +function callbackfn(val, Idx, obj) { + delete o.arr; + if (val === Idx + 1) + return true; + else + return false; +} assert(o.arr.every(callbackfn), 'o.arr.every(callbackfn) !== true'); assert.sameValue(o.hasOwnProperty("arr"), false, 'o.hasOwnProperty("arr")'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-8.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-8.js index 079db7b2d06404a21933cd3062434e874132ca6c..ff2f0f8bed0b021d21c89f6c5aa1fd6609b3fb3d 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-8.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-8.js @@ -7,14 +7,18 @@ es5id: 15.4.4.16-7-8 description: Array.prototype.every - no observable effects occur if len is 0 ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var obj = { 0: 11, 1: 12, length: 0 }; +var obj = { + 0: 11, + 1: 12, + length: 0 +}; assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-9.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-9.js index ded5d48e2588a89e91cc4c4a6584fa838fc44dc0..c1bbdfc1b1cbdb1e002c8bb9215a7c4cae3dce09 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-9.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-9.js @@ -9,22 +9,26 @@ description: > number of iterations ---*/ - var called = 0; +var called = 0; - function callbackfn(val, idx, obj) { - called++; - return val > 10; - } +function callbackfn(val, idx, obj) { + called++; + return val > 10; +} - var obj = { 1: 12, 2: 9, length: 2 }; +var obj = { + 1: 12, + 2: 9, + length: 2 +}; - Object.defineProperty(obj, "0", { - get: function () { - obj.length = 3; - return 11; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + obj.length = 3; + return 11; + }, + configurable: true +}); assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-1.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-1.js index e0f07ee54ef5302bc05d8d25486dc87a0e985d99..abcf91365cb4a659822fd1fc7953ff53c0e3fd8f 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-1.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-1.js @@ -9,15 +9,16 @@ description: > been assigned values ---*/ - var callCnt = 0.; - function callbackfn(val, Idx, obj) - { - callCnt++; - return true; - } +var callCnt = 0.; - var arr = new Array(10); - arr[1] = undefined; - arr.every(callbackfn); +function callbackfn(val, Idx, obj) +{ + callCnt++; + return true; +} + +var arr = new Array(10); +arr[1] = undefined; +arr.every(callbackfn); assert.sameValue(callCnt, 1, 'callCnt'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-10.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-10.js index e27ff642f6aaa81850bf2995aa443456357fb2da..913796b1f92d535ce8df880479770a43f623604f 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-10.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-10.js @@ -9,22 +9,26 @@ description: > prototype index property not to be visited on an Array-like Object ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return idx !== 1; - } - var arr = { 2: 2, length: 20 }; +var accessed = false; - Object.defineProperty(arr, "0", { - get: function () { - delete Object.prototype[1]; - return 0; - }, - configurable: true - }); +function callbackfn(val, idx, obj) { + accessed = true; + return idx !== 1; +} +var arr = { + 2: 2, + length: 20 +}; - Object.prototype[1] = 1; +Object.defineProperty(arr, "0", { + get: function() { + delete Object.prototype[1]; + return 0; + }, + configurable: true +}); + +Object.prototype[1] = 1; assert(Array.prototype.every.call(arr, callbackfn), 'Array.prototype.every.call(arr, callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-11.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-11.js index 54c86d50edfdb97c04f4e86dfb5fcbc23fb38529..c9ff957cbad8baf851d0a82ded76946de1b35138 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-11.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-11.js @@ -9,22 +9,23 @@ description: > prototype index property not to be visited on an Array ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return idx !== 1; - } - var arr = [0, , 2]; +var accessed = false; - Object.defineProperty(arr, "0", { - get: function () { - delete Array.prototype[1]; - return 0; - }, - configurable: true - }); +function callbackfn(val, idx, obj) { + accessed = true; + return idx !== 1; +} +var arr = [0, , 2]; - Array.prototype[1] = 1; +Object.defineProperty(arr, "0", { + get: function() { + delete Array.prototype[1]; + return 0; + }, + configurable: true +}); + +Array.prototype[1] = 1; assert(arr.every(callbackfn), 'arr.every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-12.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-12.js index fda1fe2a7e8f94807d7a7fd827bc9da87ebebe1c..63282ca5542833390242e01c7fe2b7c9ba2afb42 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-12.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-12.js @@ -10,23 +10,28 @@ description: > Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 1) { - return false; - } else { - return true; - } - } - var arr = { 0: 0, 1: 111, 2: 2, length: 10 }; +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 1) { + return false; + } else { + return true; + } +} +var arr = { + 0: 0, + 1: 111, + 2: 2, + length: 10 +}; - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); - Object.prototype[1] = 1; +Object.prototype[1] = 1; assert.sameValue(Array.prototype.every.call(arr, callbackfn), false, 'Array.prototype.every.call(arr, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-13.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-13.js index 4032502e513a935da527ac8f12535052d3add1e7..26f3f17d176a5d3d0f9bc7cd7cb945ea6df30a1a 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-13.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-13.js @@ -9,23 +9,23 @@ description: > property causes prototype index property to be visited on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 1) { - return false; - } else { - return true; - } - } - var arr = [0, 111, 2]; +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 1) { + return false; + } else { + return true; + } +} +var arr = [0, 111, 2]; - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); - Array.prototype[1] = 1; +Array.prototype[1] = 1; assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-14.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-14.js index 5115a27a3507a96e4171bec1f2ebedb094674c57..a017ff964342a67d5dc4b263e6fc9c1b4fb65c47 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-14.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-14.js @@ -9,20 +9,21 @@ description: > property not to be visited ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return idx !== 3; - } - var arr = [0, 1, 2, "last"]; +var accessed = false; - Object.defineProperty(arr, "0", { - get: function () { - arr.length = 3; - return 0; - }, - configurable: true - }); +function callbackfn(val, idx, obj) { + accessed = true; + return idx !== 3; +} +var arr = [0, 1, 2, "last"]; + +Object.defineProperty(arr, "0", { + get: function() { + arr.length = 3; + return 0; + }, + configurable: true +}); assert(arr.every(callbackfn), 'arr.every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-15.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-15.js index 03fa5344fe2f37e44c56a2357e74e355139a96e4..eeb2786e3b9824fc67dce867c19062a805abdd94 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-15.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-15.js @@ -9,28 +9,28 @@ description: > property causes prototype index property to be visited ---*/ - function callbackfn(val, idx, obj) { - if (idx === 2 && val === "prototype") { - return false; - } else { - return true; - } - } - var arr = [0, 1, 2]; +function callbackfn(val, idx, obj) { + if (idx === 2 && val === "prototype") { + return false; + } else { + return true; + } +} +var arr = [0, 1, 2]; - Object.defineProperty(Array.prototype, "2", { - get: function () { - return "prototype"; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "2", { + get: function() { + return "prototype"; + }, + configurable: true +}); - Object.defineProperty(arr, "1", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-16.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-16.js index 602b4b80c2a9391988828841e00625ba8ac9ac82..2bd39ef0ab64b64b13baf9203cb3ac944c9f2eb0 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-16.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-16.js @@ -10,29 +10,29 @@ description: > flags: [noStrict] ---*/ - function callbackfn(val, idx, obj) { - if (idx === 2 && val === "unconfigurable") { - return false; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 2 && val === "unconfigurable") { + return false; + } else { + return true; + } +} - var arr = [0, 1, 2]; +var arr = [0, 1, 2]; - Object.defineProperty(arr, "2", { - get: function () { - return "unconfigurable"; - }, - configurable: false - }); +Object.defineProperty(arr, "2", { + get: function() { + return "unconfigurable"; + }, + configurable: false +}); - Object.defineProperty(arr, "1", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-2.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-2.js index fca306466a1a4e0f61f2c3884d90b7ff93b3e09b..56c5b404f38f36023dfefc16d1c4f35ca48894c9 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-2.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-2.js @@ -7,22 +7,22 @@ es5id: 15.4.4.16-7-b-2 description: Array.prototype.every - added properties in step 2 are visible here ---*/ - function callbackfn(val, idx, obj) { - if (idx === 2 && val === "length") { - return false; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 2 && val === "length") { + return false; + } else { + return true; + } +} - var arr = { }; +var arr = {}; - Object.defineProperty(arr, "length", { - get: function () { - arr[2] = "length"; - return 3; - }, - configurable: true - }); +Object.defineProperty(arr, "length", { + get: function() { + arr[2] = "length"; + return 3; + }, + configurable: true +}); assert.sameValue(Array.prototype.every.call(arr, callbackfn), false, 'Array.prototype.every.call(arr, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-3.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-3.js index 9c7afe89aef981f2932afc94444cccfe62995a56..ca526b8ca2395c69ffd7d77bca76bff6b9625642 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-3.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-3.js @@ -9,20 +9,24 @@ description: > here ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return idx !== 2; - } - var arr = { 2: 6.99, 8: 19}; +var accessed = false; - Object.defineProperty(arr, "length", { - get: function () { - delete arr[2]; - return 10; - }, - configurable: true - }); +function callbackfn(val, idx, obj) { + accessed = true; + return idx !== 2; +} +var arr = { + 2: 6.99, + 8: 19 +}; + +Object.defineProperty(arr, "length", { + get: function() { + delete arr[2]; + return 10; + }, + configurable: true +}); assert(Array.prototype.every.call(arr, callbackfn), 'Array.prototype.every.call(arr, callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-4.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-4.js index dbcbe21dd100b943e9dd931d816b0bf2876afae5..691affd2ccb6fd5b4528148d6d1f778fe27265ba 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-4.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-4.js @@ -9,27 +9,29 @@ description: > current position are visited on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 1) { - return false; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 1) { + return false; + } else { + return true; + } +} - var arr = { length: 2 }; +var arr = { + length: 2 +}; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(arr, "1", { - get: function () { - return 1; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(arr, "1", { + get: function() { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); assert.sameValue(Array.prototype.every.call(arr, callbackfn), false, 'Array.prototype.every.call(arr, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-5.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-5.js index 5fd08b67e9114c78b308bd359aa15198319cdbdb..75cff0bfedabf53fffde704e8e673d2d1614aed5 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-5.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-5.js @@ -9,27 +9,27 @@ description: > current position are visited on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 1) { - return false; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 1) { + return false; + } else { + return true; + } +} - var arr = [0, , 2]; +var arr = [0, , 2]; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(arr, "1", { - get: function () { - return 1; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(arr, "1", { + get: function() { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-6.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-6.js index 4a71a83894642c0dee6aa0730a4c198d85914d0a..27663980cce4a24e1c5b7b5b30a887f8203b4d50 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-6.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-6.js @@ -9,26 +9,28 @@ description: > current position are visited on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 6.99) { - return false; - } else { - return true; - } - } - var arr = { length: 2 }; +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 6.99) { + return false; + } else { + return true; + } +} +var arr = { + length: 2 +}; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(Object.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(Object.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); assert.sameValue(Array.prototype.every.call(arr, callbackfn), false, 'Array.prototype.every.call(arr, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-7.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-7.js index 692c399de53bcecfabd6b75ab2508f958eac6b2a..92daa04a1924f79ea204fa4e12577ca65df00462 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-7.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-7.js @@ -9,26 +9,26 @@ description: > current position are visited on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 6.99) { - return false; - } else { - return true; - } - } - var arr = [0, , 2]; +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 6.99) { + return false; + } else { + return true; + } +} +var arr = [0, , 2]; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(Array.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(Array.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-8.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-8.js index 4bb911375b52909298a1eebdd9d157c9bc43429d..76f5f1cc01ad5f1b271c9123143fbd80a7f4e956 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-8.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-8.js @@ -9,27 +9,30 @@ description: > property not to be visited on an Array-like object ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return idx !== 1; - } - var obj = { length: 2 }; +var accessed = false; - Object.defineProperty(obj, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); +function callbackfn(val, idx, obj) { + accessed = true; + return idx !== 1; +} +var obj = { + length: 2 +}; - Object.defineProperty(obj, "0", { - get: function () { - delete obj[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + return 6.99; + }, + configurable: true +}); + +Object.defineProperty(obj, "0", { + get: function() { + delete obj[1]; + return 0; + }, + configurable: true +}); assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-9.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-9.js index 2c340f8d6347aaa55ca03fba2d0090f32e78a731..9159db9860cf04c6009d80946816fe4c33f50a2e 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-9.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-9.js @@ -9,27 +9,28 @@ description: > property not to be visited on an Array ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return idx !== 1; - } - var arr = [1, 2]; +var accessed = false; - Object.defineProperty(arr, "1", { - get: function () { - return "6.99"; - }, - configurable: true - }); +function callbackfn(val, idx, obj) { + accessed = true; + return idx !== 1; +} +var arr = [1, 2]; - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + return "6.99"; + }, + configurable: true +}); + +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); assert(arr.every(callbackfn), 'arr.every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-1.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-1.js index 579deb13d282e3bc24e39d8baf9e36217e40c3ca..fd1e28b5f0786d75c586647e446e5bd86595e22c 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-1.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-1.js @@ -9,15 +9,19 @@ description: > property on an Array-like object ---*/ - var kValue = { }; - function callbackfn(val, idx, obj) { - if (idx === 5) { - return val !== kValue; - } else { - return true; - } - } +var kValue = {}; - var obj = { 5: kValue, length: 100 }; +function callbackfn(val, idx, obj) { + if (idx === 5) { + return val !== kValue; + } else { + return true; + } +} + +var obj = { + 5: kValue, + length: 100 +}; assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-10.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-10.js index 1357bbb23ab616aadc3d64eb5a12c7b442dc3893..653e5e24452b1b908b62788ab8ea26d7344cd34b 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-10.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-10.js @@ -9,21 +9,21 @@ description: > property on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 2) { - return val !== 12; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 2) { + return val !== 12; + } else { + return true; + } +} - var arr = []; +var arr = []; - Object.defineProperty(arr, "2", { - get: function () { - return 12; - }, - configurable: true - }); +Object.defineProperty(arr, "2", { + get: function() { + return 12; + }, + configurable: true +}); assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-11.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-11.js index 9527daf83e986bc9d1cf7aebac433d8495211934..4168c98f9448d1f819eb38174b2ed5924add7727 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-11.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-11.js @@ -10,27 +10,30 @@ description: > Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === 5; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 5; + } else { + return true; + } +} - var proto = { 0: 5, 1: 6 }; +var proto = { + 0: 5, + 1: 6 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 10; +var child = new Con(); +child.length = 10; - Object.defineProperty(child, "0", { - get: function () { - return 11; - }, - configurable: true - }); +Object.defineProperty(child, "0", { + get: function() { + return 11; + }, + configurable: true +}); assert.sameValue(Array.prototype.every.call(child, callbackfn), false, 'Array.prototype.every.call(child, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-12.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-12.js index 54751e56620344d59c264797542077078afce503..c1f29b18b83d8ac60cd9b677bebb42dacab070c7 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-12.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-12.js @@ -9,23 +9,23 @@ description: > property that overrides an inherited data property on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === 10; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 10; + } else { + return true; + } +} - var arr = []; +var arr = []; - Array.prototype[0] = 10; +Array.prototype[0] = 10; - Object.defineProperty(arr, "0", { - get: function () { - return 111; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + return 111; + }, + configurable: true +}); assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-13.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-13.js index aff2f0b0e6a9b9dd3c0d63200d3f326e7b3d42c4..5ffb1d54444d28be7272f8c93d22b6ee1602b8d6 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-13.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-13.js @@ -10,35 +10,35 @@ description: > Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1) { - return val === 6; - } else { - return true; - } - } - - var proto = {}; - - Object.defineProperty(proto, "1", { - get: function () { - return 6; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 10; - - Object.defineProperty(child, "1", { - get: function () { - return 12; - }, - configurable: true - }); +function callbackfn(val, idx, obj) { + if (idx === 1) { + return val === 6; + } else { + return true; + } +} + +var proto = {}; + +Object.defineProperty(proto, "1", { + get: function() { + return 6; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 10; + +Object.defineProperty(child, "1", { + get: function() { + return 12; + }, + configurable: true +}); assert.sameValue(Array.prototype.every.call(child, callbackfn), false, 'Array.prototype.every.call(child, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-14.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-14.js index 544ef938b3530d4a58e9e94864ca8cf82ab44dd6..1cf1f75a2b6bb68afb38446fab87b70d9adbcbd0 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-14.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-14.js @@ -9,28 +9,28 @@ description: > property that overrides an inherited accessor property on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === 5; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 5; + } else { + return true; + } +} - var arr = []; +var arr = []; - Object.defineProperty(Array.prototype, "0", { - get: function () { - return 5; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return 5; + }, + configurable: true +}); - Object.defineProperty(arr, "0", { - get: function () { - return 11; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + return 11; + }, + configurable: true +}); assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-15.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-15.js index bc8906dfcb4cf3a1a29500b81f963274075d3793..aab698397bb25f5670c73b87d5115becb8c8eb36 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-15.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-15.js @@ -9,27 +9,27 @@ description: > accessor property on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1) { - return val !== 11; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + return val !== 11; + } else { + return true; + } +} - var proto = {}; +var proto = {}; - Object.defineProperty(proto, "1", { - get: function () { - return 11; - }, - configurable: true - }); +Object.defineProperty(proto, "1", { + get: function() { + return 11; + }, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 20; +var child = new Con(); +child.length = 20; assert.sameValue(Array.prototype.every.call(child, callbackfn), false, 'Array.prototype.every.call(child, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-16.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-16.js index 20a2741807fba7c5213c78b972efb9cb0af9ad59..c249d76b1eb2984de2167b9bf22acbb9c08c8ab6 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-16.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-16.js @@ -9,19 +9,19 @@ description: > accessor property on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val !== 11; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val !== 11; + } else { + return true; + } +} - Object.defineProperty(Array.prototype, "0", { - get: function () { - return 11; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return 11; + }, + configurable: true +}); assert.sameValue([, , , ].every(callbackfn), false, '[, , , ].every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-17.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-17.js index 948c741bd89350f30749268b56802aa6aabec787..9b52fef8fa5bfc67c08b0db7f4652c311193bec3 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-17.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-17.js @@ -9,18 +9,20 @@ description: > property without a get function on an Array-like object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return typeof val === "undefined"; - } +function callbackfn(val, idx, obj) { + accessed = true; + return typeof val === "undefined"; +} - var obj = { length: 2 }; - Object.defineProperty(obj, "1", { - set: function () { }, - configurable: true - }); +var obj = { + length: 2 +}; +Object.defineProperty(obj, "1", { + set: function() {}, + configurable: true +}); assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-18.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-18.js index 7911ea384bc8de1a329ab4634e7300bd6cc4d6ea..300d32b8284c68923e79a1386eac93c2c3e4d447 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-18.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-18.js @@ -9,19 +9,19 @@ description: > property without a get function on an Array ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return typeof val === "undefined"; - } +function callbackfn(val, idx, obj) { + accessed = true; + return typeof val === "undefined"; +} - var arr = []; +var arr = []; - Object.defineProperty(arr, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(arr, "0", { + set: function() {}, + configurable: true +}); assert(arr.every(callbackfn), 'arr.every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-19.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-19.js index 26ae16c5a35d53f05a87da406b708ce35650d8e9..cc150375a8e0da2f97fb0c3c3267fd42d49ef6bf 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-19.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-19.js @@ -10,20 +10,22 @@ description: > accessor property on an Array-like object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return typeof val === "undefined"; - } +function callbackfn(val, idx, obj) { + accessed = true; + return typeof val === "undefined"; +} - var obj = { length: 2 }; - Object.defineProperty(obj, "1", { - set: function () { }, - configurable: true - }); +var obj = { + length: 2 +}; +Object.defineProperty(obj, "1", { + set: function() {}, + configurable: true +}); - Object.prototype[1] = 10; +Object.prototype[1] = 10; assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-2.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-2.js index 5a201fde8bbe6ad4470ac16da0ddd35e195259b3..5afcd1e0b7c66cf7f271f5abc7210ca3bf1aa68a 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-2.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-2.js @@ -9,12 +9,12 @@ description: > property on an Array ---*/ - var called = 0; +var called = 0; - function callbackfn(val, idx, obj) { - called++; - return val === 11; - } +function callbackfn(val, idx, obj) { + called++; + return val === 11; +} assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert.sameValue(called, 1, 'called'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-20.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-20.js index 38e384bb23a514b6f0bfdc3d46a6b846fc665cc1..8a5fa313915c550ba93401a102264ebc47c70423 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-20.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-20.js @@ -10,21 +10,21 @@ description: > accessor property on an Array ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return typeof val === "undefined"; - } +function callbackfn(val, idx, obj) { + accessed = true; + return typeof val === "undefined"; +} - var arr = []; +var arr = []; - Object.defineProperty(arr, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(arr, "0", { + set: function() {}, + configurable: true +}); - Array.prototype[0] = 100; +Array.prototype[0] = 100; assert(arr.every(callbackfn), 'arr.every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-21.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-21.js index c905856ef0d7097e56fa66efcb63a27ccb41aa07..b6d06142ecbbfb4f77c70b445e9195d7167434db 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-21.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-21.js @@ -9,24 +9,24 @@ description: > accessor property without a get function on an Array-like object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return typeof val === "undefined"; - } +function callbackfn(val, idx, obj) { + accessed = true; + return typeof val === "undefined"; +} - var proto = {}; - Object.defineProperty(proto, "1", { - set: function () { }, - configurable: true - }); +var proto = {}; +Object.defineProperty(proto, "1", { + set: function() {}, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 2; +var child = new Con(); +child.length = 2; assert(Array.prototype.every.call(child, callbackfn), 'Array.prototype.every.call(child, callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-22.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-22.js index aaa682d440aa58ff765b7c010690d7ada929c93a..9477b201fd26700c562d94cafa59b66c676894fc 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-22.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-22.js @@ -9,17 +9,17 @@ description: > accessor property without a get function on an Array ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return typeof val === "undefined"; - } +function callbackfn(val, idx, obj) { + accessed = true; + return typeof val === "undefined"; +} - Object.defineProperty(Array.prototype, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + set: function() {}, + configurable: true +}); assert([, ].every(callbackfn), '[, ].every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-25.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-25.js index 2900f50338711aea635b349ecb6634948e0f6c11..c39d506641e2622fd6b3ab8fe1eccb56615b48da 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-25.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-25.js @@ -10,16 +10,16 @@ description: > less than number of parameters) ---*/ - var called = 0; +var called = 0; - function callbackfn(val, idx, obj) { - called++; - return val === 11; - } +function callbackfn(val, idx, obj) { + called++; + return val === 11; +} - var func = function (a, b) { - return Array.prototype.every.call(arguments, callbackfn); - }; +var func = function(a, b) { + return Array.prototype.every.call(arguments, callbackfn); +}; assert(func(11), 'func(11) !== true'); assert.sameValue(called, 1, 'called'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-26.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-26.js index 6e636fbb95ee310c248f3d7905e947bfece9f71e..3e1c7da804daacef68e69eef22a8c3b3931ecccf 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-26.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-26.js @@ -10,22 +10,22 @@ description: > number of parameters) ---*/ - var called = 0; +var called = 0; - function callbackfn(val, idx, obj) { - called++; - if (idx === 0) { - return val === 11; - } else if (idx === 1) { - return val === 9; - } else { - return false; - } - } +function callbackfn(val, idx, obj) { + called++; + if (idx === 0) { + return val === 11; + } else if (idx === 1) { + return val === 9; + } else { + return false; + } +} - var func = function (a, b) { - return Array.prototype.every.call(arguments, callbackfn); - }; +var func = function(a, b) { + return Array.prototype.every.call(arguments, callbackfn); +}; assert(func(11, 9), 'func(11, 9) !== true'); assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-27.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-27.js index c1c2719defae70608f517a9b53eb16d64dd76633..2002d812a12abc557e87826ca334d513fb080222 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-27.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-27.js @@ -10,22 +10,22 @@ description: > greater than number of parameters) ---*/ - var called = 0; +var called = 0; - function callbackfn(val, idx, obj) { - called++; - if (idx < 2) { - return val > 10; - } else if (idx === 2) { - return val < 10; - } else { - return false; - } - } +function callbackfn(val, idx, obj) { + called++; + if (idx < 2) { + return val > 10; + } else if (idx === 2) { + return val < 10; + } else { + return false; + } +} - var func = function (a, b) { - return Array.prototype.every.call(arguments, callbackfn); - }; +var func = function(a, b) { + return Array.prototype.every.call(arguments, callbackfn); +}; assert(func(11, 12, 9), 'func(11, 12, 9) !== true'); assert.sameValue(called, 3, 'called'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-28.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-28.js index d39ed23c0e44508f5eb09743160d0e63199d89f8..425efe58997e82c244138e93943d0a50332e70b3 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-28.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-28.js @@ -9,30 +9,30 @@ description: > iterations is observed on an Array ---*/ - var preIterVisible = false; - var arr = []; +var preIterVisible = false; +var arr = []; - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - Object.defineProperty(arr, "0", { - get: function () { - preIterVisible = true; - return 11; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + preIterVisible = true; + return 11; + }, + configurable: true +}); - Object.defineProperty(arr, "1", { - get: function () { - if (preIterVisible) { - return 9; - } else { - return 11; - } - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + if (preIterVisible) { + return 9; + } else { + return 11; + } + }, + configurable: true +}); assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-29.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-29.js index dbc91eb1503a06323d621f6735eb976f4b573ffe..90c121c97228d6bdff87230019a9def27d2bda1f 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-29.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-29.js @@ -9,30 +9,32 @@ description: > iterations is observed on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var preIterVisible = false; - var obj = { length: 2 }; +var preIterVisible = false; +var obj = { + length: 2 +}; - Object.defineProperty(obj, "0", { - get: function () { - preIterVisible = true; - return 11; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + preIterVisible = true; + return 11; + }, + configurable: true +}); - Object.defineProperty(obj, "1", { - get: function () { - if (preIterVisible) { - return 9; - } else { - return 13; - } - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + if (preIterVisible) { + return 9; + } else { + return 13; + } + }, + configurable: true +}); assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-3.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-3.js index c4fe3a8144e7ce106faac968aac190a5e789b943..d0eac70c03271dc268ac51038a8f930a764d8595 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-3.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-3.js @@ -9,21 +9,24 @@ description: > property that overrides an inherited data property on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 5) { - return val === 100; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 5) { + return val === 100; + } else { + return true; + } +} - var proto = { 0: 11, 5: 100 }; +var proto = { + 0: 11, + 5: 100 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[5] = "abc"; - child.length = 10; +var child = new Con(); +child[5] = "abc"; +child.length = 10; assert.sameValue(Array.prototype.every.call(child, callbackfn), false, 'Array.prototype.every.call(child, callbackfn)'); 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 3bd5fd64916f718b984c9525b23cccb54ee23999..04f0d513810f6e58dae4f3f445d67364d89e3283 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 @@ -9,22 +9,28 @@ description: > terminate iteration on an Array-like object ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - if (idx > 1) { - accessed = true; - } - return true; - } +var accessed = false; - var obj = { 0: 11, 5: 10, 10: 8, length: 20 }; - Object.defineProperty(obj, "1", { - get: function () { - throw new RangeError("unhandle exception happened in getter"); - }, - configurable: true - }); +function callbackfn(val, idx, obj) { + if (idx > 1) { + accessed = true; + } + return true; +} + +var obj = { + 0: 11, + 5: 10, + 10: 8, + length: 20 +}; +Object.defineProperty(obj, "1", { + get: function() { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true +}); assert.throws(RangeError, function() { - Array.prototype.every.call(obj, callbackfn); + Array.prototype.every.call(obj, callbackfn); }); 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 3214e3376e34f9ea80fa8bcab9f1d49d8007be97..b28796ac8093aad93577db4ee3885006509b370a 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 @@ -9,25 +9,26 @@ description: > terminate iteration on an Array ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - if (idx > 1) { - accessed = true; - } - return true; - } +var accessed = false; - var arr = []; - arr[5] = 10; - arr[10] = 100; +function callbackfn(val, idx, obj) { + if (idx > 1) { + accessed = true; + } + return true; +} - Object.defineProperty(arr, "1", { - get: function () { - throw new RangeError("unhandle exception happened in getter"); - }, - configurable: true - }); +var arr = []; +arr[5] = 10; +arr[10] = 100; + +Object.defineProperty(arr, "1", { + get: function() { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true +}); assert.throws(RangeError, function() { - arr.every(callbackfn); + arr.every(callbackfn); }); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-4.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-4.js index 9c598c783ed3fc3ea16fcd1a9a84c0060b0a0fdc..d9e81c6df38be50bad9707b0a7c569d24423502b 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-4.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-4.js @@ -9,14 +9,15 @@ description: > property that overrides an inherited data property on an Array ---*/ - var called = 0; - function callbackfn(val, idx, obj) { - called++; - return val === 12; - } +var called = 0; - Array.prototype[0] = 11; - Array.prototype[1] = 11; +function callbackfn(val, idx, obj) { + called++; + return val === 12; +} + +Array.prototype[0] = 11; +Array.prototype[1] = 11; assert([12, 12].every(callbackfn), '[12, 12].every(callbackfn) !== true'); assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-5.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-5.js index 988ac8f6e94182f64d2a87806c1c009426cdbcf0..25c26707864dcd8be4dc780588025fc65ee6c546 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-5.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-5.js @@ -10,32 +10,32 @@ description: > Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === 5; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 5; + } else { + return true; + } +} - var proto = {}; +var proto = {}; - Object.defineProperty(proto, "0", { - get: function () { - return 5; - }, - configurable: true - }); +Object.defineProperty(proto, "0", { + get: function() { + return 5; + }, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 2; - Object.defineProperty(child, "0", { - value: 11, - configurable: true - }); - child[1] = 12; +var child = new Con(); +child.length = 2; +Object.defineProperty(child, "0", { + value: 11, + configurable: true +}); +child[1] = 12; assert.sameValue(Array.prototype.every.call(child, callbackfn), false, 'Array.prototype.every.call(child, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-6.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-6.js index da98350be502fd59871ee7635ef865601c099e46..9575fe8adb9b5cd7d118d3bcc6c96dcb732301ff 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-6.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-6.js @@ -9,19 +9,19 @@ description: > property that overrides an inherited accessor property on an Array ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val === 11; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val === 11; +} - Object.defineProperty(Array.prototype, "0", { - get: function () { - return 9; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return 9; + }, + configurable: true +}); assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-7.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-7.js index f0d11eb5bfcc580b9019b3422c14379509e1b0db..10d9ab7dbb9acf5719f2b78c93ccd545801f516b 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-7.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-7.js @@ -9,22 +9,24 @@ description: > property on an Array-like object ---*/ - var kValue = 'abc'; +var kValue = 'abc'; - function callbackfn(val, idx, obj) { - if (idx === 5) { - return val !== kValue; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 5) { + return val !== kValue; + } else { + return true; + } +} - var proto = { 5: kValue }; +var proto = { + 5: kValue +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 10; +var child = new Con(); +child.length = 10; assert.sameValue(Array.prototype.every.call(child, callbackfn), false, 'Array.prototype.every.call(child, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-8.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-8.js index f36b5423689de81c846b4c55d07367288d42d6ba..507af757aa3d5c66b3b36bbb573ec5913491d470 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-8.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-8.js @@ -9,14 +9,14 @@ description: > property on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1) { - return val !== 13; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + return val !== 13; + } else { + return true; + } +} - Array.prototype[1] = 13; +Array.prototype[1] = 13; assert.sameValue([, , , ].every(callbackfn), false, '[, , , ].every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-9.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-9.js index 5b37f8ab441acd722cc89f91f30d3a8ca0374a72..49392cb8a78e42c35966fd29a868ecee0cf81f8e 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-9.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-9.js @@ -9,22 +9,25 @@ description: > property on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val !== 11; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val !== 11; + } else { + return true; + } +} - var obj = { 10: 10, length: 20 }; +var obj = { + 10: 10, + length: 20 +}; - Object.defineProperty(obj, "0", { - get: function () { - return 11; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + return 11; + }, + configurable: true +}); assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-1.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-1.js index 559925a6968fe1281d9f7b44f163895f0153844d..fff7c361cde53ca749cff09394c130525685d119 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-1.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-1.js @@ -7,13 +7,13 @@ es5id: 15.4.4.16-7-c-ii-1 description: Array.prototype.every - callbackfn called with correct parameters ---*/ - function callbackfn(val, Idx, obj) - { - if(obj[Idx] === val) - return true; - } +function callbackfn(val, Idx, obj) +{ + if (obj[Idx] === val) + return true; +} - var arr = [0,1,2,3,4,5,6,7,8,9]; +var arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; assert.sameValue(arr.every(callbackfn), true, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-10.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-10.js index 3a67002bfc0ea7ff3eb2afb7cceb7bd9b0291648..118130921ca448baf7369241e3bd702464294b39 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-10.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-10.js @@ -9,12 +9,12 @@ description: > parameter ---*/ - var called = 0; +var called = 0; - function callbackfn(val) { - called++; - return val > 10; - } +function callbackfn(val) { + called++; + return val > 10; +} assert([11, 12].every(callbackfn), '[11, 12].every(callbackfn) !== true'); assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-11.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-11.js index 41797d60cd2b13297c0b918b3bf3414d5c5ee265..1ed6ecb0dc2f9caff7ecba6225f222c405bee077 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-11.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-11.js @@ -9,12 +9,12 @@ description: > parameter ---*/ - var called = 0; +var called = 0; - function callbackfn(val, idx) { - called++; - return val > 10 && arguments[2][idx] === val; - } +function callbackfn(val, idx) { + called++; + return val > 10 && arguments[2][idx] === val; +} assert([11, 12].every(callbackfn), '[11, 12].every(callbackfn) !== true'); assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-12.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-12.js index 0724d0b3fac7d0692aabd68ea70706cadd11ca31..62eefe55bbf22118a516a62201e2242216ae3c50 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-12.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-12.js @@ -9,12 +9,12 @@ description: > parameter ---*/ - var called = 0; +var called = 0; - function callbackfn(val, idx, obj) { - called++; - return val > 10 && obj[idx] === val; - } +function callbackfn(val, idx, obj) { + called++; + return val > 10 && obj[idx] === val; +} assert([11, 12, 13].every(callbackfn), '[11, 12, 13].every(callbackfn) !== true'); assert.sameValue(called, 3, 'called'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-13.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-13.js index 340b49aff16031e5de6f8a7a770948b243e80aa6..8f30c0a8c4ea1798b0057fe72202d47b767b2218 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-13.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-13.js @@ -9,12 +9,12 @@ description: > get parameter value ---*/ - var called = 0; +var called = 0; - function callbackfn() { - called++; - return arguments[2][arguments[1]] === arguments[0]; - } +function callbackfn() { + called++; + return arguments[2][arguments[1]] === arguments[0]; +} assert([11, 12].every(callbackfn), '[11, 12].every(callbackfn) !== true'); assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-16.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-16.js index f9a5dc890a82836c4a2f664164f2292cc7bd1045..379efe7654bae13158b708ab4b5d37f4b851da25 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-16.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-16.js @@ -9,14 +9,17 @@ description: > when T is not an object (T is a boolean primitive) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return this.valueOf() !== false; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this.valueOf() !== false; +} - var obj = { 0: 11, length: 2 }; +var obj = { + 0: 11, + length: 2 +}; assert.sameValue(Array.prototype.every.call(obj, callbackfn, false), false, 'Array.prototype.every.call(obj, callbackfn, false)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-17.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-17.js index 3732ea4417db57dbda2ad2065906239ccca61e8a..f9d83678ecde2ff7c0422b8771ed1a29bf6b6430 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-17.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-17.js @@ -9,14 +9,17 @@ description: > when T is not an object (T is a number primitive) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, o) { - accessed = true; - return 5 === this.valueOf(); - } +function callbackfn(val, idx, o) { + accessed = true; + return 5 === this.valueOf(); +} - var obj = { 0: 11, length: 2 }; +var obj = { + 0: 11, + length: 2 +}; assert(Array.prototype.every.call(obj, callbackfn, 5), 'Array.prototype.every.call(obj, callbackfn, 5) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-18.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-18.js index 3392433cbe3f6eabcde27a452fd14432f91770b7..17c1668bc2633bf127a0c9f37173c9dd9507fcc1 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-18.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-18.js @@ -9,14 +9,17 @@ description: > when T is not an object (T is a string primitive) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return 'hello' === this.valueOf(); - } +function callbackfn(val, idx, obj) { + accessed = true; + return 'hello' === this.valueOf(); +} - var obj = { 0: 11, length: 2 }; +var obj = { + 0: 11, + length: 2 +}; assert(Array.prototype.every.call(obj, callbackfn, "hello"), 'Array.prototype.every.call(obj, callbackfn, "hello") !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-19.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-19.js index f861f38e613f69ae25097a7d4bc1918b2de04e0c..cc7626465e6d1bb4e124256020eadedaeb9ec15a 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-19.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-19.js @@ -7,14 +7,19 @@ es5id: 15.4.4.16-7-c-ii-19 description: Array.prototype.every - non-indexed properties are not called ---*/ - var called = 0; +var called = 0; - function callbackfn(val, idx, obj) { - called++; - return val !== 8; - } +function callbackfn(val, idx, obj) { + called++; + return val !== 8; +} - var obj = { 0: 11, 10: 12, non_index_property: 8, length: 20 }; +var obj = { + 0: 11, + 10: 12, + non_index_property: 8, + length: 20 +}; assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-2.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-2.js index 0194ce3871fbf01da06528e71e08527dd1dabf6a..daacdfda481d20d6d4fd447e0dfd848f66c039c5 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-2.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-2.js @@ -7,14 +7,14 @@ es5id: 15.4.4.16-7-c-ii-2 description: Array.prototype.every - callbackfn takes 3 arguments ---*/ - function callbackfn(val, Idx, obj) - { - if(arguments.length === 3) //verify if callbackfn was called with 3 parameters - return true; - } +function callbackfn(val, Idx, obj) +{ + if (arguments.length === 3) //verify if callbackfn was called with 3 parameters + return true; +} - var arr = [0,1,true,null,new Object(),"five"]; - arr[999999] = -6.6; +var arr = [0, 1, true, null, new Object(), "five"]; +arr[999999] = -6.6; assert.sameValue(arr.every(callbackfn), true, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-20.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-20.js index 9cb001e0c8957e4e828117d68385d5d4dcb68f42..23fe1f4c118125972b016338e32fb89310e4ea71 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-20.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-20.js @@ -9,15 +9,20 @@ description: > (thisArg is correct) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return 10 === this.threshold; - } +function callbackfn(val, idx, obj) { + accessed = true; + return 10 === this.threshold; +} - var thisArg = { threshold: 10 }; +var thisArg = { + threshold: 10 +}; - var obj = { 0: 11, length: 1 }; +var obj = { + 0: 11, + length: 1 +}; assert(Array.prototype.every.call(obj, callbackfn, thisArg), 'Array.prototype.every.call(obj, callbackfn, thisArg) !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-21.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-21.js index 2d193c698ef8a7c2a9c0df59c73707641e1895b6..4153657136f9214d9375ebb963568738776452e8 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-21.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-21.js @@ -9,21 +9,25 @@ description: > (kValue is correct) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - if (idx === 0) { - return val === 11; - } +function callbackfn(val, idx, obj) { + accessed = true; + if (idx === 0) { + return val === 11; + } - if (idx === 1) { - return val === 12; - } + if (idx === 1) { + return val === 12; + } - } +} - var obj = { 0: 11, 1: 12, length: 2 }; +var obj = { + 0: 11, + 1: 12, + length: 2 +}; assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-22.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-22.js index 524d6196525dcd1348fc85663249de04365f941c..bd56fc0a95ddca29ae2d6b059bbd5824ae9abe98 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-22.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-22.js @@ -9,21 +9,25 @@ description: > (the index k is correct) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - if (val === 11) { - return idx === 0; - } +function callbackfn(val, idx, obj) { + accessed = true; + if (val === 11) { + return idx === 0; + } - if (val === 12) { - return idx === 1; - } + if (val === 12) { + return idx === 1; + } - } +} - var obj = { 0: 11, 1: 12, length: 2 }; +var obj = { + 0: 11, + 1: 12, + length: 2 +}; assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-23.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-23.js index e5567884be115e726dbabdcff9bcabab97de25df..59a1e556622700fa3bfa3f70b9fd1ba31c814c65 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-23.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-23.js @@ -9,13 +9,17 @@ description: > (this object O is correct) ---*/ - var called = 0; - var obj = { 0: 11, 1: 12, length: 2 }; +var called = 0; +var obj = { + 0: 11, + 1: 12, + length: 2 +}; - function callbackfn(val, idx, o) { - called++; - return obj === o; - } +function callbackfn(val, idx, o) { + called++; + return obj === o; +} assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-3.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-3.js index 39da9d01feeab5b17aae9a36d37052752d79d042..f35df89130fd4f83878db16725eb1cedc533383d 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-3.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-3.js @@ -9,17 +9,18 @@ description: > returns false ---*/ - var callCnt = 0; - function callbackfn(val, idx, obj) - { - callCnt++; - if(idx > 5) - return false; - else - return true; - } +var callCnt = 0; - var arr = [0,1,2,3,4,5,6,7,8,9]; +function callbackfn(val, idx, obj) +{ + callCnt++; + if (idx > 5) + return false; + else + return true; +} + +var arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-4.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-4.js index 9a4216a673ffa56c0f24fc60882e2297bec8fd4a..07a4d691a65391779c0b5a84a074526688ce0bfa 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-4.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-4.js @@ -9,18 +9,19 @@ description: > order ---*/ - var arr = [0, 1, 2, 3, 4, 5]; - var lastIdx = 0; - var called = 0; - function callbackfn(val, idx, o) { - called++; - if (lastIdx !== idx) { - return false; - } else { - lastIdx++; - return true; - } - } +var arr = [0, 1, 2, 3, 4, 5]; +var lastIdx = 0; +var called = 0; + +function callbackfn(val, idx, o) { + called++; + if (lastIdx !== idx) { + return false; + } else { + lastIdx++; + return true; + } +} assert(arr.every(callbackfn), 'arr.every(callbackfn) !== true'); assert.sameValue(arr.length, called, 'arr.length'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-5.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-5.js index edd62427fbd14ee2c094ca28e5a770edd82e1aa9..f604f96720f5a1c42b2ff9a17796866273e3e352 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-5.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-5.js @@ -9,24 +9,24 @@ description: > iteration and not prior to starting the loop on an Array ---*/ - var called = 0; - var kIndex = []; +var called = 0; +var kIndex = []; - //By below way, we could verify that k would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time. - function callbackfn(val, idx, obj) { - called++; - //Each position should be visited one time, which means k is accessed one time during iterations. - if (typeof kIndex[idx] === "undefined") { - //when current position is visited, its previous index should has been visited. - if (idx !== 0 && typeof kIndex[idx - 1] === "undefined") { - return false; - } - kIndex[idx] = 1; - return true; - } else { - return false; - } - } +//By below way, we could verify that k would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time. +function callbackfn(val, idx, obj) { + called++; + //Each position should be visited one time, which means k is accessed one time during iterations. + if (typeof kIndex[idx] === "undefined") { + //when current position is visited, its previous index should has been visited. + if (idx !== 0 && typeof kIndex[idx - 1] === "undefined") { + return false; + } + kIndex[idx] = 1; + return true; + } else { + return false; + } +} assert([11, 12, 13, 14].every(callbackfn, undefined), '[11, 12, 13, 14].every(callbackfn, undefined) !== true'); assert.sameValue(called, 4, 'called'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-6.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-6.js index d1c33e9674f37329d313db41127f89af7129744b..df9f83143c4aea4f50bdd8647f041376dbcdb521 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-6.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-6.js @@ -7,17 +7,20 @@ es5id: 15.4.4.16-7-c-ii-6 description: Array.prototype.every - arguments to callbackfn are self consistent ---*/ - var accessed = false; - var thisArg = {}; - var obj = { 0: 11, length: 1 }; +var accessed = false; +var thisArg = {}; +var obj = { + 0: 11, + length: 1 +}; - function callbackfn() { - accessed = true; - return this === thisArg && - arguments[0] === 11 && - arguments[1] === 0 && - arguments[2] === obj; - } +function callbackfn() { + accessed = true; + return this === thisArg && + arguments[0] === 11 && + arguments[1] === 0 && + arguments[2] === obj; +} assert(Array.prototype.every.call(obj, callbackfn, thisArg), 'Array.prototype.every.call(obj, callbackfn, thisArg) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-7.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-7.js index d3f0f8eff845c04ae68c977f25c5a3a3990358d5..c1a6345d83796fc589c1cf7892559f9f975f24db 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-7.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-7.js @@ -9,20 +9,25 @@ description: > callbackfn terminate iteration ---*/ - var called = 0; +var called = 0; - function callbackfn(val, idx, obj) { - called++; - if (called === 1) { - throw new Test262Error("Exception occurred in callbackfn"); - } - return true; - } +function callbackfn(val, idx, obj) { + called++; + if (called === 1) { + throw new Test262Error("Exception occurred in callbackfn"); + } + return true; +} - var obj = { 0: 11, 4: 10, 10: 8, length: 20 }; +var obj = { + 0: 11, + 4: 10, + 10: 8, + length: 20 +}; assert.throws(Test262Error, function() { - Array.prototype.every.call(obj, callbackfn); + Array.prototype.every.call(obj, callbackfn); }); assert.sameValue(called, 1, 'called'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-8.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-8.js index 26fb2b97a98a230738d71158f0f58e8432488108..6f015b207b15ebbd519dc4907ae7a6da1b329b2d 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-8.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-8.js @@ -9,14 +9,18 @@ description: > iterations is observed ---*/ - var obj = { 0: 11, 1: 12, length: 2 }; +var obj = { + 0: 11, + 1: 12, + length: 2 +}; - function callbackfn(val, idx, o) { - if (idx === 0) { - obj[idx + 1] = 8; - } - return val > 10; - } +function callbackfn(val, idx, o) { + if (idx === 0) { + obj[idx + 1] = 8; + } + return val > 10; +} diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-9.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-9.js index dfc3894db7ba9e53a46fb042859992bc3bff945c..b033642755958843a133ae978bf1e18937df5a98 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-9.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-9.js @@ -9,12 +9,12 @@ description: > parameter ---*/ - var called = 0; +var called = 0; - function callbackfn() { - called++; - return true; - } +function callbackfn() { + called++; + return true; +} assert([11, 12].every(callbackfn), '[11, 12].every(callbackfn) !== true'); assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-1.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-1.js index f29e4f155bfdf9f0e8efebbfad694486a9fc9fe8..bafc7b84117f031b9e10672be0f120b65ab6199a 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-1.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-1.js @@ -7,13 +7,16 @@ es5id: 15.4.4.16-7-c-iii-1 description: Array.prototype.every - return value of callbackfn is undefined ---*/ - var accessed = false; - var obj = { 0: 11, length: 1 }; +var accessed = false; +var obj = { + 0: 11, + length: 1 +}; - function callbackfn(val, idx, o) { - accessed = true; - return undefined; - } +function callbackfn(val, idx, o) { + accessed = true; + return undefined; +} diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-10.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-10.js index 6f806273d8b7255cbbc248f219bf287bad9707d9..f495dd02c25064e39cd3cf048b3c1ef604fa66d7 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-10.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-10.js @@ -9,12 +9,12 @@ description: > (value is Infinity) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return Infinity; - } +function callbackfn(val, idx, obj) { + accessed = true; + return Infinity; +} assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-11.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-11.js index 923f6e28b051c2477d7475d1e9d84541114f31a1..b761964aef3a930bf7c634c859bd0bff639d2b3a 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-11.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-11.js @@ -9,12 +9,12 @@ description: > (value is -Infinity) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return -Infinity; - } +function callbackfn(val, idx, obj) { + accessed = true; + return -Infinity; +} assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-12.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-12.js index a8ee187e32f9e45b50a1b256b329620c6dde99eb..0ac2e55360dd68c341ad4bbc472943860ac5b24c 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-12.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-12.js @@ -9,12 +9,12 @@ description: > (value is NaN) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return NaN; - } +function callbackfn(val, idx, obj) { + accessed = true; + return NaN; +} assert.sameValue([11].every(callbackfn), false, '[11].every(callbackfn)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-13.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-13.js index 4185bfa74545342e2f1073b693764beec71622be..931cb99cae79333356b920f7b50ea4562639f397 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-13.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-13.js @@ -9,12 +9,12 @@ description: > string ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return ""; - } +function callbackfn(val, idx, obj) { + accessed = true; + return ""; +} assert.sameValue([11].every(callbackfn), false, '[11].every(callbackfn)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-14.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-14.js index 5e7cbea1c6773146309e74f92b2b1369171dfe41..ce75448e9173e075f290c2c5bccbf3297267f9da 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-14.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-14.js @@ -9,12 +9,12 @@ description: > string ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return "non-empty string"; - } +function callbackfn(val, idx, obj) { + accessed = true; + return "non-empty string"; +} assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-15.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-15.js index 2b577983b9a6a1e9c7efe96631e8e4d03405d66c..0ab89ec096117fe160ee7caba15416310d9a38d1 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-15.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-15.js @@ -9,12 +9,12 @@ description: > object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return function () { }; - } +function callbackfn(val, idx, obj) { + accessed = true; + return function() {}; +} assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-16.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-16.js index eec81ccd62dd392d088b7c07a0ea9bbd020c683e..f7f6f68734d049993270ab3771c28a16f71b9d93 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-16.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-16.js @@ -9,12 +9,12 @@ description: > object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return []; - } +function callbackfn(val, idx, obj) { + accessed = true; + return []; +} assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-17.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-17.js index bdf6d731419ae64bce5aca6fb82e4c862ec9d8a2..273fb64fd0c7631208f4ff3b19c03006b9fcc3c4 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-17.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-17.js @@ -9,12 +9,12 @@ description: > object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return new String(); - } +function callbackfn(val, idx, obj) { + accessed = true; + return new String(); +} assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-18.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-18.js index 37d3ecc27e24399d832a59eefd0c74c2b1979f8a..7cde6eabfe0679189213708ae480976ac2c1e5e9 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-18.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-18.js @@ -9,12 +9,12 @@ description: > object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return new Boolean(); - } +function callbackfn(val, idx, obj) { + accessed = true; + return new Boolean(); +} assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-19.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-19.js index f9ef17f28836b902198a3922adba9e4d03761a31..7306e5e4530e9b1438e1199b0f4cea5419d6fac6 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-19.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-19.js @@ -9,12 +9,12 @@ description: > object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return new Number(); - } +function callbackfn(val, idx, obj) { + accessed = true; + return new Number(); +} assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-2.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-2.js index 7084a37765577e6c66cd5123015fee72cf7754b2..62e4d058932b114db6ea1d0ff239d166917b8ceb 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-2.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-2.js @@ -7,13 +7,16 @@ es5id: 15.4.4.16-7-c-iii-2 description: Array.prototype.every - return value of callbackfn is null ---*/ - var accessed = false; - var obj = { 0: 11, length: 1 }; +var accessed = false; +var obj = { + 0: 11, + length: 1 +}; - function callbackfn(val, idx, obj) { - accessed = true; - return null; - } +function callbackfn(val, idx, obj) { + accessed = true; + return null; +} diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-20.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-20.js index 7a68faf9f6756493ee1d46ceb2527d204dd53465..2026f6357ac7bfe69ce050b8d7b88053b14d9fc7 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-20.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-20.js @@ -9,12 +9,12 @@ description: > object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return Math; - } +function callbackfn(val, idx, obj) { + accessed = true; + return Math; +} assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-21.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-21.js index ef6432c3d6fa93bf1f5426b8b211fd8656e77138..3b16afa42c1c2c73d3a3e804148bb01d4bce1a95 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-21.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-21.js @@ -7,12 +7,12 @@ es5id: 15.4.4.16-7-c-iii-21 description: Array.prototype.every - return value of callbackfn is a Date object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return new Date(); - } +function callbackfn(val, idx, obj) { + accessed = true; + return new Date(); +} assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-22.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-22.js index b7b1437a8ed7cf9e128e429c9aaaf2ab2e14e880..3616be1410079ad9e492c8e65fc9f2cdf4616015 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-22.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-22.js @@ -9,12 +9,12 @@ description: > object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return new RegExp(); - } +function callbackfn(val, idx, obj) { + accessed = true; + return new RegExp(); +} assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-23.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-23.js index 80b30b5f64708d6648c464cc2b20dac4bf527d53..87151094b278c61b1d70143742674777ed45970a 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-23.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-23.js @@ -9,12 +9,12 @@ description: > object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return JSON; - } +function callbackfn(val, idx, obj) { + accessed = true; + return JSON; +} assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-24.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-24.js index 3075fcdb68f49c40330628082cfa00575d153097..7141b6a713ff653f96d56d535d2c047475c09fe4 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-24.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-24.js @@ -9,12 +9,12 @@ description: > object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return new EvalError(); - } +function callbackfn(val, idx, obj) { + accessed = true; + return new EvalError(); +} assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-25.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-25.js index fcfc6b35cec9181af906456ba8d2e49a1a4b266c..8efc3f1743656231500963d5c201a93f61b48db4 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-25.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-25.js @@ -9,12 +9,12 @@ description: > Arguments object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return arguments; - } +function callbackfn(val, idx, obj) { + accessed = true; + return arguments; +} assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-27.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-27.js index 5f962f32f2dd1fcda2d015b495d675de53ae98fd..2b650660b5020549bf6ca19a3d8eb3eb9c0cb24b 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-27.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-27.js @@ -10,12 +10,12 @@ description: > ---*/ var global = this; - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return global; - } +function callbackfn(val, idx, obj) { + accessed = true; + return global; +} assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-28.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-28.js index 7c1df38b40afef9ccb898ac7d84c6fdb52563fbc..0475c7ff594382d3ba1466864cc5c4a833b208fe 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-28.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-28.js @@ -7,37 +7,39 @@ es5id: 15.4.4.16-7-c-iii-28 description: Array.prototype.every - false prevents further side effects ---*/ - var result = false; - var obj = { length: 20 }; +var result = false; +var obj = { + length: 20 +}; - function callbackfn(val, idx, obj) { - if (idx > 1) { - result = true; - } - return val > 10; - } +function callbackfn(val, idx, obj) { + if (idx > 1) { + result = true; + } + return val > 10; +} - Object.defineProperty(obj, "0", { - get: function () { - return 11; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + return 11; + }, + configurable: true +}); - Object.defineProperty(obj, "1", { - get: function () { - return 8; - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + return 8; + }, + configurable: true +}); - Object.defineProperty(obj, "2", { - get: function () { - result = true; - return 8; - }, - configurable: true - }); +Object.defineProperty(obj, "2", { + get: function() { + result = true; + return 8; + }, + configurable: true +}); assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)'); assert.sameValue(result, false, 'result'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-29.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-29.js index 796bd2ea584f698f4871b9b8544d49058911e67d..7571d0ec3d5b9aafd190c83286dd370cf1c1bea3 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-29.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-29.js @@ -9,12 +9,12 @@ description: > callbackfn is treated as true value ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return new Boolean(false); - } +function callbackfn(val, idx, obj) { + accessed = true; + return new Boolean(false); +} assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-3.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-3.js index c8583c061abf9374536799746b7bbe0bbe36bb87..bcd7891c7318c521e158475ee316673efaccfe5d 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-3.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-3.js @@ -9,13 +9,16 @@ description: > (value is false) ---*/ - var accessed = false; - var obj = { 0: 11, length: 1 }; +var accessed = false; +var obj = { + 0: 11, + length: 1 +}; - function callbackfn(val, idx, obj) { - accessed = true; - return false; - } +function callbackfn(val, idx, obj) { + accessed = true; + return false; +} assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-4.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-4.js index 31b4185b934d8295af0d6290818966dab574c23f..34469360ca6d30469946eb86bc046caaecd4bf49 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-4.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-4.js @@ -9,13 +9,16 @@ description: > (value is true) ---*/ - var accessed = false; - var obj = { 0: 11, length: 1 }; +var accessed = false; +var obj = { + 0: 11, + length: 1 +}; - function callbackfn(val, idx, obj) { - accessed = true; - return true; - } +function callbackfn(val, idx, obj) { + accessed = true; + return true; +} diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-5.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-5.js index 93790b433d98e08b42c313b54501a64405b93001..b1ce805acce5ce659ad1eb63781f9aa481121832 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-5.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-5.js @@ -9,12 +9,12 @@ description: > (value is 0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return 0; - } +function callbackfn(val, idx, obj) { + accessed = true; + return 0; +} assert.sameValue([11].every(callbackfn), false, '[11].every(callbackfn)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-6.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-6.js index fc0eaa0691857f901def1dd68f297e219b9f3827..5ca00586521f0541d064822579a057da49b34826 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-6.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-6.js @@ -9,12 +9,12 @@ description: > (value is +0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return +0; - } +function callbackfn(val, idx, obj) { + accessed = true; + return +0; +} assert.sameValue([11].every(callbackfn), false, '[11].every(callbackfn)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-7.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-7.js index 4ec5e4a5ee8e953408277c79f45b0181d63b1bba..3b152c86bd7bb3f4be4efdcd98811cc5046dcf38 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-7.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-7.js @@ -9,12 +9,12 @@ description: > (value is -0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return -0; - } +function callbackfn(val, idx, obj) { + accessed = true; + return -0; +} assert.sameValue([11].every(callbackfn), false, '[11].every(callbackfn)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-8.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-8.js index 59a89680e64ddb69868f770aa3f47ccece296325..0c2b63f0016f1a4d754d7904076d3eb57f3be048 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-8.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-8.js @@ -9,12 +9,12 @@ description: > (value is positive number) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return 5; - } +function callbackfn(val, idx, obj) { + accessed = true; + return 5; +} assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-9.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-9.js index 18ff44cc49706a74aa7667d3bdb76d8fce27b7db..1830a7d9af1ffc67a896865bb1d23ec15a81f31f 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-9.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-9.js @@ -9,12 +9,12 @@ description: > (value is negative number) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return -5; - } +function callbackfn(val, idx, obj) { + accessed = true; + return -5; +} assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-8-1.js b/test/built-ins/Array/prototype/every/15.4.4.16-8-1.js index d074dbf346e762413924c6d4b41652b6583e3c8e..e5fb2db836eb62858526534d4b30c11b82a51ea9 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-8-1.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-8-1.js @@ -7,7 +7,7 @@ es5id: 15.4.4.16-8-1 description: Array.prototype.every returns true if 'length' is 0 (empty array) ---*/ - function cb() {} - var i = [].every(cb); +function cb() {} +var i = [].every(cb); assert.sameValue(i, true, 'i'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-8-10.js b/test/built-ins/Array/prototype/every/15.4.4.16-8-10.js index e69633f9116609d1d44e05669bebc695bf69c29a..a865a6c4b8d863377fa1fb8ae273e520c997dfab 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-8-10.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-8-10.js @@ -7,19 +7,20 @@ es5id: 15.4.4.16-8-10 description: Array.prototype.every - subclassed array when length is reduced ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = 2; +foo.prototype = new Array(1, 2, 3); - function cb(val) - { - if(val>2) - return false; - else - return true; - } - var i = f.every(cb); +function foo() {} +var f = new foo(); +f.length = 2; + +function cb(val) +{ + if (val > 2) + return false; + else + return true; +} +var i = f.every(cb); assert.sameValue(i, true, 'i'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-8-11.js b/test/built-ins/Array/prototype/every/15.4.4.16-8-11.js index 9403b2acde6ecd9a07da94128a43794b656e23f4..b407fe4e7a8f5097dbd531ed33631bf18c4c4ba3 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-8-11.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-8-11.js @@ -9,14 +9,15 @@ description: > return true ---*/ - var callCnt = 0; - function callbackfn(val, idx, obj) - { - callCnt++; - return true; - } +var callCnt = 0; - var arr = [0,1,2,3,4,5,6,7,8,9]; +function callbackfn(val, idx, obj) +{ + callCnt++; + return true; +} + +var arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; assert.sameValue(arr.every(callbackfn), true, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-8-12.js b/test/built-ins/Array/prototype/every/15.4.4.16-8-12.js index 844e0bf625239570c2263c1db25a1207a66ce713..7100aecd52d0f3c9219be13271b27bbec3e6e72b 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-8-12.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-8-12.js @@ -9,12 +9,12 @@ description: > called on ---*/ - function callbackfn(val, idx, obj) - { - return true; - } - var arr = [1,2,3,4,5]; - arr.every(callbackfn); +function callbackfn(val, idx, obj) +{ + return true; +} +var arr = [1, 2, 3, 4, 5]; +arr.every(callbackfn); assert.sameValue(arr[0], 1, 'arr[0]'); assert.sameValue(arr[1], 2, 'arr[1]'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-8-13.js b/test/built-ins/Array/prototype/every/15.4.4.16-8-13.js index 3a41b2c3638e6949707ce77deaa38af6d763cea0..66b56af96b46af97d14326efce527457b51025b4 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-8-13.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-8-13.js @@ -7,16 +7,17 @@ es5id: 15.4.4.16-8-13 description: Array.prototype.every doesn't visit expandos ---*/ - var callCnt = 0; - function callbackfn(val, idx, obj) - { - callCnt++; - return true; - } +var callCnt = 0; - var arr = [0,1,2,3,4,5,6,7,8,9]; - arr["i"] = 10; - arr[true] = 11; +function callbackfn(val, idx, obj) +{ + callCnt++; + return true; +} + +var arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; +arr["i"] = 10; +arr[true] = 11; assert.sameValue(arr.every(callbackfn), true, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-8-2.js b/test/built-ins/Array/prototype/every/15.4.4.16-8-2.js index 9d9d694b14444a155d753ae8307aeaad058bf756..90ef805f657521eddccc41bde900e5c17af28029 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-8-2.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-8-2.js @@ -9,13 +9,14 @@ description: > Array, length overridden to null (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = null; +foo.prototype = new Array(1, 2, 3); - function cb(){} - var i = f.every(cb); +function foo() {} +var f = new foo(); +f.length = null; + +function cb() {} +var i = f.every(cb); assert.sameValue(i, true, 'i'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-8-3.js b/test/built-ins/Array/prototype/every/15.4.4.16-8-3.js index 6cf241998a235176d05fc5af1a3fb7ef0bc586a8..746ea3c4d918b87ec09565f6123ac5f6e1c1871b 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-8-3.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-8-3.js @@ -9,13 +9,14 @@ description: > Array, length overridden to false (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = false; +foo.prototype = new Array(1, 2, 3); - function cb(){} - var i = f.every(cb); +function foo() {} +var f = new foo(); +f.length = false; + +function cb() {} +var i = f.every(cb); assert.sameValue(i, true, 'i'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-8-4.js b/test/built-ins/Array/prototype/every/15.4.4.16-8-4.js index f296ed79c6c4a50ed9b66a35f92b888a842fa8e9..802f85d327977e9e5b92dc139762f3d1d5e30a9e 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-8-4.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-8-4.js @@ -9,13 +9,14 @@ description: > Array, length overridden to 0 (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = 0; +foo.prototype = new Array(1, 2, 3); - function cb(){} - var i = f.every(cb); +function foo() {} +var f = new foo(); +f.length = 0; + +function cb() {} +var i = f.every(cb); assert.sameValue(i, true, 'i'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-8-5.js b/test/built-ins/Array/prototype/every/15.4.4.16-8-5.js index 49d510f6b788c05fec258709d1147ca163b6d5e6..cd8513fb499dca4d16d3beb928cf83a287ab7bd5 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-8-5.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-8-5.js @@ -9,13 +9,14 @@ description: > Array, length overridden to '0' (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = '0'; +foo.prototype = new Array(1, 2, 3); - function cb(){} - var i = f.every(cb); +function foo() {} +var f = new foo(); +f.length = '0'; + +function cb() {} +var i = f.every(cb); assert.sameValue(i, true, 'i'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-8-6.js b/test/built-ins/Array/prototype/every/15.4.4.16-8-6.js index de58615e3861a88b58525a4ceddc24b3e4294713..17d0d883415e19011d9372274c2f68d6c3b90b23 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-8-6.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-8-6.js @@ -9,15 +9,20 @@ description: > Array, length overridden with obj with valueOf) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - var o = { valueOf: function () { return 0;}}; - f.length = o; +function foo() {} +var f = new foo(); - function cb(){} - var i = f.every(cb); +var o = { + valueOf: function() { + return 0; + } +}; +f.length = o; + +function cb() {} +var i = f.every(cb); assert.sameValue(i, true, 'i'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-8-7.js b/test/built-ins/Array/prototype/every/15.4.4.16-8-7.js index 170831065fba03f78ec89f8e98a41fc89db63f65..f23dc8cff16b2ce9f9d5423bbca14bfefbb76b50 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-8-7.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-8-7.js @@ -9,20 +9,25 @@ description: > Array, length overridden with obj w/o valueOf (toString)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - var o = { toString: function () { return '0';}}; - f.length = o; +function foo() {} +var f = new foo(); - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - function cb(){} - var i = f.every(cb); +var o = { + toString: function() { + return '0'; + } +}; +f.length = o; + +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +function cb() {} +var i = f.every(cb); assert.sameValue(i, true, 'i'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-8-8.js b/test/built-ins/Array/prototype/every/15.4.4.16-8-8.js index 8d1854e45474b58ec49917aa6e6d0d015d2ed038..75f2878c3d5b96337aa39aa128bbd0263c7b3aa7 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-8-8.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-8-8.js @@ -9,28 +9,29 @@ description: > Array, length overridden with [] ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - - f.length = []; - - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - // - // The toString( ) method on Array converts the array elements to strings, - // then returns the result of concatenating these strings, with commas in - // between. An array with no elements converts to the empty string, which - // converts to the number 0. If an array has a single element that is a - // number n, the array converts to a string representation of n, which is - // then converted back to n itself. If an array contains more than one element, - // or if its one element is not a number, the array converts to NaN. - - function cb(){} - var i = f.every(cb); +foo.prototype = new Array(1, 2, 3); + +function foo() {} +var f = new foo(); + +f.length = []; + +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +// +// The toString( ) method on Array converts the array elements to strings, +// then returns the result of concatenating these strings, with commas in +// between. An array with no elements converts to the empty string, which +// converts to the number 0. If an array has a single element that is a +// number n, the array converts to a string representation of n, which is +// then converted back to n itself. If an array contains more than one element, +// or if its one element is not a number, the array converts to NaN. + +function cb() {} +var i = f.every(cb); assert.sameValue(i, true, 'i'); diff --git a/test/built-ins/Array/prototype/fill/fill-values-custom-start-and-end.js b/test/built-ins/Array/prototype/fill/fill-values-custom-start-and-end.js index d445b9304481c35e51d1626a0961cd13c6d03181..ce34f42d8bf3d6ea10817f6e8a3c859fbd3e7186 100644 --- a/test/built-ins/Array/prototype/fill/fill-values-custom-start-and-end.js +++ b/test/built-ins/Array/prototype/fill/fill-values-custom-start-and-end.js @@ -24,4 +24,4 @@ assert(compareArray([0, 0, 0].fill(8, 1, 2), [0, 8, 0])); assert(compareArray([0, 0, 0, 0, 0].fill(8, -3, 4), [0, 0, 8, 8, 0])); assert(compareArray([0, 0, 0, 0, 0].fill(8, -2, -1), [0, 0, 0, 8, 0])); assert(compareArray([0, 0, 0, 0, 0].fill(8, -1, -3), [0, 0, 0, 0, 0])); -assert(compareArray([ , , , , 0].fill(8, 1, 3), [, 8, 8, , 0])); +assert(compareArray([, , , , 0].fill(8, 1, 3), [, 8, 8, , 0])); diff --git a/test/built-ins/Array/prototype/fill/fill-values.js b/test/built-ins/Array/prototype/fill/fill-values.js index ab2cf19d0f9d5d3583ec4d00a364639184838a9d..43f119f27e9d130f0a81eb155bdc4aed911a878e 100644 --- a/test/built-ins/Array/prototype/fill/fill-values.js +++ b/test/built-ins/Array/prototype/fill/fill-values.js @@ -28,8 +28,7 @@ includes: [compareArray.js] assert(compareArray([].fill(8), [])); assert(compareArray( - [0, 0].fill(), - [undefined, undefined] + [0, 0].fill(), [undefined, undefined] )); assert( 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 c9d811439053fda1d5eb9af2935faacbc12f2317..c9b5616764057e9d5bf811fd581e8da8d3e0f463 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 @@ -9,5 +9,5 @@ description: Array.prototype.filter applied to undefined throws a TypeError assert.throws(TypeError, function() { - Array.prototype.filter.call(undefined); // TypeError is thrown if value is undefined + Array.prototype.filter.call(undefined); // TypeError is thrown if value is undefined }); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-10.js index f56c19437f08b1c5e0efa9f04dbd4ff697812a7a..9fa42cba0a8990c6c03efd65a2f79b3434dc7985 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-10.js @@ -7,12 +7,12 @@ es5id: 15.4.4.20-1-10 description: Array.prototype.filter applied to the Math object ---*/ - function callbackfn(val, idx, obj) { - return '[object Math]' === Object.prototype.toString.call(obj); - } +function callbackfn(val, idx, obj) { + return '[object Math]' === Object.prototype.toString.call(obj); +} - Math.length = 1; - Math[0] = 1; - var newArr = Array.prototype.filter.call(Math, callbackfn); +Math.length = 1; +Math[0] = 1; +var newArr = Array.prototype.filter.call(Math, callbackfn); assert.sameValue(newArr[0], 1, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-11.js index d9e730234c2d914637f6c3970e6b4d62cb27254f..19703f1905f6ee913f25881d604f15e341f055a2 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-11.js @@ -7,14 +7,14 @@ es5id: 15.4.4.20-1-11 description: Array.prototype.filter applied to Date object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Date; - } +function callbackfn(val, idx, obj) { + return obj instanceof Date; +} - var obj = new Date(); - obj.length = 1; - obj[0] = 1; +var obj = new Date(); +obj.length = 1; +obj[0] = 1; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr[0], 1, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-12.js index 9a7404b58e29b3131b530030a95d435dccd0373e..09a5dbb370579cea36c5e00e51ff00626bc16ed3 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-12.js @@ -7,14 +7,14 @@ es5id: 15.4.4.20-1-12 description: Array.prototype.filter applied to RegExp object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof RegExp; - } +function callbackfn(val, idx, obj) { + return obj instanceof RegExp; +} - var obj = new RegExp(); - obj.length = 2; - obj[1] = true; +var obj = new RegExp(); +obj.length = 2; +obj[1] = true; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr[0], true, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-13.js index b5e4405121b2fecf667a9b129f748bc4bf85514b..fbeaacc89ee7fb7e6c24f63d4e126525e4d7b6ef 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-13.js @@ -7,12 +7,12 @@ es5id: 15.4.4.20-1-13 description: Array.prototype.filter applied to the JSON object ---*/ - function callbackfn(val, idx, obj) { - return '[object JSON]' === Object.prototype.toString.call(JSON); - } +function callbackfn(val, idx, obj) { + return '[object JSON]' === Object.prototype.toString.call(JSON); +} - JSON.length = 1; - JSON[0] = 1; - var newArr = Array.prototype.filter.call(JSON, callbackfn); +JSON.length = 1; +JSON[0] = 1; +var newArr = Array.prototype.filter.call(JSON, callbackfn); assert.sameValue(newArr[0], 1, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-14.js index 7e77b5403c970a36274db5dd4763a88a8bd61f00..0b9f3060a5b98d5f9c495899879e8a8fef2886cf 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-14.js @@ -7,14 +7,14 @@ es5id: 15.4.4.20-1-14 description: Array.prototype.filter applied to Error object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Error; - } +function callbackfn(val, idx, obj) { + return obj instanceof Error; +} - var obj = new Error(); - obj.length = 1; - obj[0] = 1; +var obj = new Error(); +obj.length = 1; +obj[0] = 1; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr[0], 1, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-15.js index 314f8cf65db3ee09ef8f57e9eb42580034120291..0be84b256322ad3709cddd3b54470a0db9f753ed 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-15.js @@ -7,15 +7,15 @@ es5id: 15.4.4.20-1-15 description: Array.prototype.filter applied to the Arguments object ---*/ - function callbackfn(val, idx, obj) { - return '[object Arguments]' === Object.prototype.toString.call(obj); - } +function callbackfn(val, idx, obj) { + return '[object Arguments]' === Object.prototype.toString.call(obj); +} - var obj = (function () { - return arguments; - }("a", "b")); +var obj = (function() { + return arguments; +}("a", "b")); - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr[0], "a", 'newArr[0]'); assert.sameValue(newArr[1], "b", 'newArr[1]'); 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 3c4abb006b8793a27c88c4dd2eb6665ae9f3804d..70e775afee20dbfcec69c13181e572b18bb1cf3b 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 @@ -9,5 +9,5 @@ description: Array.prototype.filter applied to null throws a TypeError assert.throws(TypeError, function() { - Array.prototype.filter.call(null); + Array.prototype.filter.call(null); }); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-3.js index c8ed73db1680343e0ba9e0da78bd8e9f91ebe45d..95aaebd9e264db410d4e3cbdef1f97f81f04cbb2 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-3.js @@ -7,13 +7,13 @@ es5id: 15.4.4.20-1-3 description: Array.prototype.filter applied to boolean primitive ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Boolean; - } +function callbackfn(val, idx, obj) { + return obj instanceof Boolean; +} - Boolean.prototype[0] = true; - Boolean.prototype.length = 1; +Boolean.prototype[0] = true; +Boolean.prototype.length = 1; - var newArr = Array.prototype.filter.call(false, callbackfn); +var newArr = Array.prototype.filter.call(false, callbackfn); assert.sameValue(newArr[0], true, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-4.js index 17517c53288766c7809226ca15efe9cda5073e98..e7b7d2fdc291da5e6942c793dd78483f64ae3feb 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-4.js @@ -7,16 +7,16 @@ es5id: 15.4.4.20-1-4 description: Array.prototype.filter applied to Boolean Object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Boolean; - } +function callbackfn(val, idx, obj) { + return obj instanceof Boolean; +} - var obj = new Boolean(true); - obj.length = 2; - obj[0] = 11; - obj[1] = 12; +var obj = new Boolean(true); +obj.length = 2; +obj[0] = 11; +obj[1] = 12; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert.sameValue(newArr[1], 12, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-5.js index 114e360ab1fd53540ac3a1c6251cf7f068582098..4e8c4ffd54028a58e5fe1b5c245888a1c83ab2db 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-5.js @@ -7,13 +7,13 @@ es5id: 15.4.4.20-1-5 description: Array.prototype.filter applied to number primitive ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Number; - } +function callbackfn(val, idx, obj) { + return obj instanceof Number; +} - Number.prototype[0] = 1; - Number.prototype.length = 1; +Number.prototype[0] = 1; +Number.prototype.length = 1; - var newArr = Array.prototype.filter.call(2.5, callbackfn); +var newArr = Array.prototype.filter.call(2.5, callbackfn); assert.sameValue(newArr[0], 1, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-6.js index d73da1d91c2cb77fa98f8bc588273ca8bd63c852..6f4bb4eb26f98cee6b51ad42f1f1cbba06625c26 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-6.js @@ -7,16 +7,16 @@ es5id: 15.4.4.20-1-6 description: Array.prototype.filter applied to Number object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Number; - } +function callbackfn(val, idx, obj) { + return obj instanceof Number; +} - var obj = new Number(-128); - obj.length = 2; - obj[0] = 11; - obj[1] = 12; +var obj = new Number(-128); +obj.length = 2; +obj[0] = 11; +obj[1] = 12; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert.sameValue(newArr[1], 12, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-7.js index 8e85e3a8dd22392971bab865d2d064f52fbd37a8..c7a70ad25affcaacc491ae0a8e1a820d95959a36 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-7.js @@ -7,10 +7,10 @@ es5id: 15.4.4.20-1-7 description: Array.prototype.filter applied to string primitive ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof String; - } +function callbackfn(val, idx, obj) { + return obj instanceof String; +} - var newArr = Array.prototype.filter.call("abc", callbackfn); +var newArr = Array.prototype.filter.call("abc", callbackfn); assert.sameValue(newArr[0], "a", 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-8.js index 84df1f7aa5d00d87e86ac280b5e5331b96dc6190..35438987c0d28f46e3214521ba1805c5737eec3c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-8.js @@ -7,11 +7,11 @@ es5id: 15.4.4.20-1-8 description: Array.prototype.filter applied to String object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof String; - } +function callbackfn(val, idx, obj) { + return obj instanceof String; +} - var obj = new String("abc"); - var newArr = Array.prototype.filter.call(obj, callbackfn); +var obj = new String("abc"); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr[0], "a", 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-9.js index b64de3811896e52b21af81321ba4736f243e227f..01e194a56c5bd73bea2688f493f8049a4c3e150a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-9.js @@ -7,17 +7,17 @@ es5id: 15.4.4.20-1-9 description: Array.prototype.filter applied to Function object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Function; - } +function callbackfn(val, idx, obj) { + return obj instanceof Function; +} - var obj = function (a, b) { - return a + b; - }; - obj[0] = 11; - obj[1] = 9; +var obj = function(a, b) { + return a + b; +}; +obj[0] = 11; +obj[1] = 9; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert.sameValue(newArr[1], 9, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-10-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-10-1.js index d554b685024afb08c45ad324f4da4fbbf652962b..8034699546b010bacb987a87f9c1b99af2c3a6f4 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-10-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-10-1.js @@ -9,12 +9,12 @@ description: > called on ---*/ - function callbackfn(val, idx, obj) - { - return true; - } - var srcArr = [1,2,3,4,5]; - srcArr.filter(callbackfn); +function callbackfn(val, idx, obj) +{ + return true; +} +var srcArr = [1, 2, 3, 4, 5]; +srcArr.filter(callbackfn); assert.sameValue(srcArr[0], 1, 'srcArr[0]'); assert.sameValue(srcArr[1], 2, 'srcArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-10-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-10-2.js index 4ef4c19abb723da60704715e4b65bbf2946fb8ef..5bd456a8e82999b880a8bbf35e5a3d8cf66aa711 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-10-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-10-2.js @@ -9,15 +9,15 @@ description: > number of true returned by callbackfn ---*/ - function callbackfn(val, idx, obj) - { - if(val % 2) - return true; - else - return false; - } - var srcArr = [1,2,3,4,5]; - var resArr = srcArr.filter(callbackfn); +function callbackfn(val, idx, obj) +{ + if (val % 2) + return true; + else + return false; +} +var srcArr = [1, 2, 3, 4, 5]; +var resArr = srcArr.filter(callbackfn); assert.sameValue(resArr.length, 3, 'resArr.length'); assert.sameValue(resArr[0], 1, 'resArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-10-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-10-3.js index 6d278d9623b75c3f1b0ad4c4a10a151eaa88bee1..a20ae4f1867efeadc57b58fdf52e1af83ed07518 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-10-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-10-3.js @@ -7,13 +7,16 @@ es5id: 15.4.4.20-10-3 description: Array.prototype.filter - subclassed array when length is reduced ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = 1; +foo.prototype = new Array(1, 2, 3); - function cb(){return true;} - var a = f.filter(cb); +function foo() {} +var f = new foo(); +f.length = 1; + +function cb() { + return true; +} +var a = f.filter(cb); assert(Array.isArray(a), 'Array.isArray(a) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-10-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-10-4.js index fa6b6603f27e1e91a2ae1c26f7ba619be99134d0..10e8fa02923949b996304dc53b8cbc61d0686f43 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-10-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-10-4.js @@ -7,15 +7,16 @@ es5id: 15.4.4.20-10-4 description: Array.prototype.filter doesn't visit expandos ---*/ - var callCnt = 0; - function callbackfn(val, idx, obj) - { - callCnt++; - } - var srcArr = [1,2,3,4,5]; - srcArr["i"] = 10; - srcArr[true] = 11; +var callCnt = 0; - var resArr = srcArr.filter(callbackfn); +function callbackfn(val, idx, obj) +{ + callCnt++; +} +var srcArr = [1, 2, 3, 4, 5]; +srcArr["i"] = 10; +srcArr[true] = 11; + +var resArr = srcArr.filter(callbackfn); assert.sameValue(callCnt, 5, 'callCnt'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-1.js index ef11a817271e93659fd5d857c4f7adf5e11512a7..68c19c6a667d41afdaf5d9ac9cc7fec89df60151 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-1.js @@ -9,17 +9,17 @@ description: > own data property ---*/ - function callbackfn(val, idx, obj) { - return obj.length === 2; - } +function callbackfn(val, idx, obj) { + return obj.length === 2; +} - var obj = { - 0: 12, - 1: 11, - 2: 9, - length: 2 - }; +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: 2 +}; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-10.js index 7ef49929818703ef7bd4188edcb77992f3caca91..683217637b02ab9839424f46d97992744cf055e7 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-10.js @@ -9,27 +9,27 @@ description: > inherited accessor property ---*/ - function callbackfn(val, idx, obj) { - return obj.length === 2; - } +function callbackfn(val, idx, obj) { + return obj.length === 2; +} - var proto = {}; +var proto = {}; - Object.defineProperty(proto, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(proto, "length", { + get: function() { + return 2; + }, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[0] = 12; - child[1] = 11; - child[2] = 9; +var child = new Con(); +child[0] = 12; +child[1] = 11; +child[2] = 9; - var newArr = Array.prototype.filter.call(child, callbackfn); +var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-11.js index b707e51599ac2b6e8ae2075cdbf4b586e3aeaff4..8a55f62fb777dc1a789139e8672c4cf74c9ac0af 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-11.js @@ -9,22 +9,23 @@ description: > own accessor property without a get function ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return true; - } +var accessed = false; - var obj = { - 0: 11, - 1: 12 - }; - Object.defineProperty(obj, "length", { - set: function () { }, - configurable: true - }); +function callbackfn(val, idx, obj) { + accessed = true; + return true; +} - var newArr = Array.prototype.filter.call(obj, callbackfn); +var obj = { + 0: 11, + 1: 12 +}; +Object.defineProperty(obj, "length", { + set: function() {}, + configurable: true +}); + +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-12.js index 40c49cf05fbcb5af8bafcefed4d878c4ae4d4280..b5983c28057374be7ec192459fd55659c851ca0f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-12.js @@ -9,26 +9,30 @@ description: > a get function that overrides an inherited accessor property ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return true; - } +var accessed = false; - Object.defineProperty(Object.prototype, "length", { - get: function () { - return 2; - }, - configurable: true - }); +function callbackfn(val, idx, obj) { + accessed = true; + return true; +} - var obj = { 0: 12, 1: 11 }; - Object.defineProperty(obj, "length", { - set: function () { }, - configurable: true - }); +Object.defineProperty(Object.prototype, "length", { + get: function() { + return 2; + }, + configurable: true +}); - var newArr = Array.prototype.filter.call(obj, callbackfn); +var obj = { + 0: 12, + 1: 11 +}; +Object.defineProperty(obj, "length", { + set: function() {}, + configurable: true +}); + +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-13.js index b35a71c92bc88d7977e0253630ba5d97502225d2..25652960d206806efd5e3da7c74306bea471b40c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-13.js @@ -9,26 +9,27 @@ description: > 'length' is inherited accessor property without a get function ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return true; - } - - var proto = {}; - Object.defineProperty(proto, "length", { - set: function () { }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child[0] = 11; - child[1] = 12; - - var newArr = Array.prototype.filter.call(child, callbackfn); +var accessed = false; + +function callbackfn(val, idx, obj) { + accessed = true; + return true; +} + +var proto = {}; +Object.defineProperty(proto, "length", { + set: function() {}, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child[0] = 11; +child[1] = 12; + +var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-14.js index 64b7059d8b12f444bef18bbb0b13fd248459d3f3..545d914e60db3d5e16ed8a7f8bf80f36c338753f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-14.js @@ -9,15 +9,19 @@ description: > 'length property doesn't exist ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return true; - } +var accessed = false; - var obj = { 0: 11, 1: 12 }; +function callbackfn(val, idx, obj) { + accessed = true; + return true; +} - var newArr = Array.prototype.filter.call(obj, callbackfn); +var obj = { + 0: 11, + 1: 12 +}; + +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-17.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-17.js index e2ff3af6443ccba4f4a8ce3fbc6fb49f7cc14860..34c579c77dbf95a3ec1422fa194a55dc70e6fd24 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-17.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-17.js @@ -9,13 +9,13 @@ description: > implements its own property get method ---*/ - function callbackfn(val, idx, obj) { - return obj.length === 2; - } +function callbackfn(val, idx, obj) { + return obj.length === 2; +} - var func = function (a, b) { - var newArr = Array.prototype.filter.call(arguments, callbackfn); - return newArr.length === 2; - }; +var func = function(a, b) { + var newArr = Array.prototype.filter.call(arguments, callbackfn); + return newArr.length === 2; +}; assert(func(12, 11), 'func(12, 11) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-18.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-18.js index 6850f6d2193b947eed860c9d559b11d08e398275..c13206d983ecd2ea01463fa10192025093af05a6 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-18.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-18.js @@ -9,12 +9,12 @@ description: > its own property get method ---*/ - function callbackfn(val, idx, obj) { - return obj.length === 3; - } +function callbackfn(val, idx, obj) { + return obj.length === 3; +} - var str = new String("012"); +var str = new String("012"); - var newArr = Array.prototype.filter.call(str, callbackfn); +var newArr = Array.prototype.filter.call(str, callbackfn); assert.sameValue(newArr.length, 3, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-19.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-19.js index 5f12746ae70a3f262352f3f7e39d4412468b872a..9bd2ef1c68b55fcabe417aab44b8df21d4bcf730 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-19.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-19.js @@ -9,17 +9,17 @@ description: > implements its own property get method ---*/ - function callbackfn(val, idx, obj) { - return obj.length === 2; - } +function callbackfn(val, idx, obj) { + return obj.length === 2; +} - var fun = function (a, b) { - return a + b; - }; - fun[0] = 12; - fun[1] = 11; - fun[2] = 9; +var fun = function(a, b) { + return a + b; +}; +fun[0] = 12; +fun[1] = 11; +fun[2] = 9; - var newArr = Array.prototype.filter.call(fun, callbackfn); +var newArr = Array.prototype.filter.call(fun, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-2.js index f8f1b84d410fb4e170ed1094f63276b3ffca2dcf..8e071501ca0beaff1a463b34e4f3669554c7dc21 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-2.js @@ -7,10 +7,10 @@ es5id: 15.4.4.20-2-2 description: Array.prototype.filter - 'length' is own data property on an Array ---*/ - function callbackfn(val, idx, obj) { - return obj.length === 2; - } +function callbackfn(val, idx, obj) { + return obj.length === 2; +} - var newArr = [12, 11].filter(callbackfn); +var newArr = [12, 11].filter(callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-3.js index 5e74fafc6069bd329eed1b3eecb90bf3ec7d7e55..4d9c4e414971b2ff8904d3c273a592a55859a523 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-3.js @@ -9,21 +9,23 @@ description: > an own data property that overrides an inherited data property ---*/ - function callbackfn(val, idx, obj) { - return obj.length === 2; - } +function callbackfn(val, idx, obj) { + return obj.length === 2; +} - var proto = { length: 3 }; +var proto = { + length: 3 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 2; - child[0] = 12; - child[1] = 11; - child[2] = 9; +var child = new Con(); +child.length = 2; +child[0] = 12; +child[1] = 11; +child[2] = 9; - var newArr = Array.prototype.filter.call(child, callbackfn); +var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-4.js index 563ef3bfc524a3192cac78ca672b79ac700ed07e..73ecc9ed1920b059256444d68927027792fa447a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-4.js @@ -9,14 +9,14 @@ description: > overrides an inherited data property on an Array ---*/ - var arrProtoLen; +var arrProtoLen; - function callbackfn(val, idx, obj) { - return obj.length === 2; - } +function callbackfn(val, idx, obj) { + return obj.length === 2; +} - arrProtoLen = Array.prototype.length; - Array.prototype.length = 0; - var newArr = [12, 11].filter(callbackfn); +arrProtoLen = Array.prototype.length; +Array.prototype.length = 0; +var newArr = [12, 11].filter(callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-5.js index ca4c2d21ece03b9f6847854cb101918d54ba4307..e165dbc06d1ad6ac08c1651a75edcc04be985e73 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-5.js @@ -9,31 +9,31 @@ description: > data property that overrides an inherited accessor property ---*/ - function callbackfn(val, idx, obj) { - return obj.length === 2; - } - - var proto = {}; - - Object.defineProperty(proto, "length", { - get: function () { - return 3; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - Object.defineProperty(child, "length", { - value: 2, - configurable: true - }); - child[0] = 12; - child[1] = 11; - child[2] = 9; - - var newArr = Array.prototype.filter.call(child, callbackfn); +function callbackfn(val, idx, obj) { + return obj.length === 2; +} + +var proto = {}; + +Object.defineProperty(proto, "length", { + get: function() { + return 3; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +Object.defineProperty(child, "length", { + value: 2, + configurable: true +}); +child[0] = 12; +child[1] = 11; +child[2] = 9; + +var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-6.js index 6c754b15bb6d20748871359f929161c7df0896d4..9a8144cfcff60b9296c6be451ca80c00e0fd6fd4 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-6.js @@ -9,20 +9,22 @@ description: > an inherited data property ---*/ - function callbackfn(val, idx, obj) { - return obj.length === 2; - } +function callbackfn(val, idx, obj) { + return obj.length === 2; +} - var proto = { length: 2 }; +var proto = { + length: 2 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[0] = 12; - child[1] = 11; - child[2] = 9; +var child = new Con(); +child[0] = 12; +child[1] = 11; +child[2] = 9; - var newArr = Array.prototype.filter.call(child, callbackfn); +var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-7.js index 103cdc8889e7656de295ea3faf1a90f3f84c57ec..ba40ddd23a82eb3ddb00dba128c9a0f455eae7b9 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-7.js @@ -9,23 +9,23 @@ description: > an own accessor property ---*/ - function callbackfn(val, idx, obj) { - return obj.length === 2; - } +function callbackfn(val, idx, obj) { + return obj.length === 2; +} - var obj = {}; +var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return 2; + }, + configurable: true +}); - obj[0] = 12; - obj[1] = 11; - obj[2] = 9; +obj[0] = 12; +obj[1] = 11; +obj[2] = 9; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-8.js index 25b022b3a8bc42578eeda85640d08a7b7baee6d6..e57b21228775f62d08067dfa36fe20bf71fa516d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-8.js @@ -9,28 +9,30 @@ description: > own accessor property that overrides an inherited data property ---*/ - function callbackfn(val, idx, obj) { - return obj.length === 2; - } +function callbackfn(val, idx, obj) { + return obj.length === 2; +} - var proto = { length: 3 }; +var proto = { + length: 3 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); +var child = new Con(); - Object.defineProperty(child, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(child, "length", { + get: function() { + return 2; + }, + configurable: true +}); - child[0] = 12; - child[1] = 11; - child[2] = 9; +child[0] = 12; +child[1] = 11; +child[2] = 9; - var newArr = Array.prototype.filter.call(child, callbackfn); +var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-9.js index 4c37454ba823d96e2b3298175d8e4268ca5aed6d..684b01b09a4152dfa7910ad5e397f0a7966f2267 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-9.js @@ -10,35 +10,35 @@ description: > property ---*/ - function callbackfn(val, idx, obj) { - return obj.length === 2; - } +function callbackfn(val, idx, obj) { + return obj.length === 2; +} - var proto = {}; +var proto = {}; - Object.defineProperty(proto, "length", { - get: function () { - return 3; - }, - configurable: true - }); +Object.defineProperty(proto, "length", { + get: function() { + return 3; + }, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); +var child = new Con(); - Object.defineProperty(child, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(child, "length", { + get: function() { + return 2; + }, + configurable: true +}); - child[0] = 12; - child[1] = 11; - child[2] = 9; +child[0] = 12; +child[1] = 11; +child[2] = 9; - var newArr = Array.prototype.filter.call(child, callbackfn); +var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-1.js index 17cdc5f737edf406efbd32b5a5e2ae7667be33b3..be48ea578fa546c08751e7a6a60e918aac58d588 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-1.js @@ -7,14 +7,19 @@ es5id: 15.4.4.20-3-1 description: Array.prototype.filter - value of 'length' is undefined ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return true; - } +var accessed = false; - var obj = { 0: 0, 1: 1, length: undefined }; - var newArr = Array.prototype.filter.call(obj, callbackfn); +function callbackfn(val, idx, obj) { + accessed = true; + return true; +} + +var obj = { + 0: 0, + 1: 1, + length: undefined +}; +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-10.js index 63b2c4a189cc78762f7040dba88d0a0ee2e51e9c..8ef7f0477bddd72ed65448d3514634f15ab12ceb 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-10.js @@ -9,15 +9,19 @@ description: > NaN) ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return true; - } +var accessed = false; - var obj = { 0: 9, length: NaN }; +function callbackfn(val, idx, obj) { + accessed = true; + return true; +} - var newArr = Array.prototype.filter.call(obj, callbackfn); +var obj = { + 0: 9, + length: NaN +}; + +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-11.js index e495a64dbaa0fd8615bce99a65c3a8f9038bf21d..3bedc20edb471727577be4b49116d8ab56a53c73 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-11.js @@ -9,13 +9,17 @@ description: > positive number ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { 1: 11, 2: 9, length: "2" }; +var obj = { + 1: 11, + 2: 9, + length: "2" +}; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-12.js index c66292a88b61fe25d4a34b5bd5c947931e1bbd54..bab103450a9ff70f35bcb2e72e9cbc6482df9f64 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-12.js @@ -9,13 +9,17 @@ description: > negative number ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { 1: 11, 2: 9, length: "-4294967294" }; +var obj = { + 1: 11, + 2: 9, + length: "-4294967294" +}; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-13.js index 859ef4667e0a812b3ded1538807172fc29e955f4..01d01c2561276d5264a747b3c2ade3613dbfaf74 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-13.js @@ -9,13 +9,17 @@ description: > number ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { 1: 11, 2: 9, length: "2.5" }; +var obj = { + 1: 11, + 2: 9, + length: "2.5" +}; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-14.js index 03193102fe2477d2b6c0af8bb855b24ed55a566d..03bcf8a29d9d3e707394069be0bec72d11d82143 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-14.js @@ -7,16 +7,19 @@ es5id: 15.4.4.20-3-14 description: Array.prototype.filter - 'length' is a string containing -Infinity ---*/ - var accessed2 = false; +var accessed2 = false; - function callbackfn2(val, idx, obj) { - accessed2 = true; - return true; - } +function callbackfn2(val, idx, obj) { + accessed2 = true; + return true; +} - var obj2 = { 0: 9, length: "-Infinity" }; +var obj2 = { + 0: 9, + length: "-Infinity" +}; - var newArr2 = Array.prototype.filter.call(obj2, callbackfn2); +var newArr2 = Array.prototype.filter.call(obj2, callbackfn2); assert.sameValue(accessed2, false, 'accessed2'); assert.sameValue(newArr2.length, 0, 'newArr2.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-15.js index e5be122e800287c2a7b433daf8a7f97de38ed042..7cc2cb5f858ae6984ad2704e654e629abd83ace2 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-15.js @@ -9,13 +9,17 @@ description: > exponential number ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { 1: 11, 2: 9, length: "2E0" }; +var obj = { + 1: 11, + 2: 9, + length: "2E0" +}; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-16.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-16.js index 286093b8b9563dd9cc6166a5de38055f6c985055..1e447f105a021678a8fe9dfb28f11dc3aed231b4 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-16.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-16.js @@ -9,13 +9,17 @@ description: > number ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { 1: 11, 2: 9, length: "0x0002" }; +var obj = { + 1: 11, + 2: 9, + length: "0x0002" +}; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-17.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-17.js index 84b64d40211961f4df9bb62025d1a7ffa37e88d2..a3c2bf7fad6e245faeea1d8b0b74d437c53fb850 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-17.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-17.js @@ -9,13 +9,17 @@ description: > with leading zeros ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { 1: 11, 2: 9, length: "0002.00" }; +var obj = { + 1: 11, + 2: 9, + length: "0002.00" +}; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-18.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-18.js index de3c43f5738cc3c471fe451b7a29c480c6cf0095..b42c4c5af0818d23fbc5c2abe56aab9a1c8d602b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-18.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-18.js @@ -9,15 +9,19 @@ description: > convert to a number ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return true; - } +var accessed = false; - var obj = { 0: 9, length: "asdf!_" }; +function callbackfn(val, idx, obj) { + accessed = true; + return true; +} - var newArr = Array.prototype.filter.call(obj, callbackfn); +var obj = { + 0: 9, + length: "asdf!_" +}; + +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(accessed, false, 'accessed'); assert.sameValue(newArr.length, 0, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-19.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-19.js index f1ac554ecaa9c0bcf86c04c45ba5fc20208ca027..11ba06792815c307ce53c23f0d901122ab4a5922 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-19.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-19.js @@ -9,21 +9,21 @@ description: > an own toString method. ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { - 1: 11, - 2: 9, - length: { - toString: function () { - return '2'; - } - } - }; +var obj = { + 1: 11, + 2: 9, + length: { + toString: function() { + return '2'; + } + } +}; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-2.js index 3e348991d7e3423382f4d1d3f05ff50ff59acdb6..4c87b6e3d1a15d95793e2f1c0b1e0166086657e3 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-2.js @@ -9,12 +9,16 @@ description: > is 1 (length overridden to true(type conversion)) ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { 0: 11, 1: 9, length: true }; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var obj = { + 0: 11, + 1: 9, + length: true +}; +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-20.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-20.js index c8e77de720bc6642784e4543dbe02e3ba94b7561..7b7b93e5b91a384488362a7e25030a667f6a35c7 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-20.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-20.js @@ -9,21 +9,21 @@ description: > an own valueOf method. ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { - 1: 11, - 2: 9, - length: { - valueOf: function () { - return 2; - } - } - }; +var obj = { + 1: 11, + 2: 9, + length: { + valueOf: function() { + return 2; + } + } +}; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-21.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-21.js index 01fc372d5eabf99ca051f1be47a72d8ef208a9cb..c65ba9ca50d3a4f8a039328c109983c9b6ba0e03 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-21.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-21.js @@ -10,29 +10,29 @@ description: > returns a string ---*/ - var firstStepOccured = false; - var secondStepOccured = false; +var firstStepOccured = false; +var secondStepOccured = false; - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { - 1: 11, - 2: 9, - length: { - valueOf: function () { - firstStepOccured = true; - return {}; - }, - toString: function () { - secondStepOccured = true; - return '2'; - } - } - }; +var obj = { + 1: 11, + 2: 9, + length: { + valueOf: function() { + firstStepOccured = true; + return {}; + }, + toString: function() { + secondStepOccured = true; + return '2'; + } + } +}; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-22.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-22.js index a6463ad6a151e97c0d4b79aadaec1250b3d826e1..0e4bf36715d2f0a488aeedcb217b9ad66b222ac4 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 @@ -10,32 +10,32 @@ description: > primitive values ---*/ - var accessed = false; - var firstStepOccured = false; - var secondStepOccured = false; +var accessed = false; +var firstStepOccured = false; +var secondStepOccured = false; - function callbackfn(val, idx, obj) { - accessed = true; - return true; - } +function callbackfn(val, idx, obj) { + accessed = true; + return true; +} - var obj = { - 1: 11, - 2: 12, +var obj = { + 1: 11, + 2: 12, - length: { - valueOf: function () { - firstStepOccured = true; - return {}; - }, - toString: function () { - secondStepOccured = true; - return {}; - } - } - }; + length: { + valueOf: function() { + firstStepOccured = true; + return {}; + }, + toString: function() { + secondStepOccured = true; + return {}; + } + } +}; assert.throws(TypeError, function() { - Array.prototype.filter.call(obj, callbackfn); + Array.prototype.filter.call(obj, callbackfn); }); assert.sameValue(accessed, false, 'accessed'); assert(firstStepOccured, 'firstStepOccured !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-23.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-23.js index f2e7b2e458e6c776c03f6ffffe7d69069e7f2b08..c02b3f301c54bbe3aa5978334387d46c9c2fe69d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-23.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-23.js @@ -9,37 +9,37 @@ description: > is an object with an own toString and inherited valueOf methods ---*/ - var valueOfAccessed = false; - var toStringAccessed = false; +var valueOfAccessed = false; +var toStringAccessed = false; - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var proto = { - valueOf: function () { - valueOfAccessed = true; - return 2; - } - }; +var proto = { + valueOf: function() { + valueOfAccessed = true; + return 2; + } +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); +var child = new Con(); - child.toString = function () { - toStringAccessed = true; - return '1'; - }; +child.toString = function() { + toStringAccessed = true; + return '1'; +}; - var obj = { - 1: 11, - 2: 9, - length: child - }; +var obj = { + 1: 11, + 2: 9, + length: child +}; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-24.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-24.js index 31b87b47d5f05c722547c902b6bc87d6aba27efb..a2cc49a04f86acf1b58eef7e4de3c5c6b00774d6 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-24.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-24.js @@ -9,17 +9,17 @@ description: > non-integer, ensure truncation occurs in the proper direction ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { - 1: 11, - 2: 9, - length: 2.685 - }; +var obj = { + 1: 11, + 2: 9, + length: 2.685 +}; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-25.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-25.js index 3f8b1ffd8cd5dff3991da144408cefa9bd91d418..f32cac6948f4e1a8c3fd18436b9f2a20936b6bcd 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-25.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-25.js @@ -9,17 +9,17 @@ description: > non-integer ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { - 1: 11, - 2: 9, - length: -4294967294.5 - }; +var obj = { + 1: 11, + 2: 9, + length: -4294967294.5 +}; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-3.js index 9b1250407d67e0e923c258e7b753338ff353a5e0..53fd3ab2ccc3503c685cbf475b9c6982cd2a868c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-3.js @@ -7,14 +7,18 @@ es5id: 15.4.4.20-3-3 description: Array.prototype.filter - value of 'length' is a number (value is 0) ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return true; - } +var accessed = false; - var obj = { 0: 11, length: 0 }; - var newArr = Array.prototype.filter.call(obj, callbackfn); +function callbackfn(val, idx, obj) { + accessed = true; + return true; +} + +var obj = { + 0: 11, + length: 0 +}; +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-4.js index a2a73f274b2fe878a3665821b9014c867ac3f7a0..d0afc2288cdbd371cb0ccc65795798061a728be2 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-4.js @@ -9,14 +9,18 @@ description: > +0) ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return true; - } +var accessed = false; - var obj = { 0: 11, length: +0 }; - var newArr = Array.prototype.filter.call(obj, callbackfn); +function callbackfn(val, idx, obj) { + accessed = true; + return true; +} + +var obj = { + 0: 11, + length: +0 +}; +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-5.js index 2fa9d19cf3c28c1d59e8e9d5e29594a3f6207a96..675a41cb281d8f7a30446d5a92755f06a15a68c5 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-5.js @@ -9,14 +9,18 @@ description: > -0) ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return true; - } +var accessed = false; - var obj = { 0: 11, length: -0 }; - var newArr = Array.prototype.filter.call(obj, callbackfn); +function callbackfn(val, idx, obj) { + accessed = true; + return true; +} + +var obj = { + 0: 11, + length: -0 +}; +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-6.js index dd9b8839ba08be56b1d8ffc8f2594bac8d21b460..44e5a2aa1ce989fa6716335924b0638258437ec5 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-6.js @@ -9,13 +9,17 @@ description: > positive) ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { 1: 11, 2: 9, length: 2 }; +var obj = { + 1: 11, + 2: 9, + length: 2 +}; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-7.js index 28d5405920764abb5fd13b6a5e96003090af31a8..b9003218fc86598dceb6cd6bf928f4fc81a1364c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-7.js @@ -9,12 +9,16 @@ description: > negative) ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { 1: 11, 2: 9, length: -4294967294 }; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var obj = { + 1: 11, + 2: 9, + length: -4294967294 +}; +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-9.js index a31259a2ef0eb8146c29aa9ddc58ecb25846325b..149c2011add0958ccebdb176e8c418428c30244e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-9.js @@ -9,15 +9,19 @@ description: > -Infinity) ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return true; - } +var accessed = false; - var obj = { 0: 9, length: -Infinity }; +function callbackfn(val, idx, obj) { + accessed = true; + return true; +} - var newArr = Array.prototype.filter.call(obj, callbackfn); +var obj = { + 0: 9, + length: -Infinity +}; + +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-1.js index 5db65663d82da680223b599ca0f3265c028a6f41..ac03e0fc9219cc03788afd2513fc354d7700b099 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.20-4-1 description: Array.prototype.filter throws TypeError if callbackfn is undefined ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.filter(); + arr.filter(); }); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-10.js index 39f1abd7ba3fad93aea3230e11b206313b3cc6c6..bf2dabe141651172bad23ba111984c3dde4152e5 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-10.js @@ -9,15 +9,18 @@ description: > was thrown by step 2 ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - Object.defineProperty(obj, "length", { - get: function () { - throw new Test262Error(); - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + throw new Test262Error(); + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.filter.call(obj, undefined); + Array.prototype.filter.call(obj, undefined); }); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-11.js index 0eabd02ec56d435cffca73fa8fa30554f9cdf33c..6cefc8ce1e080a9efe12af5a57ca4507a17c236e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-11.js @@ -9,19 +9,22 @@ description: > was thrown by step 3 ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - throw new Test262Error(); - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + throw new Test262Error(); + } + }; + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.filter.call(obj, undefined); + Array.prototype.filter.call(obj, undefined); }); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-12.js index de1ad7023bf75f5aca7f0beae76941a2488a7056..dce334c24412a74095e93a1f1be591b9017fc4f1 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-12.js @@ -7,14 +7,14 @@ es5id: 15.4.4.20-4-12 description: Array.prototype.filter - 'callbackfn' is a function ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1) { - return val === 9; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + return val === 9; + } + return false; +} - var newArr = [11, 9].filter(callbackfn); +var newArr = [11, 9].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 9, 'newArr[0]'); 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 af35f5776a2ee8c5db3589cda7d66a2efe594472..70d48daa72a336e73c14c3d10d4172b7a21ba5e4 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 @@ -9,25 +9,27 @@ description: > passing undefined for callbackfn ---*/ - var obj = { 10: 10 }; - var lengthAccessed = false; - var loopAccessed = false; - Object.defineProperty(obj, "length", { - get: function () { - lengthAccessed = true; - return 20; - }, - configurable: true - }); - Object.defineProperty(obj, "0", { - get: function () { - loopAccessed = true; - return 10; - }, - configurable: true - }); +var obj = { + 10: 10 +}; +var lengthAccessed = false; +var loopAccessed = false; +Object.defineProperty(obj, "length", { + get: function() { + lengthAccessed = true; + return 20; + }, + configurable: true +}); +Object.defineProperty(obj, "0", { + get: function() { + loopAccessed = true; + return 10; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.filter.call(obj); + Array.prototype.filter.call(obj); }); 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 07add5f00eaaedf0f5d9a026427344b31c4260a2..511003bbf69c3b78c8fcbc6f526904a23ed475a0 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 @@ -9,7 +9,7 @@ description: > unreferenced ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(ReferenceError, function() { - arr.filter(foo); + 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 a56dd4e8da22e53a3b6f041c9182d4905d657408..0e557696d4ebced6c52fd543738578660e7c82ed 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.20-4-3 description: Array.prototype.filter throws TypeError if callbackfn is null ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.filter(null); + 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 6e93708357bb5733db8fb58c5f457b39bc37ad78..d49c8355ced748972abff025d319b4b0070c7221 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.20-4-4 description: Array.prototype.filter throws TypeError if callbackfn is boolean ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.filter(true); + 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 6fedc6587479952bf40d7bfa08a348739d7afd8a..d5a3b5289d00b2113af83e878a1d85b371f8ed72 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.20-4-5 description: Array.prototype.filter throws TypeError if callbackfn is number ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.filter(5); + 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 cef7251b101c3106a913a51343fde92f56fd34ec..5f9d1386bb85bdcd1ba18b97d0d35b5cf61e0a2c 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.20-4-6 description: Array.prototype.filter throws TypeError if callbackfn is string ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.filter("abc"); + 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 aa1240371fb8d20314ea408655c30179e5f8b528..f9e4254274c61b8675606168a3ed4710aa9355ef 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 @@ -9,7 +9,7 @@ description: > without [[Call]] internal method ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.filter(new Object()); + 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 fbd5396d8e03a86c62404319bedf2fa813f0db4f..cde11fbf235d32114b22377cd4a81368e3c94606 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 @@ -9,18 +9,21 @@ description: > visible when an exception occurs ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - accessed = true; - return 2; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + accessed = true; + return 2; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.filter.call(obj, null); + Array.prototype.filter.call(obj, null); }); 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 c2e7295776b950579493b645d9d4ee8c259421e0..45ba29f89fbacfca02e021fe0c2d63e1231a78cb 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 @@ -9,22 +9,25 @@ description: > visible when an exception occurs ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - accessed = true; - return "2"; - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + accessed = true; + return "2"; + } + }; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.filter.call(obj, null); + Array.prototype.filter.call(obj, null); }); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-1-s.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-1-s.js index ce1ad3c7eba0e0d5e6b28beeb504619e431b5ab2..ebbd6c1a483567b582a7cc5d85ed749ffe421822 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-1-s.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-1-s.js @@ -8,14 +8,14 @@ description: Array.prototype.filter - thisArg not passed to strict callbackfn flags: [noStrict] ---*/ - var innerThisCorrect = false; +var innerThisCorrect = false; - function callbackfn(val, idx, obj) { - "use strict"; - innerThisCorrect = this===undefined; - return true; - } +function callbackfn(val, idx, obj) { + "use strict"; + innerThisCorrect = this === undefined; + return true; +} - [1].filter(callbackfn); +[1].filter(callbackfn); assert(innerThisCorrect, 'innerThisCorrect !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-1.js index 96063ef486aab08e3eb23fe40ff086c476f1b9f2..fe1b290574966cb3ee3030f3dc7a59027c014f49 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-1.js @@ -9,14 +9,14 @@ flags: [noStrict] ---*/ (function() { - this._15_4_4_20_5_1 = false; - var _15_4_4_20_5_1 = true; + this._15_4_4_20_5_1 = false; + var _15_4_4_20_5_1 = true; - function callbackfn(val, idx, obj) { - return this._15_4_4_20_5_1; - } - var srcArr = [1]; - var resArr = srcArr.filter(callbackfn); + function callbackfn(val, idx, obj) { + return this._15_4_4_20_5_1; + } + var srcArr = [1]; + var resArr = srcArr.filter(callbackfn); -assert.sameValue(resArr.length, 0, 'resArr.length'); + assert.sameValue(resArr.length, 0, 'resArr.length'); })(); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-10.js index dff16966b8e84cf14e7a26da4d77f371fccb6314..a5afd46822f78451c3949ea93ecd33344bac162b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-10.js @@ -7,16 +7,16 @@ es5id: 15.4.4.20-5-10 description: Array.prototype.filter - Array Object can be used as thisArg ---*/ - var accessed = false; - var objArray = new Array(10); +var accessed = false; +var objArray = new Array(10); - function callbackfn(val, idx, obj) { - accessed = true; - return this === objArray; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === objArray; +} - var newArr = [11].filter(callbackfn, objArray); +var newArr = [11].filter(callbackfn, objArray); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-11.js index 93cc528d0e465bc888e73bcea339e89576581c23..0ca6f9f66c7dbaf525a78fed67f99cc42bbf336f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-11.js @@ -7,15 +7,15 @@ es5id: 15.4.4.20-5-11 description: Array.prototype.filter - String Object can be used as thisArg ---*/ - var accessed = false; - var objString = new String(); +var accessed = false; +var objString = new String(); - function callbackfn(val, idx, obj) { - accessed = true; - return this === objString; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === objString; +} - var newArr = [11].filter(callbackfn, objString); +var newArr = [11].filter(callbackfn, objString); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-12.js index d4dc45bda5303ad5297be9c7ded3e4063948da14..2d7cef46de49c6052f4ff9ffc120d765b4f3a784 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-12.js @@ -7,15 +7,15 @@ es5id: 15.4.4.20-5-12 description: Array.prototype.filter - Boolean Object can be used as thisArg ---*/ - var accessed = false; - var objBoolean = new Boolean(); +var accessed = false; +var objBoolean = new Boolean(); - function callbackfn(val, idx, obj) { - accessed = true; - return this === objBoolean; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === objBoolean; +} - var newArr = [11].filter(callbackfn, objBoolean); +var newArr = [11].filter(callbackfn, objBoolean); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-13.js index 621f2def0d30e304c251cfd2056795bba1878938..d5cb60c89c5170dad0e6dfef08fdace27399316e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-13.js @@ -7,15 +7,15 @@ es5id: 15.4.4.20-5-13 description: Array.prototype.filter - Number Object can be used as thisArg ---*/ - var accessed = false; - var objNumber = new Number(); +var accessed = false; +var objNumber = new Number(); - function callbackfn(val, idx, obj) { - accessed = true; - return this === objNumber; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === objNumber; +} - var newArr = [11].filter(callbackfn, objNumber); +var newArr = [11].filter(callbackfn, objNumber); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-14.js index 195f95d295af9d01a6dd43729dbee28f1b6c7fdc..e455d8d4c25bb852f53e7d618e37217a550c228d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-14.js @@ -7,14 +7,14 @@ es5id: 15.4.4.20-5-14 description: Array.prototype.filter - the Math object can be used as thisArg ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return this === Math; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === Math; +} - var newArr = [11].filter(callbackfn, Math); +var newArr = [11].filter(callbackfn, Math); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-15.js index 61cb77e5099b7e9f5e654b39060d5b7de4140ddd..596addb58df5d93c857372096cd0b7710601648f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-15.js @@ -7,16 +7,16 @@ es5id: 15.4.4.20-5-15 description: Array.prototype.filter - Date Object can be used as thisArg ---*/ - var accessed = false; +var accessed = false; - var objDate = new Date(); +var objDate = new Date(); - function callbackfn(val, idx, obj) { - accessed = true; - return this === objDate; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === objDate; +} - var newArr = [11].filter(callbackfn, objDate); +var newArr = [11].filter(callbackfn, objDate); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-16.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-16.js index d7b6b9e2369a60a006e4e7217f6e1ac9607a0481..beafca6fd1a1895b98b0dda5c2c4016dcff428bc 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-16.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-16.js @@ -7,16 +7,16 @@ es5id: 15.4.4.20-5-16 description: Array.prototype.filter - RegExp Object can be used as thisArg ---*/ - var accessed = false; +var accessed = false; - var objRegExp = new RegExp(); +var objRegExp = new RegExp(); - function callbackfn(val, idx, obj) { - accessed = true; - return this === objRegExp; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === objRegExp; +} - var newArr = [11].filter(callbackfn, objRegExp); +var newArr = [11].filter(callbackfn, objRegExp); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-17.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-17.js index b326d202c792e5fa827121b29ee086ce5b18d2fb..569a7d691cff86c556e72c565b38b6a72886b3ed 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-17.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-17.js @@ -7,14 +7,14 @@ es5id: 15.4.4.20-5-17 description: Array.prototype.filter - the JSON object can be used as thisArg ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return this === JSON; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === JSON; +} - var newArr = [11].filter(callbackfn, JSON); +var newArr = [11].filter(callbackfn, JSON); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-18.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-18.js index 98b45563142db6d7200f873706932fe91a5a8c84..03516a9356b71a99746c2e8f96f6fd703da18edf 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-18.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-18.js @@ -7,15 +7,15 @@ es5id: 15.4.4.20-5-18 description: Array.prototype.filter - Error Object can be used as thisArg ---*/ - var accessed = false; - var objError = new RangeError(); +var accessed = false; +var objError = new RangeError(); - function callbackfn(val, idx, obj) { - accessed = true; - return this === objError; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === objError; +} - var newArr = [11].filter(callbackfn, objError); +var newArr = [11].filter(callbackfn, objError); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-19.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-19.js index 0c69ec0372ca2905f8b6a7d21bc867d72fc0d3f7..16869222c02bf0f907633dc17e29e48b718a26fc 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-19.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-19.js @@ -9,19 +9,19 @@ description: > thisArg ---*/ - var accessed = false; - var arg; +var accessed = false; +var arg; - function callbackfn(val, idx, obj) { - accessed = true; - return this === arg; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === arg; +} - (function fun() { - arg = arguments; - }(1, 2, 3)); +(function fun() { + arg = arguments; +}(1, 2, 3)); - var newArr = [11].filter(callbackfn, arg); +var newArr = [11].filter(callbackfn, arg); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-2.js index 0ef3ca82e87799801813dc411fff8805a741c313..01a3a94d6c985855094b61a0dc74efc417519f33 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-2.js @@ -7,15 +7,16 @@ es5id: 15.4.4.20-5-2 description: Array.prototype.filter - thisArg is Object ---*/ - var res = false; - var o = new Object(); - o.res = true; - function callbackfn(val, idx, obj) - { - return this.res; - } +var res = false; +var o = new Object(); +o.res = true; - var srcArr = [1]; - var resArr = srcArr.filter(callbackfn,o); +function callbackfn(val, idx, obj) +{ + return this.res; +} + +var srcArr = [1]; +var resArr = srcArr.filter(callbackfn, o); assert.sameValue(resArr.length, 1, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-21.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-21.js index bbb9911ac04921f41a912f0affdb56eb13b9fa90..1e1230bc4640fe6636c171776a909aa80769b53c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-21.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-21.js @@ -9,14 +9,14 @@ description: Array.prototype.filter - the global object can be used as thisArg var global = this; - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return this === global; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === global; +} - var newArr = [11].filter(callbackfn, global); +var newArr = [11].filter(callbackfn, global); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-22.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-22.js index 61e3644cfb02fdc9f0886846d93b2fa5ab26c8bb..b228ea16caee89f811cf2f135f0fb24fd1438f9a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-22.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-22.js @@ -7,14 +7,14 @@ es5id: 15.4.4.20-5-22 description: Array.prototype.filter - boolean primitive can be used as thisArg ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return this.valueOf() === false; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this.valueOf() === false; +} - var newArr = [11].filter(callbackfn, false); +var newArr = [11].filter(callbackfn, false); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-23.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-23.js index d07c4c603a4e09c243dce05ccd0f0a7fbdbc5e51..b7435cbf235b6d869c1f5af31f8ab6348f45ac5a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-23.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-23.js @@ -7,14 +7,14 @@ es5id: 15.4.4.20-5-23 description: Array.prototype.filter - number primitive can be used as thisArg ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return this.valueOf() === 101; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this.valueOf() === 101; +} - var newArr = [11].filter(callbackfn, 101); +var newArr = [11].filter(callbackfn, 101); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-24.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-24.js index ac195d2b105c5903dc1c7851c0fe26e8cbf695bf..ec99f9b2b587657f97bc27a40317cdda7cbeb575 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-24.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-24.js @@ -7,14 +7,14 @@ es5id: 15.4.4.20-5-24 description: Array.prototype.filter - string primitive can be used as thisArg ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return this.valueOf() === "abc"; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this.valueOf() === "abc"; +} - var newArr = [11].filter(callbackfn, "abc"); +var newArr = [11].filter(callbackfn, "abc"); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-27.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-27.js index 06ea3908d74d0ba1278a2110e02db4eda3b9c260..691c695e73ad94108f3e3cf1ee4e73ce019e6d61 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-27.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-27.js @@ -9,6 +9,6 @@ description: > is the returned array ---*/ - var newArr = [11].filter(function () { }); +var newArr = [11].filter(function() {}); assert(Array.isArray(newArr), 'Array.isArray(newArr) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-28.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-28.js index 0f41a07e42bb037c69fe9a2e1c12f316643ed5b1..676b5f39b2a0462b228892a2721827ac2410133a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-28.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-28.js @@ -7,6 +7,6 @@ es5id: 15.4.4.20-5-28 description: Array.prototype.filter - the returned array is instanceof Array ---*/ - var newArr = [11].filter(function () { }); +var newArr = [11].filter(function() {}); assert(newArr instanceof Array, 'newArr instanceof Array !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-29.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-29.js index 49b049b6fb6595967ac5a7151da98fdeea769faf..88656b8138864cb58baefe2ece7d2aa3f5dda769 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-29.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-29.js @@ -7,6 +7,6 @@ es5id: 15.4.4.20-5-29 description: Array.prototype.filter - returns an array whose length is 0 ---*/ - var newArr = [11].filter(function () { }); +var newArr = [11].filter(function() {}); assert.sameValue(newArr.length, 0, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-3.js index a9eb5bdd9c6a129cd4f4d43ee21bdd2ce1d77be4..4ab8cdc1cfe1fb21576f740598796bbfca0372cd 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-3.js @@ -7,15 +7,16 @@ es5id: 15.4.4.20-5-3 description: Array.prototype.filter - thisArg is Array ---*/ - var res = false; - var a = new Array(); - a.res = true; - function callbackfn(val, idx, obj) - { - return this.res; - } +var res = false; +var a = new Array(); +a.res = true; - var srcArr = [1]; - var resArr = srcArr.filter(callbackfn,a); +function callbackfn(val, idx, obj) +{ + return this.res; +} + +var srcArr = [1]; +var resArr = srcArr.filter(callbackfn, a); assert.sameValue(resArr.length, 1, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-30.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-30.js index 19311b2aec95479de3c2d74ca7bf4c0aa750e19a..8a3fb876fa2bf66eb1e5a2674a988aa3d812b889 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-30.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-30.js @@ -8,16 +8,16 @@ description: Array.prototype.filter - thisArg not passed flags: [noStrict] ---*/ - function innerObj() { - this._15_4_4_20_5_30 = true; - var _15_4_4_20_5_30 = false; +function innerObj() { + this._15_4_4_20_5_30 = true; + var _15_4_4_20_5_30 = false; - function callbackfn(val, idx, obj) { - return this._15_4_4_20_5_30; - } - var srcArr = [1]; - var resArr = srcArr.filter(callbackfn); - this.retVal = resArr.length === 0; - } + function callbackfn(val, idx, obj) { + return this._15_4_4_20_5_30; + } + var srcArr = [1]; + var resArr = srcArr.filter(callbackfn); + this.retVal = resArr.length === 0; +} assert(new innerObj().retVal, 'new innerObj().retVal !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-4.js index e4c6b1b24dd628ee5a6b826155e4834c3e6cde24..08789d8e38e5733721809938f0c909d30aa6c6db 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-4.js @@ -9,17 +9,18 @@ description: > template(prototype) ---*/ - var res = false; - function callbackfn(val, idx, obj) - { - return this.res; - } +var res = false; - function foo(){} - foo.prototype.res = true; - var f = new foo(); +function callbackfn(val, idx, obj) +{ + return this.res; +} - var srcArr = [1]; - var resArr = srcArr.filter(callbackfn,f); +function foo() {} +foo.prototype.res = true; +var f = new foo(); + +var srcArr = [1]; +var resArr = srcArr.filter(callbackfn, f); assert.sameValue(resArr.length, 1, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-5.js index a46d828820d35fd8615b3be363a0c5f4ce35860d..a024bdc323efde7c0ca5caf113603ba3baf47751 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-5.js @@ -7,17 +7,18 @@ es5id: 15.4.4.20-5-5 description: Array.prototype.filter - thisArg is object from object template ---*/ - var res = false; - function callbackfn(val, idx, obj) - { - return this.res; - } +var res = false; - function foo(){} - var f = new foo(); - f.res = true; +function callbackfn(val, idx, obj) +{ + return this.res; +} - var srcArr = [1]; - var resArr = srcArr.filter(callbackfn,f); +function foo() {} +var f = new foo(); +f.res = true; + +var srcArr = [1]; +var resArr = srcArr.filter(callbackfn, f); assert.sameValue(resArr.length, 1, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-6.js index a76f146d6bc48c08fd7164e31c815f2d9307f95e..25fa96c9790e45d0d980e964cc0393b1e30d29f6 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-6.js @@ -7,16 +7,17 @@ es5id: 15.4.4.20-5-6 description: Array.prototype.filter - thisArg is function ---*/ - var res = false; - function callbackfn(val, idx, obj) - { - return this.res; - } +var res = false; - function foo(){} - foo.res = true; +function callbackfn(val, idx, obj) +{ + return this.res; +} - var srcArr = [1]; - var resArr = srcArr.filter(callbackfn,foo); +function foo() {} +foo.res = true; + +var srcArr = [1]; +var resArr = srcArr.filter(callbackfn, foo); assert.sameValue(resArr.length, 1, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-7.js index 7563712c2a6f7973f239a523623c567f7468dacc..7429c85bce7f27fc3c5bd94b34554531b87b9e52 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-7.js @@ -7,14 +7,14 @@ es5id: 15.4.4.20-5-7 description: Array.prototype.filter - built-in functions can be used as thisArg ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return this === eval; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === eval; +} - var newArr = [11].filter(callbackfn, eval); +var newArr = [11].filter(callbackfn, eval); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-9.js index 154d0bbdb4ed11b79510bf43d14dc74baf1c3292..9ab52aa3ea34718d065901e3d75c75ca5b3894ec 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-9.js @@ -7,15 +7,15 @@ es5id: 15.4.4.20-5-9 description: Array.prototype.filter - Function Object can be used as thisArg ---*/ - var accessed = false; - var objFunction = function () { }; +var accessed = false; +var objFunction = function() {}; - function callbackfn(val, idx, obj) { - accessed = true; - return this === objFunction; - } +function callbackfn(val, idx, obj) { + accessed = true; + return this === objFunction; +} - var newArr = [11].filter(callbackfn, objFunction); +var newArr = [11].filter(callbackfn, objFunction); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-1.js index aa434d235f4b9412663a06bbdade1a6f5d62fb7c..719c1490e5adfc7183bd1ab160ee92a98b9c9e60 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-1.js @@ -9,8 +9,8 @@ description: > (empty array) ---*/ - function cb(){} - var a = [].filter(cb); +function cb() {} +var a = [].filter(cb); assert(Array.isArray(a), 'Array.isArray(a) !== true'); assert.sameValue(a.length, 0, 'a.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-2.js index a2deb91e5c89f70b56a3406b0d47ba487c9be0de..65a07c7a8379e4b51dce207aeb55d588e1570de6 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-2.js @@ -9,13 +9,14 @@ description: > (subclassed Array, length overridden to null (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = null; +foo.prototype = new Array(1, 2, 3); - function cb(){} - var a = f.filter(cb); +function foo() {} +var f = new foo(); +f.length = null; + +function cb() {} +var a = f.filter(cb); assert(Array.isArray(a), 'Array.isArray(a) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-3.js index 5da697fe2b507495e8d7b54a4ae686e7c9cf3ca9..4e1742878e52ef3aa1b038314a1bf8caaee44704 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-3.js @@ -9,13 +9,14 @@ description: > (subclassed Array, length overridden to false (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = false; +foo.prototype = new Array(1, 2, 3); - function cb(){} - var a = f.filter(cb); +function foo() {} +var f = new foo(); +f.length = false; + +function cb() {} +var a = f.filter(cb); assert(Array.isArray(a), 'Array.isArray(a) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-4.js index 88d755df8aff82a74c901b18806196cb17c94d98..72579c85e6aabbead7b0b78f300f5edefab80286 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-4.js @@ -9,13 +9,14 @@ description: > (subclassed Array, length overridden to 0 (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = 0; +foo.prototype = new Array(1, 2, 3); - function cb(){} - var a = f.filter(cb); +function foo() {} +var f = new foo(); +f.length = 0; + +function cb() {} +var a = f.filter(cb); assert(Array.isArray(a), 'Array.isArray(a) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-5.js index 71f4dc4896b4887c610ba69e5cda87f17045e109..6209e7107718170159e151502cfc67b49efe402a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-5.js @@ -9,13 +9,14 @@ description: > (subclassed Array, length overridden to '0' (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = '0'; +foo.prototype = new Array(1, 2, 3); - function cb(){} - var a = f.filter(cb); +function foo() {} +var f = new foo(); +f.length = '0'; + +function cb() {} +var a = f.filter(cb); assert(Array.isArray(a), 'Array.isArray(a) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-6.js index dad709203c3216044983bb576b97ae4933801f7b..0d40729d1537ed1d5a5cc94fa24d9cd8274aac4e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-6.js @@ -9,15 +9,20 @@ description: > (subclassed Array, length overridden with obj with valueOf) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - var o = { valueOf: function () { return 0;}}; - f.length = o; +function foo() {} +var f = new foo(); - function cb(){} - var a = f.filter(cb); +var o = { + valueOf: function() { + return 0; + } +}; +f.length = o; + +function cb() {} +var a = f.filter(cb); assert(Array.isArray(a), 'Array.isArray(a) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-7.js index a778ad88871ac05350ec620dd2736a7e9f705a12..b212e25112231d0df84a8fe16ee405a06f644e44 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-7.js @@ -10,21 +10,26 @@ description: > (toString)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - var o = { toString: function () { return '0';}}; - f.length = o; +function foo() {} +var f = new foo(); - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. +var o = { + toString: function() { + return '0'; + } +}; +f.length = o; - function cb(){} - var a = f.filter(cb); +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. + +function cb() {} +var a = f.filter(cb); assert(Array.isArray(a), 'Array.isArray(a) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-8.js index 1fd2bb7921d1a4ee4bef40c652dcc8b195f63161..851aa7a75cf298ccd484176b482482498a32115a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-8.js @@ -9,28 +9,29 @@ description: > (subclassed Array, length overridden with [] ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - - f.length = []; - - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - // - // The toString( ) method on Array converts the array elements to strings, - // then returns the result of concatenating these strings, with commas in - // between. An array with no elements converts to the empty string, which - // converts to the number 0. If an array has a single element that is a - // number n, the array converts to a string representation of n, which is - // then converted back to n itself. If an array contains more than one element, - // or if its one element is not a number, the array converts to NaN. - - function cb(){} - var a = f.filter(cb); +foo.prototype = new Array(1, 2, 3); + +function foo() {} +var f = new foo(); + +f.length = []; + +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +// +// The toString( ) method on Array converts the array elements to strings, +// then returns the result of concatenating these strings, with commas in +// between. An array with no elements converts to the empty string, which +// converts to the number 0. If an array has a single element that is a +// number n, the array converts to a string representation of n, which is +// then converted back to n itself. If an array contains more than one element, +// or if its one element is not a number, the array converts to NaN. + +function cb() {} +var a = f.filter(cb); assert(Array.isArray(a), 'Array.isArray(a) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-1.js index 97a92c2de5f4804b33ddcef137be4621eb7224a5..265b9632b874fe6dd062e96a32ac7b63fa6fd142 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-1.js @@ -9,13 +9,13 @@ description: > array after it is called ---*/ - function callbackfn(val, idx, obj) { - srcArr[2] = 3; - srcArr[5] = 6; - return true; - } +function callbackfn(val, idx, obj) { + srcArr[2] = 3; + srcArr[5] = 6; + return true; +} - var srcArr = [1, 2, , 4, 5]; - var resArr = srcArr.filter(callbackfn); +var srcArr = [1, 2, , 4, 5]; +var resArr = srcArr.filter(callbackfn); assert.sameValue(resArr.length, 5, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-2.js index 866e363fcf718b197e0ded0d90d94808286fc60d..34e27ba5699a58f70766449974135608a4a49d84 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-2.js @@ -9,18 +9,18 @@ description: > after it is called ---*/ - function callbackfn(val, idx, obj) - { - srcArr[2] = -1; - srcArr[4] = -1; - if(val > 0) - return true; - else - return false; - } +function callbackfn(val, idx, obj) +{ + srcArr[2] = -1; + srcArr[4] = -1; + if (val > 0) + return true; + else + return false; +} - var srcArr = [1,2,3,4,5]; - var resArr = srcArr.filter(callbackfn); +var srcArr = [1, 2, 3, 4, 5]; +var resArr = srcArr.filter(callbackfn); assert.sameValue(resArr.length, 3, 'resArr.length'); assert.sameValue(resArr[0], 1, 'resArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-3.js index 23cf770ca338d97149f095198f1724792dc1dbe5..5f14532d216e4bd3ddfcd9684d189e763b23033e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-3.js @@ -9,18 +9,18 @@ description: > after the call ---*/ - function callbackfn(val, idx, obj) - { - delete srcArr[2]; - delete srcArr[4]; - if(val > 0) - return true; - else - return false; - } +function callbackfn(val, idx, obj) +{ + delete srcArr[2]; + delete srcArr[4]; + if (val > 0) + return true; + else + return false; +} - var srcArr = [1,2,3,4,5]; - var resArr = srcArr.filter(callbackfn); +var srcArr = [1, 2, 3, 4, 5]; +var resArr = srcArr.filter(callbackfn); // two elements deleted assert.sameValue(resArr.length, 3, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-4.js index 9e817d779bd880db11326c3a2456f984b74341ad..d3018ec04c8fbd77931639efd3c0d9dcf2c290b3 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-4.js @@ -9,13 +9,13 @@ description: > Array.length is decreased ---*/ - function callbackfn(val, idx, obj) - { - srcArr.length = 2; - return true; - } +function callbackfn(val, idx, obj) +{ + srcArr.length = 2; + return true; +} - var srcArr = [1,2,3,4,6]; - var resArr = srcArr.filter(callbackfn); +var srcArr = [1, 2, 3, 4, 6]; +var resArr = srcArr.filter(callbackfn); assert.sameValue(resArr.length, 2, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-5.js index 3165b934c20c621e80e1e261e29a589ca40b56da..396126ea1d00ff5e23e41da9540a8279da8950dc 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-5.js @@ -9,15 +9,15 @@ description: > sparse array ---*/ - function callbackfn(val, idx, obj) - { - srcArr[1000] = 3; - return true; - } +function callbackfn(val, idx, obj) +{ + srcArr[1000] = 3; + return true; +} - var srcArr = new Array(10); - srcArr[1] = 1; - srcArr[2] = 2; - var resArr = srcArr.filter(callbackfn); +var srcArr = new Array(10); +srcArr[1] = 1; +srcArr[2] = 2; +var resArr = srcArr.filter(callbackfn); assert.sameValue(resArr.length, 2, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-6.js index 6bbe73b49471eabc32dfd0445259bad9e2ef6aa6..0ef2af055523ae69243b2300f46ad74eda9d7c05 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-6.js @@ -9,20 +9,20 @@ description: > call when same index is also present in prototype ---*/ - function callbackfn(val, idx, obj) - { - delete srcArr[2]; - delete srcArr[4]; - if(val > 0) - return true; - else - return false; - } +function callbackfn(val, idx, obj) +{ + delete srcArr[2]; + delete srcArr[4]; + if (val > 0) + return true; + else + return false; +} - Array.prototype[4] = 5; - var srcArr = [1,2,3,4,5]; - var resArr = srcArr.filter(callbackfn); - delete Array.prototype[4]; +Array.prototype[4] = 5; +var srcArr = [1, 2, 3, 4, 5]; +var resArr = srcArr.filter(callbackfn); +delete Array.prototype[4]; // only one element deleted assert.sameValue(resArr.length, 4, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-7.js index 6733d095d66ca722d0d79bc260083fe88179fcfd..accd42a6033767463001642c534bd58613258412 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-7.js @@ -9,18 +9,18 @@ description: > deleted during the call ---*/ - var o = new Object(); - o.srcArr = [1, 2, 3, 4, 5]; +var o = new Object(); +o.srcArr = [1, 2, 3, 4, 5]; - function callbackfn(val, idx, obj) { - delete o.srcArr; - if (val > 0) - return true; - else - return false; - } +function callbackfn(val, idx, obj) { + delete o.srcArr; + if (val > 0) + return true; + else + return false; +} - var resArr = o.srcArr.filter(callbackfn); +var resArr = o.srcArr.filter(callbackfn); assert.sameValue(resArr.length, 5, 'resArr.length'); assert.sameValue(typeof o.srcArr, "undefined", 'typeof o.srcArr'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-8.js index 6b119020eccdc8b85860c520e0b9cb279277ca0c..c7fa048ef7a1cebd7db9bd9693fd2e21dfdc21dc 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-8.js @@ -7,16 +7,20 @@ es5id: 15.4.4.20-9-8 description: Array.prototype.filter - no observable effects occur if len is 0 ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var obj = { 0: 11, 1: 12, length: 0 }; +var obj = { + 0: 11, + 1: 12, + length: 0 +}; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(accessed, false, 'accessed'); assert.sameValue(obj.length, 0, 'obj.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-9.js index bab2effd5cdadee72480e187464951531e4811dd..e0bd841bf0aab00b41c8f0d96c3277e1b7d4c51e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-9.js @@ -9,24 +9,28 @@ description: > number of iterations ---*/ - var called = 0; +var called = 0; - function callbackfn(val, idx, obj) { - called++; - return true; - } +function callbackfn(val, idx, obj) { + called++; + return true; +} - var obj = { 1: 12, 2: 9, length: 2 }; +var obj = { + 1: 12, + 2: 9, + length: 2 +}; - Object.defineProperty(obj, "0", { - get: function () { - obj.length = 3; - return 11; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + obj.length = 3; + return 11; + }, + configurable: true +}); - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-1.js index db984c4ccb0b650988e3bf0f996fe8ac2c1f8cd6..89915693087fb785d7651c6f44ac7b05589340d4 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-1.js @@ -9,16 +9,17 @@ description: > been assigned values ---*/ - var callCnt = 0; - function callbackfn(val, idx, obj) - { - callCnt++; - return false; - } +var callCnt = 0; - var srcArr = new Array(10); - srcArr[1] = undefined; //explicitly assigning a value - var resArr = srcArr.filter(callbackfn); +function callbackfn(val, idx, obj) +{ + callCnt++; + return false; +} + +var srcArr = new Array(10); +srcArr[1] = undefined; //explicitly assigning a value +var resArr = srcArr.filter(callbackfn); assert.sameValue(resArr.length, 0, 'resArr.length'); assert.sameValue(callCnt, 1, 'callCnt'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-10.js index c2c66ae19e2ca875dab1742493193ee73b2ea354..d4724b9249f295a6c72cd7f22c601e0d293dec64 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-10.js @@ -9,21 +9,24 @@ description: > prototype index property not to be visited on an Array-like Object ---*/ - function callbackfn(val, idx, obj) { - return true; - } - var obj = { 2: 2, length: 20 }; +function callbackfn(val, idx, obj) { + return true; +} +var obj = { + 2: 2, + length: 20 +}; - Object.defineProperty(obj, "0", { - get: function () { - delete Object.prototype[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + delete Object.prototype[1]; + return 0; + }, + configurable: true +}); - Object.prototype[1] = 1; - var newArr = Array.prototype.filter.call(obj, callbackfn); +Object.prototype[1] = 1; +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); assert.notSameValue(newArr[1], 1, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-11.js index 643554ab8f52dd0372f5e4a62d3278f6cccae639..39ea8f0a10bba9e2ce4114e937bdfa684f558461 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-11.js @@ -9,21 +9,21 @@ description: > prototype index property not to be visited on an Array ---*/ - function callbackfn(val, idx, obj) { - return true; - } - var arr = [0, , 2]; +function callbackfn(val, idx, obj) { + return true; +} +var arr = [0, , 2]; - Object.defineProperty(arr, "0", { - get: function () { - delete Array.prototype[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete Array.prototype[1]; + return 0; + }, + configurable: true +}); - Array.prototype[1] = 1; - var newArr = arr.filter(callbackfn); +Array.prototype[1] = 1; +var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); assert.notSameValue(newArr[1], 1, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-12.js index 18e21b40ea4a6166444b823774ff512f07f196e6..7b914a1ee4d55077f7402721815012c25c22a3f8 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-12.js @@ -10,21 +10,26 @@ description: > Array-like object ---*/ - function callbackfn(val, idx, obj) { - return true; - } - var obj = { 0: 0, 1: 111, 2: 2, length: 10 }; +function callbackfn(val, idx, obj) { + return true; +} +var obj = { + 0: 0, + 1: 111, + 2: 2, + length: 10 +}; - Object.defineProperty(obj, "0", { - get: function () { - delete obj[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + delete obj[1]; + return 0; + }, + configurable: true +}); - Object.prototype[1] = 1; - var newArr = Array.prototype.filter.call(obj, callbackfn); +Object.prototype[1] = 1; +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 3, 'newArr.length'); assert.sameValue(newArr[1], 1, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-13.js index c023e37351db6ac5598a7614d890c733f62d7056..204e94c6658bcf9654067b2f8890edcb505a2f0c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-13.js @@ -9,21 +9,21 @@ description: > property causes prototype index property to be visited on an Array ---*/ - function callbackfn(val, idx, obj) { - return val < 3 ? true : false; - } - var arr = [0, 111, 2]; +function callbackfn(val, idx, obj) { + return val < 3 ? true : false; +} +var arr = [0, 111, 2]; - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); - Array.prototype[1] = 1; - var newArr = arr.filter(callbackfn); +Array.prototype[1] = 1; +var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 3, 'newArr.length'); assert.sameValue(newArr[1], 1, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-14.js index 6147fab6731119bf5a01796cc8f4831e04e1a6dc..00b6a41afaaf1f737435378d3c0ab3eac49129ef 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-14.js @@ -9,20 +9,20 @@ description: > property not to be visited ---*/ - function callbackfn(val, idx, obj) { - return true; - } - var arr = [0, 1, 2, "last"]; +function callbackfn(val, idx, obj) { + return true; +} +var arr = [0, 1, 2, "last"]; - Object.defineProperty(arr, "0", { - get: function () { - arr.length = 3; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + arr.length = 3; + return 0; + }, + configurable: true +}); - var newArr = arr.filter(callbackfn); +var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 3, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-15.js index 4e253c64e1fd0df14e81cb2601141277df8a39e9..1f87dab30fa5f9ed2b170c8833ab4289f2b9001a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-15.js @@ -9,27 +9,27 @@ description: > property causes prototype index property to be visited ---*/ - function callbackfn(val, idx, obj) { - return true; - } - var arr = [0, 1, 2]; +function callbackfn(val, idx, obj) { + return true; +} +var arr = [0, 1, 2]; - Object.defineProperty(Array.prototype, "2", { - get: function () { - return "prototype"; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "2", { + get: function() { + return "prototype"; + }, + configurable: true +}); - Object.defineProperty(arr, "1", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); - var newArr = arr.filter(callbackfn); +var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 3, 'newArr.length'); assert.sameValue(newArr[2], "prototype", 'newArr[2]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-16.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-16.js index c81608958c35ae261f3c2a4256658fdabf056929..b92fde3af46a8653ef2f3456bb48230fc0a1943f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-16.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-16.js @@ -10,28 +10,28 @@ description: > flags: [noStrict] ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var arr = [0, 1, 2]; +var arr = [0, 1, 2]; - Object.defineProperty(arr, "2", { - get: function () { - return "unconfigurable"; - }, - configurable: false - }); +Object.defineProperty(arr, "2", { + get: function() { + return "unconfigurable"; + }, + configurable: false +}); - Object.defineProperty(arr, "1", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); - var newArr = arr.filter(callbackfn); +var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 3, 'newArr.length'); assert.sameValue(newArr[2], "unconfigurable", 'newArr[2]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-2.js index 63ffe45b5fda970276da076000c0b75bfcebc496..a9b8cdae4d506cd9c208772dc03d0fdf44ff9cac 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-2.js @@ -9,21 +9,21 @@ description: > here ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = {}; +var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - obj[2] = "length"; - return 3; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + obj[2] = "length"; + return 3; + }, + configurable: true +}); - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], "length", 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-3.js index 9201770ac4c30104a186e1f160696c6a2a589c2e..fd2a2612e9baa488fff43bd908cadfcd20c0bb55 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-3.js @@ -9,20 +9,23 @@ description: > here ---*/ - function callbackfn(val, idx, obj) { - return true; - } - var obj = { 2: 6.99, 8: 19 }; +function callbackfn(val, idx, obj) { + return true; +} +var obj = { + 2: 6.99, + 8: 19 +}; - Object.defineProperty(obj, "length", { - get: function () { - delete obj[2]; - return 10; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + delete obj[2]; + return 10; + }, + configurable: true +}); - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.notSameValue(newArr[0], 6.99, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-4.js index 81a5e3d1186dfa4ec4a3a4eb2e46aa2df015f570..61ad18595198a59965b5efdd041538a874af943b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-4.js @@ -9,26 +9,28 @@ description: > current position are visited on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { length: 2 }; +var obj = { + length: 2 +}; - Object.defineProperty(obj, "0", { - get: function () { - Object.defineProperty(obj, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + Object.defineProperty(obj, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); assert.sameValue(newArr[1], 6.99, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-5.js index 150eda57cc847bbc607a432f884937d3c9c3fc41..d2d1fd70ca525f06ee8f8fa96d59097474df2845 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-5.js @@ -9,26 +9,26 @@ description: > current position are visited on an Array ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var arr = [0, , 2]; +var arr = [0, , 2]; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(arr, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(arr, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - var newArr = arr.filter(callbackfn); +var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 3, 'newArr.length'); assert.sameValue(newArr[1], 6.99, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-6.js index 0932eb3345e9e68834560130d37c9054b4a1dfc1..d0bc0fb1e4b7fe3ec0002b45740a5126591706c2 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-6.js @@ -9,25 +9,27 @@ description: > after current position are visited on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - return true; - } - var obj = { length: 2 }; +function callbackfn(val, idx, obj) { + return true; +} +var obj = { + length: 2 +}; - Object.defineProperty(obj, "0", { - get: function () { - Object.defineProperty(Object.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + Object.defineProperty(Object.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); assert.sameValue(Array[1], 6.99, 'Array[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-7.js index 677e3106fcd37c1906f358b0fd6d0ef1e35a8c5c..1fea7874622babde7eecbe749f49048b193a6fac 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-7.js @@ -9,25 +9,25 @@ description: > after current position are visited on an Array ---*/ - function callbackfn(val, idx, obj) { - return true; - } - var arr = [0, , 2]; +function callbackfn(val, idx, obj) { + return true; +} +var arr = [0, , 2]; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(Array.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(Array.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - var newArr = arr.filter(callbackfn); +var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 3, 'newArr.length'); assert.sameValue(newArr[1], 6.99, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-8.js index 00d064e237b654cdda460e6bf66f1ffe8d04c133..0593df24fe33e5523c9b77c2c70899d03380cef5 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-8.js @@ -9,30 +9,32 @@ description: > property not to be visited on an Array-like object ---*/ - var accessed = false; - var obj = { length: 2 }; +var accessed = false; +var obj = { + length: 2 +}; - function callbackfn(val, idx, o) { - accessed = true; - return true; - } +function callbackfn(val, idx, o) { + accessed = true; + return true; +} - Object.defineProperty(obj, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + return 6.99; + }, + configurable: true +}); - Object.defineProperty(obj, "0", { - get: function () { - delete obj[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + delete obj[1]; + return 0; + }, + configurable: true +}); - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 0, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-9.js index 8f1588765fc093f6fca0df65d48d2c357e65db62..1221c8864b706516870a63424fa433924a8bfb83 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-9.js @@ -9,27 +9,27 @@ description: > property not to be visited on an Array ---*/ - function callbackfn(val, idx, obj) { - return true; - } - var arr = [1, 2]; +function callbackfn(val, idx, obj) { + return true; +} +var arr = [1, 2]; - Object.defineProperty(arr, "1", { - get: function () { - return "6.99"; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + return "6.99"; + }, + configurable: true +}); - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); - var newArr = arr.filter(callbackfn); +var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 0, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-1.js index cdfc98323c7df0beab56612a6f30063e26bdf493..de7e415f3028cfebedbcbdcf99623e67c6e8fc5d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-1.js @@ -9,14 +9,18 @@ description: > property on an Array-like object ---*/ - var kValue = {}; - function callbackfn(val, idx, obj) { - return (idx === 5) && (val === kValue); - } +var kValue = {}; - var obj = { 5: kValue, length: 100 }; +function callbackfn(val, idx, obj) { + return (idx === 5) && (val === kValue); +} - var newArr = Array.prototype.filter.call(obj, callbackfn); +var obj = { + 5: kValue, + length: 100 +}; + +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], kValue, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-10.js index b44cba1e3f66928e9de9dd0210e0efd96abb792f..394268152cd7e18d178301aa56a057facda212b1 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-10.js @@ -9,19 +9,19 @@ description: > property on an Array ---*/ - function callbackfn(val, idx, obj) { - return idx === 2 && val === 12; - } +function callbackfn(val, idx, obj) { + return idx === 2 && val === 12; +} - var arr = []; +var arr = []; - Object.defineProperty(arr, "2", { - get: function () { - return 12; - }, - configurable: true - }); - var newArr = arr.filter(callbackfn); +Object.defineProperty(arr, "2", { + get: function() { + return 12; + }, + configurable: true +}); +var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 12, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-11.js index dc089ead83aff105fd4d4735d165553badeff7d6..a713e1953ea4299595218c8c47d5a7cbde686e61 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-11.js @@ -10,25 +10,28 @@ description: > Array-like object ---*/ - function callbackfn(val, idx, obj) { - return idx === 0 && val === 11; - } +function callbackfn(val, idx, obj) { + return idx === 0 && val === 11; +} - var proto = { 0: 5, 1: 6 }; +var proto = { + 0: 5, + 1: 6 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 10; +var child = new Con(); +child.length = 10; - Object.defineProperty(child, "0", { - get: function () { - return 11; - }, - configurable: true - }); - var newArr = Array.prototype.filter.call(child, callbackfn); +Object.defineProperty(child, "0", { + get: function() { + return 11; + }, + configurable: true +}); +var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-12.js index bcd3b4287ecca7ce9a757bc739380f7751ee6be7..7dc94d210bfcb5772340b77a6790eb338124fe3a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-12.js @@ -9,21 +9,21 @@ description: > property that overrides an inherited data property on an Array ---*/ - function callbackfn(val, idx, obj) { - return val === 111 && idx === 0; - } +function callbackfn(val, idx, obj) { + return val === 111 && idx === 0; +} - var arr = []; +var arr = []; - Array.prototype[0] = 10; +Array.prototype[0] = 10; - Object.defineProperty(arr, "0", { - get: function () { - return 111; - }, - configurable: true - }); - var newArr = arr.filter(callbackfn); +Object.defineProperty(arr, "0", { + get: function() { + return 111; + }, + configurable: true +}); +var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 111, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-13.js index 32d9fa6f4c963e76d5e9d7b9138faf8bc2c3d952..4a692475a25ae5e5582de5ef030ed08ab064750a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-13.js @@ -10,32 +10,32 @@ description: > Array-like object ---*/ - function callbackfn(val, idx, obj) { - return idx === 1 && val === 12; - } - - var proto = {}; - - Object.defineProperty(proto, "1", { - get: function () { - return 6; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 10; - - Object.defineProperty(child, "1", { - get: function () { - return 12; - }, - configurable: true - }); - var newArr = Array.prototype.filter.call(child, callbackfn); +function callbackfn(val, idx, obj) { + return idx === 1 && val === 12; +} + +var proto = {}; + +Object.defineProperty(proto, "1", { + get: function() { + return 6; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 10; + +Object.defineProperty(child, "1", { + get: function() { + return 12; + }, + configurable: true +}); +var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 12, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-14.js index 1ccf426ac643dfe447b5cf85fbbbd554bfea227d..e6f2a95c64dc09743d14697d8dd1a7efdb16a706 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-14.js @@ -9,26 +9,26 @@ description: > property that overrides an inherited accessor property on an Array ---*/ - function callbackfn(val, idx, obj) { - return idx === 0 && val === 11; - } +function callbackfn(val, idx, obj) { + return idx === 0 && val === 11; +} - var arr = []; +var arr = []; - Object.defineProperty(Array.prototype, "0", { - get: function () { - return 5; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return 5; + }, + configurable: true +}); - Object.defineProperty(arr, "0", { - get: function () { - return 11; - }, - configurable: true - }); - var newArr = arr.filter(callbackfn); +Object.defineProperty(arr, "0", { + get: function() { + return 11; + }, + configurable: true +}); +var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-15.js index d97746c2da99153f91fa32e1fdbee174c81ceb05..4a7122ea1932f1ca1a875a4e63e6ade862487889 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-15.js @@ -9,25 +9,25 @@ description: > accessor property on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - return val === 11 && idx === 1; - } +function callbackfn(val, idx, obj) { + return val === 11 && idx === 1; +} - var proto = {}; +var proto = {}; - Object.defineProperty(proto, "1", { - get: function () { - return 11; - }, - configurable: true - }); +Object.defineProperty(proto, "1", { + get: function() { + return 11; + }, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 20; - var newArr = Array.prototype.filter.call(child, callbackfn); +var child = new Con(); +child.length = 20; +var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-16.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-16.js index 82834ff12ffbd0a4b8b678fa4fbd86054f164a08..9a04bb48759c0909bddd1404b79f77652d779c79 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-16.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-16.js @@ -9,17 +9,17 @@ description: > accessor property on an Array ---*/ - function callbackfn(val, idx, obj) { - return idx === 0 && val === 11; - } +function callbackfn(val, idx, obj) { + return idx === 0 && val === 11; +} - Object.defineProperty(Array.prototype, "0", { - get: function () { - return 11; - }, - configurable: true - }); - var newArr = [, , , ].filter(callbackfn); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return 11; + }, + configurable: true +}); +var newArr = [, , , ].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-17.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-17.js index 3b01f8f4c575668fa24df387317526acb3f06bad..17bd3f8a7dad0b0d69dd8e84e509f82abb8f6fd2 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-17.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-17.js @@ -9,17 +9,19 @@ description: > property without a get function on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - return undefined === val && idx === 1; - } +function callbackfn(val, idx, obj) { + return undefined === val && idx === 1; +} - var obj = { length: 2 }; - Object.defineProperty(obj, "1", { - set: function () { }, - configurable: true - }); +var obj = { + length: 2 +}; +Object.defineProperty(obj, "1", { + set: function() {}, + configurable: true +}); - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-18.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-18.js index 3cfc401b909eadf9880dc6759efc9d6a59fcbb01..b139b96a6fbd37feb8a89bd699814a276e7514b3 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-18.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-18.js @@ -9,18 +9,18 @@ description: > property without a get function on an Array ---*/ - function callbackfn(val, idx, obj) { - return undefined === val && idx === 0; - } +function callbackfn(val, idx, obj) { + return undefined === val && idx === 0; +} - var arr = []; +var arr = []; - Object.defineProperty(arr, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(arr, "0", { + set: function() {}, + configurable: true +}); - var newArr = arr.filter(callbackfn); +var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-19.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-19.js index 4ff5f9589cb9549aea9165fceae148340cc571f5..af8b5d615f5493783cc27e95f7f5d6741de554d1 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-19.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-19.js @@ -10,18 +10,20 @@ description: > accessor property on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - return undefined === val && idx === 1; - } +function callbackfn(val, idx, obj) { + return undefined === val && idx === 1; +} - var obj = { length: 2 }; - Object.defineProperty(obj, "1", { - set: function () { }, - configurable: true - }); +var obj = { + length: 2 +}; +Object.defineProperty(obj, "1", { + set: function() {}, + configurable: true +}); - Object.prototype[1] = 10; - var newArr = Array.prototype.filter.call(obj, callbackfn); +Object.prototype[1] = 10; +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-2.js index b2ea87479f4969ef03c2b61f7379a61c69f8b3f8..a129174e77207f4b342829b36e48da447b857346 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-2.js @@ -9,13 +9,13 @@ description: > property on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === 11; - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 11; + } +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-20.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-20.js index 83958a877df3fe5005043a0392e680a8eabf5ce3..fa5905c96fa592b5c5ab67636650f7e183dbe373 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-20.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-20.js @@ -10,19 +10,19 @@ description: > accessor property on an Array ---*/ - function callbackfn(val, idx, obj) { - return undefined === val && idx === 0; - } +function callbackfn(val, idx, obj) { + return undefined === val && idx === 0; +} - var arr = []; +var arr = []; - Object.defineProperty(arr, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(arr, "0", { + set: function() {}, + configurable: true +}); - Array.prototype[0] = 100; - var newArr = arr.filter(callbackfn); +Array.prototype[0] = 100; +var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-21.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-21.js index e4c19177bff2290a64943247b6e0f5f1ac915543..87bc30149a3edc919f3216dea9684f10ce3c5474 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-21.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-21.js @@ -9,22 +9,22 @@ description: > accessor property without a get function on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - return val === undefined && idx === 1; - } +function callbackfn(val, idx, obj) { + return val === undefined && idx === 1; +} - var proto = {}; - Object.defineProperty(proto, "1", { - set: function () { }, - configurable: true - }); +var proto = {}; +Object.defineProperty(proto, "1", { + set: function() {}, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 2; - var newArr = Array.prototype.filter.call(child, callbackfn); +var child = new Con(); +child.length = 2; +var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-22.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-22.js index 5093adca4e76642fe68da4b8e369b4459db71ef2..ce088257b28829cb0f0c0378d2328b05e52b9cd5 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-22.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-22.js @@ -9,15 +9,15 @@ description: > accessor property without a get function on an Array ---*/ - function callbackfn(val, idx, obj) { - return undefined === val && idx === 0; - } +function callbackfn(val, idx, obj) { + return undefined === val && idx === 0; +} - Object.defineProperty(Array.prototype, "0", { - set: function () { }, - configurable: true - }); - var newArr = [, ].filter(callbackfn); +Object.defineProperty(Array.prototype, "0", { + set: function() {}, + configurable: true +}); +var newArr = [, ].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-25.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-25.js index f050065ed49bb7a3280cd00f12a27e963c774ac7..f2288892ed07703fd6879edd1ac855453300afa8 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-25.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-25.js @@ -10,15 +10,15 @@ description: > less than number of parameters) ---*/ - function callbackfn(val, idx, obj) { - return val === 11 && idx === 0; - } +function callbackfn(val, idx, obj) { + return val === 11 && idx === 0; +} - var func = function (a, b) { - return Array.prototype.filter.call(arguments, callbackfn); - }; +var func = function(a, b) { + return Array.prototype.filter.call(arguments, callbackfn); +}; - var newArr = func(11); +var newArr = func(11); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-26.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-26.js index 4c5719f154f882dcf969d8ea8a99a18fa6b09dbd..13eabc564a075b11386a07a7b2da50ee6cb2e9fb 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-26.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-26.js @@ -10,20 +10,20 @@ description: > number of parameters) ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === 11; - } else if (idx === 1) { - return val === 9; - } else { - return false; - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 11; + } else if (idx === 1) { + return val === 9; + } else { + return false; + } +} - var func = function (a, b) { - return Array.prototype.filter.call(arguments, callbackfn); - }; - var newArr = func(11, 9); +var func = function(a, b) { + return Array.prototype.filter.call(arguments, callbackfn); +}; +var newArr = func(11, 9); assert.sameValue(newArr.length, 2, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-27.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-27.js index 96927339aaabdfcffa8c78793be6d4d4b2cd9972..117cbb39b71fe0de3b0d6d22b9313a65e038bd0f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-27.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-27.js @@ -10,22 +10,22 @@ description: > greater than number of parameters) ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === 11; - } else if (idx === 1) { - return val === 12; - } else if (idx === 2) { - return val === 9; - } else { - return false; - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 11; + } else if (idx === 1) { + return val === 12; + } else if (idx === 2) { + return val === 9; + } else { + return false; + } +} - var func = function (a, b) { - return Array.prototype.filter.call(arguments, callbackfn); - }; - var newArr = func(11, 12, 9); +var func = function(a, b) { + return Array.prototype.filter.call(arguments, callbackfn); +}; +var newArr = func(11, 12, 9); assert.sameValue(newArr.length, 3, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-28.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-28.js index 266d3eb37e4de55c5e3958806cfabd56c75f1ae6..28a3290dc420894e26611c1b8ca0f409ecbe6572 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-28.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-28.js @@ -9,32 +9,32 @@ description: > iterations is observed on an Array ---*/ - var preIterVisible = false; - var arr = []; +var preIterVisible = false; +var arr = []; - function callbackfn(val, idx, obj) { - return idx === 1 && val === 9; - } +function callbackfn(val, idx, obj) { + return idx === 1 && val === 9; +} - Object.defineProperty(arr, "0", { - get: function () { - preIterVisible = true; - return 11; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + preIterVisible = true; + return 11; + }, + configurable: true +}); - Object.defineProperty(arr, "1", { - get: function () { - if (preIterVisible) { - return 9; - } else { - return 11; - } - }, - configurable: true - }); - var newArr = arr.filter(callbackfn); +Object.defineProperty(arr, "1", { + get: function() { + if (preIterVisible) { + return 9; + } else { + return 11; + } + }, + configurable: true +}); +var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 9, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-29.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-29.js index 502971701589986e65d11e35798336aca7cdde39..f3cce11d79a4e6e6345ee5c4d089c83ed8b19beb 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-29.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-29.js @@ -9,32 +9,34 @@ description: > iterations is observed on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - return val === 9 && idx === 1; - } +function callbackfn(val, idx, obj) { + return val === 9 && idx === 1; +} - var preIterVisible = false; - var obj = { length: 2 }; +var preIterVisible = false; +var obj = { + length: 2 +}; - Object.defineProperty(obj, "0", { - get: function () { - preIterVisible = true; - return 11; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + preIterVisible = true; + return 11; + }, + configurable: true +}); - Object.defineProperty(obj, "1", { - get: function () { - if (preIterVisible) { - return 9; - } else { - return 13; - } - }, - configurable: true - }); - var newArr = Array.prototype.filter.call(obj, callbackfn); +Object.defineProperty(obj, "1", { + get: function() { + if (preIterVisible) { + return 9; + } else { + return 13; + } + }, + configurable: true +}); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 9, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-3.js index ce761b38f8b3890873fcfee09abc1a49412e73a9..1f6b1b8c15e225e172e3c5dddc0af40ae71d48b4 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-3.js @@ -10,20 +10,23 @@ description: > Array-like object ---*/ - function callbackfn(val, idx, obj) { - return (idx === 5) && (val === "abc"); - } +function callbackfn(val, idx, obj) { + return (idx === 5) && (val === "abc"); +} - var proto = { 0: 11, 5: 100 }; +var proto = { + 0: 11, + 5: 100 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[5] = "abc"; - child.length = 10; +var child = new Con(); +child[5] = "abc"; +child.length = 10; - var newArr = Array.prototype.filter.call(child, callbackfn); +var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], "abc", 'newArr[0]'); 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 150a4e013f457510d1e229361caa4f85dd77883d..01ffb99e019734100c3c8bdf6a328e4e6ae248de 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 @@ -9,22 +9,28 @@ description: > terminate iteration on an Array-like object ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - if (idx > 1) { - accessed = true; - } - return true; - } +var accessed = false; - var obj = { 0: 11, 5: 10, 10: 8, length: 20 }; - Object.defineProperty(obj, "1", { - get: function () { - throw new RangeError("unhandle exception happened in getter"); - }, - configurable: true - }); +function callbackfn(val, idx, obj) { + if (idx > 1) { + accessed = true; + } + return true; +} + +var obj = { + 0: 11, + 5: 10, + 10: 8, + length: 20 +}; +Object.defineProperty(obj, "1", { + get: function() { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true +}); assert.throws(RangeError, function() { - Array.prototype.filter.call(obj, callbackfn); + Array.prototype.filter.call(obj, callbackfn); }); 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 0eb4d2ecdcc3bf4d15ac43dedfdfb1a9d692f2f0..dc86f08484b219ce288d6372b8ee653e52c68e0a 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 @@ -9,25 +9,26 @@ description: > terminate iteration on an Array ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - if (idx > 1) { - accessed = true; - } - return true; - } +var accessed = false; - var arr = []; - arr[5] = 10; - arr[10] = 100; +function callbackfn(val, idx, obj) { + if (idx > 1) { + accessed = true; + } + return true; +} - Object.defineProperty(arr, "1", { - get: function () { - throw new RangeError("unhandle exception happened in getter"); - }, - configurable: true - }); +var arr = []; +arr[5] = 10; +arr[10] = 100; + +Object.defineProperty(arr, "1", { + get: function() { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true +}); assert.throws(RangeError, function() { - arr.filter(callbackfn); + arr.filter(callbackfn); }); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-4.js index 39f5a2af26d5d1f8eb2070b0e1ffde2eabcf7ad6..62273cdb99cd813d6c5c94ca3a796e987b5f7f7a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-4.js @@ -9,12 +9,12 @@ description: > property that overrides an inherited data property on an Array ---*/ - function callbackfn(val, idx, obj) { - return (idx === 0) && (val === 12); - } +function callbackfn(val, idx, obj) { + return (idx === 0) && (val === 12); +} - Array.prototype[0] = 11; - var newArr = [12].filter(callbackfn); +Array.prototype[0] = 11; +var newArr = [12].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 12, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-5.js index 43000dca2ef75a3d66225d314526db435cbb344b..7f694e9931c41a8a9fa853f1b19b9511704ea46e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-5.js @@ -10,31 +10,31 @@ description: > Array-like object ---*/ - function callbackfn(val, idx, obj) { - return idx === 0 && val === 11; - } - - var proto = {}; - - Object.defineProperty(proto, "0", { - get: function () { - return 5; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 2; - Object.defineProperty(child, "0", { - value: 11, - configurable: true - }); - child[1] = 12; - - var newArr = Array.prototype.filter.call(child, callbackfn); +function callbackfn(val, idx, obj) { + return idx === 0 && val === 11; +} + +var proto = {}; + +Object.defineProperty(proto, "0", { + get: function() { + return 5; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 2; +Object.defineProperty(child, "0", { + value: 11, + configurable: true +}); +child[1] = 12; + +var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-6.js index 18af4d7accf5ae4e75101a7f17d71997c8000ad6..17ead0e5789250210db4253ffc56316947acd681 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-6.js @@ -9,17 +9,17 @@ description: > property that overrides an inherited accessor property on an Array ---*/ - function callbackfn(val, idx, obj) { - return val === 11; - } +function callbackfn(val, idx, obj) { + return val === 11; +} - Object.defineProperty(Array.prototype, "0", { - get: function () { - return 9; - }, - configurable: true - }); - var newArr = [11].filter(callbackfn); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return 9; + }, + configurable: true +}); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-7.js index ec3284966ad3a1e3328455109d4e860168bebe4b..2f92dcd61239855f7d0a33ece7ca1ab89b5130c3 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-7.js @@ -9,21 +9,23 @@ description: > property on an Array-like object ---*/ - var kValue = 'abc'; +var kValue = 'abc'; - function callbackfn(val, idx, obj) { - return (idx === 5) && (val === kValue); - } +function callbackfn(val, idx, obj) { + return (idx === 5) && (val === kValue); +} - var proto = { 5: kValue }; +var proto = { + 5: kValue +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 10; +var child = new Con(); +child.length = 10; - var newArr = Array.prototype.filter.call(child, callbackfn); +var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], kValue, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-8.js index 3de54b2b264bd6e0e64393683028ab664a1e9c61..a263ceb340a0372b77c4eb9bb74bb320b62f1baf 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-8.js @@ -9,12 +9,12 @@ description: > property on an Array ---*/ - function callbackfn(val, idx, obj) { - return (idx === 1) && (val === 13); - } +function callbackfn(val, idx, obj) { + return (idx === 1) && (val === 13); +} - Array.prototype[1] = 13; - var newArr = [, , , ].filter(callbackfn); +Array.prototype[1] = 13; +var newArr = [, , , ].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 13, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-9.js index 3e729948689d05cf4b51cf562572d434099fa7bc..57aae11773cdc471db6b77b5a0bccdefd03f784a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-9.js @@ -9,20 +9,23 @@ description: > property on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - return (idx === 0) && (val === 11); - } +function callbackfn(val, idx, obj) { + return (idx === 0) && (val === 11); +} - var obj = { 10: 10, length: 20 }; +var obj = { + 10: 10, + length: 20 +}; - Object.defineProperty(obj, "0", { - get: function () { - return 11; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + return 11; + }, + configurable: true +}); - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-1.js index f635e683cd1d3b8f08da79217982ba149ecb615b..e29bab3358e8b7f1a8acc5f1f411caf8b979b39e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-1.js @@ -7,18 +7,19 @@ es5id: 15.4.4.20-9-c-ii-1 description: Array.prototype.filter - callbackfn called with correct parameters ---*/ - var bPar = true; - var bCalled = false; - function callbackfn(val, idx, obj) - { - bCalled = true; - if(obj[idx] !== val) - bPar = false; - } +var bPar = true; +var bCalled = false; - var srcArr = [0,1,true,null,new Object(),"five"]; - srcArr[999999] = -6.6; - var resArr = srcArr.filter(callbackfn); +function callbackfn(val, idx, obj) +{ + bCalled = true; + if (obj[idx] !== val) + bPar = false; +} + +var srcArr = [0, 1, true, null, new Object(), "five"]; +srcArr[999999] = -6.6; +var resArr = srcArr.filter(callbackfn); assert.sameValue(bCalled, true, 'bCalled'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-10.js index b7a6a8e0e5fcd3f88fb0f744ea5ec99811c968b2..67884f9e548f1be96697e6f1361e9d06386bda07 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-10.js @@ -9,10 +9,10 @@ description: > parameter ---*/ - function callbackfn(val) { - return val > 10; - } - var newArr = [12].filter(callbackfn); +function callbackfn(val) { + return val > 10; +} +var newArr = [12].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 12, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-11.js index 4f5cd0714c321135835d72fbed911b3a4134ce02..ca8ee655429054f47c252010fe91105c8cab2787 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-11.js @@ -9,10 +9,10 @@ description: > parameter ---*/ - function callbackfn(val, idx) { - return val > 10 && arguments[2][idx] === val; - } - var newArr = [11].filter(callbackfn); +function callbackfn(val, idx) { + return val > 10 && arguments[2][idx] === val; +} +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-12.js index 400d6ae8a1806fcbe80ca99e922aaf712f3ba146..8ef2009e4e1f513ebd286663e3981087ceb8255b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-12.js @@ -9,10 +9,10 @@ description: > parameter ---*/ - function callbackfn(val, idx, obj) { - return val > 10 && obj[idx] === val; - } - var newArr = [11].filter(callbackfn); +function callbackfn(val, idx, obj) { + return val > 10 && obj[idx] === val; +} +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-13.js index a51466ee68e1c5068b2f45e0b5a7bc49672b98af..59087549b96f9fb314c1486581307105437828a4 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-13.js @@ -9,10 +9,10 @@ description: > get parameter value ---*/ - function callbackfn() { - return arguments[2][arguments[1]] === arguments[0]; - } - var newArr = [11].filter(callbackfn); +function callbackfn() { + return arguments[2][arguments[1]] === arguments[0]; +} +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-16.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-16.js index 6b1ed02785ce16133f9d95183c4c9497878366cb..44dab44499b62431037a366850ab2cff8606da54 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-16.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-16.js @@ -9,12 +9,15 @@ description: > object when T is not an object (T is a boolean) ---*/ - function callbackfn(val, idx, obj) { - return this.valueOf() === false; - } +function callbackfn(val, idx, obj) { + return this.valueOf() === false; +} - var obj = { 0: 11, length: 2 }; - var newArr = Array.prototype.filter.call(obj, callbackfn, false); +var obj = { + 0: 11, + length: 2 +}; +var newArr = Array.prototype.filter.call(obj, callbackfn, false); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-17.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-17.js index 17022d9b26bd0da6d567b9de635bcf680d69019d..99a2bb143d4bacda064608af847e96f30586f0d9 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-17.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-17.js @@ -9,12 +9,15 @@ description: > when T is not an object (T is a number) ---*/ - function callbackfn(val, idx, o) { - return 5 === this.valueOf(); - } +function callbackfn(val, idx, o) { + return 5 === this.valueOf(); +} - var obj = { 0: 11, length: 2 }; - var newArr = Array.prototype.filter.call(obj, callbackfn, 5); +var obj = { + 0: 11, + length: 2 +}; +var newArr = Array.prototype.filter.call(obj, callbackfn, 5); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-18.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-18.js index bc7ae00991016750902642e75d22c402099e13ec..73ccf1d5fd0318e430e42920af766979079bb576 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-18.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-18.js @@ -9,12 +9,15 @@ description: > object when T is not an object (T is a string) ---*/ - function callbackfn(val, idx, obj) { - return 'hello' === this.valueOf(); - } +function callbackfn(val, idx, obj) { + return 'hello' === this.valueOf(); +} - var obj = { 0: 11, length: 2 }; - var newArr = Array.prototype.filter.call(obj, callbackfn, "hello"); +var obj = { + 0: 11, + length: 2 +}; +var newArr = Array.prototype.filter.call(obj, callbackfn, "hello"); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-19.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-19.js index 235694b2344dd036a27e27be04999d30876203de..b2ba6df2bc6dcfb258298b454dc053c31766d363 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-19.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-19.js @@ -7,15 +7,20 @@ es5id: 15.4.4.20-9-c-ii-19 description: Array.prototype.filter - non-indexed properties are not called ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val === 8; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val === 8; +} - var obj = { 0: 11, non_index_property: 8, 2: 5, length: 20 }; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var obj = { + 0: 11, + non_index_property: 8, + 2: 5, + length: 20 +}; +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-2.js index 52910ae39a76f9dc3943340c182e724648ab793c..208ff7aacc000f6e2c2769b9c3163524e4c62c00 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-2.js @@ -7,17 +7,18 @@ es5id: 15.4.4.20-9-c-ii-2 description: Array.prototype.filter - callbackfn takes 3 arguments ---*/ - var parCnt = 3; - var bCalled = false - function callbackfn(val, idx, obj) - { - bCalled = true; - if(arguments.length !== 3) - parCnt = arguments.length; //verify if callbackfn was called with 3 parameters - } +var parCnt = 3; +var bCalled = false - var srcArr = [0,1,2,3,4,5,6,7,8,9]; - var resArr = srcArr.filter(callbackfn); +function callbackfn(val, idx, obj) +{ + bCalled = true; + if (arguments.length !== 3) + parCnt = arguments.length; //verify if callbackfn was called with 3 parameters +} + +var srcArr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; +var resArr = srcArr.filter(callbackfn); assert.sameValue(bCalled, true, 'bCalled'); assert.sameValue(parCnt, 3, 'parCnt'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-20.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-20.js index fc145e2344990710dfa84d2ea2fbcb053bfdf740..645621f7e172d8e3b815b5ee72dc1013f929b6ac 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-20.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-20.js @@ -9,14 +9,19 @@ description: > (thisArg is correct) ---*/ - var thisArg = { threshold: 10 }; +var thisArg = { + threshold: 10 +}; - function callbackfn(val, idx, obj) { - return this === thisArg; - } +function callbackfn(val, idx, obj) { + return this === thisArg; +} - var obj = { 0: 11, length: 1 }; - var newArr = Array.prototype.filter.call(obj, callbackfn, thisArg); +var obj = { + 0: 11, + length: 1 +}; +var newArr = Array.prototype.filter.call(obj, callbackfn, thisArg); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-21.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-21.js index 1dd9e0853e0f6c9132baa12557cf930068f2631b..8c2b37645feeb7f31b3740cda6b63fc4e1f6a796 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-21.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-21.js @@ -9,20 +9,24 @@ description: > (kValue is correct) ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === 11; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 11; + } - if (idx === 1) { - return val === 12; - } + if (idx === 1) { + return val === 12; + } - return false; - } + return false; +} - var obj = { 0: 11, 1: 12, length: 2 }; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var obj = { + 0: 11, + 1: 12, + length: 2 +}; +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-22.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-22.js index 1976d0ab975ca523d0e8ffeed725dc83b5902fa7..d8f90cbda12b6b1fbda0d916c9b7600cb1aa2e8f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-22.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-22.js @@ -9,20 +9,24 @@ description: > (the index k is correct) ---*/ - function callbackfn(val, idx, obj) { - if (val === 11) { - return idx === 0; - } +function callbackfn(val, idx, obj) { + if (val === 11) { + return idx === 0; + } - if (val === 12) { - return idx === 1; - } + if (val === 12) { + return idx === 1; + } - return false; - } + return false; +} - var obj = { 0: 11, 1: 12, length: 2 }; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var obj = { + 0: 11, + 1: 12, + length: 2 +}; +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-23.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-23.js index cdb465ca3bb4579d2ccd76a21849dc4c0a7437f1..54813293c2cc099575af17ae108f37913c87174d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-23.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-23.js @@ -9,13 +9,16 @@ description: > (this object O is correct) ---*/ - var obj = { 0: 11, length: 2 }; +var obj = { + 0: 11, + length: 2 +}; - function callbackfn(val, idx, o) { - return obj === o; - } +function callbackfn(val, idx, o) { + return obj === o; +} - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-4.js index c9a7de747a647b6b2d555e74290b02c9c7f8ff9f..5b8e78643b00f48f45760f0f713bc03c485b3cc5 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-4.js @@ -9,18 +9,19 @@ description: > order ---*/ - var arr = [0, 1, 2, 3, 4, 5]; - var lastIdx = 0; - var called = 0; - function callbackfn(val, idx, o) { - called++; - if (lastIdx !== idx) { - return false; - } else { - lastIdx++; - return true; - } - } - var newArr = arr.filter(callbackfn); +var arr = [0, 1, 2, 3, 4, 5]; +var lastIdx = 0; +var called = 0; + +function callbackfn(val, idx, o) { + called++; + if (lastIdx !== idx) { + return false; + } else { + lastIdx++; + return true; + } +} +var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, called, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-5.js index dbf9d0d54710c6d2cfad02325fa8ff0e8b7d19d9..f0f5e5df9ca2d69f5bef86393197e61f1dae5273 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-5.js @@ -9,25 +9,25 @@ description: > iteration and not prior to starting the loop on an Array ---*/ - var kIndex = []; - var called = 0; +var kIndex = []; +var called = 0; - //By below way, we could verify that k would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time. - function callbackfn(val, idx, obj) { - called++; - //Each position should be visited one time, which means k is accessed one time during iterations. - if (kIndex[idx] === undefined) { - //when current position is visited, its previous index should has been visited. - if (idx !== 0 && kIndex[idx - 1] === undefined) { - return true; - } - kIndex[idx] = 1; - return false; - } else { - return true; - } - } - var newArr = [11, 12, 13, 14].filter(callbackfn, undefined); +//By below way, we could verify that k would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time. +function callbackfn(val, idx, obj) { + called++; + //Each position should be visited one time, which means k is accessed one time during iterations. + if (kIndex[idx] === undefined) { + //when current position is visited, its previous index should has been visited. + if (idx !== 0 && kIndex[idx - 1] === undefined) { + return true; + } + kIndex[idx] = 1; + return false; + } else { + return true; + } +} +var newArr = [11, 12, 13, 14].filter(callbackfn, undefined); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(called, 4, 'called'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-6.js index 6390d908cdcd5d7f25743eac98769480c050d8ff..ea27bcafed1c05f1c91f0ad597750f442913474f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-6.js @@ -9,17 +9,20 @@ description: > consistent ---*/ - var obj = { 0: 11, length: 1 }; - var thisArg = {}; +var obj = { + 0: 11, + length: 1 +}; +var thisArg = {}; - function callbackfn() { - return this === thisArg && - arguments[0] === 11 && - arguments[1] === 0 && - arguments[2] === obj; - } +function callbackfn() { + return this === thisArg && + arguments[0] === 11 && + arguments[1] === 0 && + arguments[2] === obj; +} - var newArr = Array.prototype.filter.call(obj, callbackfn, thisArg); +var newArr = Array.prototype.filter.call(obj, callbackfn, thisArg); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-7.js index 97dfb262b659b4a6a83fc5886fd517575e40f25b..68d53c92cdd21b03732274f3d9d2fa2379157054 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 @@ -9,18 +9,23 @@ description: > callbackfn terminate iteration ---*/ - var called = 0; +var called = 0; - function callbackfn(val, idx, obj) { - called++; - if (called === 1) { - throw new Error("Exception occurred in callbackfn"); - } - return true; - } +function callbackfn(val, idx, obj) { + called++; + if (called === 1) { + throw new Error("Exception occurred in callbackfn"); + } + return true; +} - var obj = { 0: 11, 4: 10, 10: 8, length: 20 }; +var obj = { + 0: 11, + 4: 10, + 10: 8, + length: 20 +}; assert.throws(Error, function() { - Array.prototype.filter.call(obj, callbackfn); + Array.prototype.filter.call(obj, callbackfn); }); assert.sameValue(called, 1, 'called'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-8.js index 6551c71dfecee69289f7870f8fb11ebbc2528503..6f93d5fee54049ceb9a976b481fe34919b255339 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-8.js @@ -9,16 +9,20 @@ description: > iterations is observed ---*/ - var obj = { 0: 11, 1: 12, length: 2 }; +var obj = { + 0: 11, + 1: 12, + length: 2 +}; - function callbackfn(val, idx, o) { - if (idx === 0) { - obj[idx + 1] = 8; - } - return val > 10; - } +function callbackfn(val, idx, o) { + if (idx === 0) { + obj[idx + 1] = 8; + } + return val > 10; +} - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-9.js index 0d6beb14789d4ce6ad9150d8e8001c6b3ee76f7f..382633547c66b99c14a11ada3e83921f4bdbfd49 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-9.js @@ -9,10 +9,10 @@ description: > parameter ---*/ - function callbackfn() { - return true; - } - var newArr = [11].filter(callbackfn); +function callbackfn() { + return true; +} +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-1.js index cf811e4dd9a467093beae651f6168c39e05ad656..32568ef97d19c1acf9861b292e98843ddff236b9 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-1.js @@ -9,12 +9,16 @@ description: > 'kValue' ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { 0: 11, 1: 9, length: 2 }; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var obj = { + 0: 11, + 1: 9, + length: 2 +}; +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr[0], obj[0], 'newArr[0]'); assert.sameValue(newArr[1], obj[1], 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-2.js index 8acc541e36c66b556034ad221cf1f68a32b7d476..3a9a1dfc01d7769ae601ad852c31511934eac058 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-2.js @@ -9,14 +9,18 @@ description: > overwritten ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { 0: 11, 1: 9, length: 2 }; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var obj = { + 0: 11, + 1: 9, + length: 2 +}; +var newArr = Array.prototype.filter.call(obj, callbackfn); - var tempVal = newArr[1]; - newArr[1] += 1; +var tempVal = newArr[1]; +newArr[1] += 1; assert.notSameValue(newArr[1], tempVal, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-3.js index c3d2d718d33933c63d72cef6812b9dcef2dd9abe..1b641737e9cba5972c2bfa4341f5e5f621c232b9 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-3.js @@ -9,21 +9,24 @@ description: > enumerated ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { 0: 11, length: 2 }; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var obj = { + 0: 11, + length: 2 +}; +var newArr = Array.prototype.filter.call(obj, callbackfn); - var prop; - var enumerable = false; - for (prop in newArr) { - if (newArr.hasOwnProperty(prop)) { - if (prop === "0") { - enumerable = true; - } - } - } +var prop; +var enumerable = false; +for (prop in newArr) { + if (newArr.hasOwnProperty(prop)) { + if (prop === "0") { + enumerable = true; + } + } +} assert(enumerable, 'enumerable !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-4.js index 43d859cc4fce9ed255922414e96dd6a1b914ddf8..18f72dd4c7cdf26c7f1aca5fc3ee113f12340dca 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-4.js @@ -9,15 +9,19 @@ description: > changed or deleted ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { 0: 11, 1: 9, length: 2 }; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var obj = { + 0: 11, + 1: 9, + length: 2 +}; +var newArr = Array.prototype.filter.call(obj, callbackfn); - var tempVal = newArr[1]; - delete newArr[1]; +var tempVal = newArr[1]; +delete newArr[1]; assert.notSameValue(tempVal, undefined, 'tempVal'); assert.sameValue(newArr[1], undefined, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-5.js index 010699ccf47eb06800bb85f62be028f029e1e34b..b5a88eb4b9afb95031b70209a84b4081362880d5 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-5.js @@ -9,19 +9,20 @@ description: > numeric order ---*/ - var arr = [0, 1, 2, 3, 4]; - var lastToIdx = 0; - var called = 0; - function callbackfn(val, idx, obj) { - called++; - if (lastToIdx !== idx) { - return false; - } else { - lastToIdx++; - return true; - } - } - var newArr = arr.filter(callbackfn); +var arr = [0, 1, 2, 3, 4]; +var lastToIdx = 0; +var called = 0; + +function callbackfn(val, idx, obj) { + called++; + if (lastToIdx !== idx) { + return false; + } else { + lastToIdx++; + return true; + } +} +var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 5, 'newArr.length'); assert.sameValue(called, 5, 'called'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-6.js index aaad13206c8d220b176861ccee881eb033f92c0d..8e9d64fc65db7305798f066a67786d75aea1de5a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-6.js @@ -10,25 +10,25 @@ description: > starting the loop ---*/ - var toIndex = []; - var called = 0; +var toIndex = []; +var called = 0; - //By below way, we could verify that 'to' would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time. - function callbackfn(val, idx, obj) { - called++; - //Each position should be visited one time, which means 'to' is accessed one time during iterations. - if (toIndex[idx] === undefined) { - //when current position is visited, its previous index should has been visited. - if (idx !== 0 && toIndex[idx - 1] === undefined) { - return false; - } - toIndex[idx] = 1; - return true; - } else { - return false; - } - } - var newArr = [11, 12, 13, 14].filter(callbackfn, undefined); +//By below way, we could verify that 'to' would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time. +function callbackfn(val, idx, obj) { + called++; + //Each position should be visited one time, which means 'to' is accessed one time during iterations. + if (toIndex[idx] === undefined) { + //when current position is visited, its previous index should has been visited. + if (idx !== 0 && toIndex[idx - 1] === undefined) { + return false; + } + toIndex[idx] = 1; + return true; + } else { + return false; + } +} +var newArr = [11, 12, 13, 14].filter(callbackfn, undefined); assert.sameValue(newArr.length, 4, 'newArr.length'); assert.sameValue(called, 4, 'called'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1.js index b6c6e6a61f3b9d452a02a06b13898c0d46dfe65f..b4090e61db625175571ff39b9f3ea527b2f5bb9c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1.js @@ -9,14 +9,14 @@ description: > returned array element ---*/ - function callbackfn(val, idx, obj){ - if(val % 2) - return true; - else - return false; - } - var srcArr = [0,1,2,3,4]; - var resArr = srcArr.filter(callbackfn); +function callbackfn(val, idx, obj) { + if (val % 2) + return true; + else + return false; +} +var srcArr = [0, 1, 2, 3, 4]; +var resArr = srcArr.filter(callbackfn); assert(resArr.length > 0, 'resArr.length > 0'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-10.js index 38b9c166b56eb092f8c90155721e5d3a32ecea7e..e0095481f7a937e11eb559711aba9f0b87300d05 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-10.js @@ -9,11 +9,11 @@ description: > (value is negative number) ---*/ - function callbackfn(val, idx, obj) { - return -5; - } +function callbackfn(val, idx, obj) { + return -5; +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-11.js index afdb35685994bafadd38662ff3ad0d3c192d884d..f1458a7ec5d33968f7461b97e024683713f339b0 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-11.js @@ -9,11 +9,11 @@ description: > (value is Infinity) ---*/ - function callbackfn(val, idx, obj) { - return Infinity; - } +function callbackfn(val, idx, obj) { + return Infinity; +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-12.js index 719ee9bc9eae58e73e00e9b2e0cbe5c7688de2e3..3187b31ed76794e2e6bb982a382742a85c809730 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-12.js @@ -9,11 +9,11 @@ description: > (value is -Infinity) ---*/ - function callbackfn(val, idx, obj) { - return -Infinity; - } +function callbackfn(val, idx, obj) { + return -Infinity; +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-13.js index e78a98f136b1bf64f3a11c6d45ee19d252a1390f..3af7abd329f7f6584ca572f39a756ee5c47a50c2 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-13.js @@ -9,14 +9,14 @@ description: > (value is NaN) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return NaN; - } +function callbackfn(val, idx, obj) { + accessed = true; + return NaN; +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-14.js index a9df829af6770a47c5b516179cbcb9d105f207fd..976eb524d941e682edb1be045a2e04ac49bf7a4d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-14.js @@ -9,14 +9,14 @@ description: > string ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return ""; - } +function callbackfn(val, idx, obj) { + accessed = true; + return ""; +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-15.js index c6cac3c3c83a5cdfd59f1a720405f548f15a8adc..46d3a541da773a2206a6ffcfe2e50479a51bdcc8 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-15.js @@ -9,11 +9,11 @@ description: > string ---*/ - function callbackfn(val, idx, obj) { - return "non-empty string"; - } +function callbackfn(val, idx, obj) { + return "non-empty string"; +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-16.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-16.js index 15d6f4194418b2cc30de9c7c44305fd72176ce56..9d61f23cf0f699088454e11de74ec3aad7e95662 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-16.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-16.js @@ -9,11 +9,11 @@ description: > object ---*/ - function callbackfn(val, idx, obj) { - return function () { }; - } +function callbackfn(val, idx, obj) { + return function() {}; +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-17.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-17.js index 4fa7e5e1e25a58cbd71b8325058cf5a93494a69c..e897b21bcc7fa59049790c2a9ce6b68bf049a84e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-17.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-17.js @@ -9,11 +9,11 @@ description: > object ---*/ - function callbackfn(val, idx, obj) { - return new Array(10); - } +function callbackfn(val, idx, obj) { + return new Array(10); +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-18.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-18.js index 46dad6dd0649dca0fc5f0d3c4a3df4c3704ed3af..71f79ca9e93e4d12cdecf2d565f9a65af7566ac1 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-18.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-18.js @@ -9,11 +9,11 @@ description: > object ---*/ - function callbackfn(val, idx, obj) { - return new String(); - } +function callbackfn(val, idx, obj) { + return new String(); +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-19.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-19.js index bd35cfb692e40b53474d1285cfa55ef3ba65ba06..0570144e92759139e67f67fcf16a00189fb55e1f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-19.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-19.js @@ -9,11 +9,11 @@ description: > object ---*/ - function callbackfn(val, idx, obj) { - return new Boolean(); - } +function callbackfn(val, idx, obj) { + return new Boolean(); +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-2.js index b0681bb102774f0153227ebd7aa55a25ec753c62..892a96c6b00c2eaae0affea52fe1327bcb795065 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-2.js @@ -7,16 +7,19 @@ es5id: 15.4.4.20-9-c-iii-2 description: Array.prototype.filter - return value of callbackfn is undefined ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, o) { - accessed = true; - return undefined; - } +function callbackfn(val, idx, o) { + accessed = true; + return undefined; +} - var obj = { 0: 11, length: 1 }; +var obj = { + 0: 11, + length: 1 +}; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-20.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-20.js index 8f3f5e55f4a7044d2288c78cc3f2c3bccc38cc2a..c5409a87e73034aac829d9bc1034888321dad2f1 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-20.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-20.js @@ -9,11 +9,11 @@ description: > object ---*/ - function callbackfn(val, idx, obj) { - return new Number(); - } +function callbackfn(val, idx, obj) { + return new Number(); +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-21.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-21.js index 5d91b294fc2920814174ef31253bd24a787d4000..80c3876c64cfcbabeedc6e25c167505fd25e43df 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-21.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-21.js @@ -9,11 +9,11 @@ description: > object ---*/ - function callbackfn(val, idx, obj) { - return Math; - } +function callbackfn(val, idx, obj) { + return Math; +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-22.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-22.js index 7825fe47ffc54d941c7d41e56305b3a3be2010dc..b9e29f24bb2738e43c4c0f90876154f14b915dc0 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-22.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-22.js @@ -9,11 +9,11 @@ description: > object ---*/ - function callbackfn(val, idx, obj) { - return new Date(); - } +function callbackfn(val, idx, obj) { + return new Date(); +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-23.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-23.js index 7fca3c93deb58cac466883e61ac48344e96b0472..69b2c2c72bced4e974bae82e7efe9d65c74d3fac 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-23.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-23.js @@ -9,11 +9,11 @@ description: > object ---*/ - function callbackfn(val, idx, obj) { - return new RegExp(); - } +function callbackfn(val, idx, obj) { + return new RegExp(); +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-24.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-24.js index 8f0a030c38485437e17d05b840f2f1f5c519e5ca..afd5e22348897ebb5a863069ca3bed945ab2522b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-24.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-24.js @@ -9,11 +9,11 @@ description: > object ---*/ - function callbackfn(val, idx, obj) { - return JSON; - } +function callbackfn(val, idx, obj) { + return JSON; +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-25.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-25.js index 57be04e13c9e90ddb819978144163856503b50bb..279fb2a4b38ab9246a7b50feda8cff598a324789 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-25.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-25.js @@ -9,11 +9,11 @@ description: > object ---*/ - function callbackfn(val, idx, obj) { - return new EvalError(); - } +function callbackfn(val, idx, obj) { + return new EvalError(); +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-26.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-26.js index 332a4c3a36eff758ccf9ec7be188a610663c70a1..25ec2c9fe85790c7ed70a76c97899851f5eb422f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-26.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-26.js @@ -9,11 +9,11 @@ description: > Arguments object ---*/ - function callbackfn(val, idx, obj) { - return arguments; - } +function callbackfn(val, idx, obj) { + return arguments; +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-28.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-28.js index a8d86ae226f000fb71959399e081f4f08844b555..7d02e8a477ff508235d9322b978bbad74bb6b23c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-28.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-28.js @@ -10,11 +10,12 @@ description: > ---*/ var global = this; - function callbackfn(val, idx, obj) { - return global; - } - var newArr = [11].filter(callbackfn); +function callbackfn(val, idx, obj) { + return global; +} + +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-29.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-29.js index a16c1a2dd7e3f19e0053931b0f5277adc8cfc83a..4184c13cfdd90adc78410669612356385d041ffb 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-29.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-29.js @@ -9,16 +9,20 @@ description: > Array ---*/ - var called = 0; +var called = 0; - function callbackfn(val, idx, obj) { - called++; - return val > 10; - } +function callbackfn(val, idx, obj) { + called++; + return val > 10; +} - var obj = { 0: 11, 1: 8, length: 20 }; +var obj = { + 0: 11, + 1: 8, + length: 20 +}; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.notSameValue(newArr[0], 8, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-3.js index 8c3fa9315ff1607c2d6ac35fe562966767dec400..f5d032d1c8538a58aa3a380d2c640442e52254b9 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-3.js @@ -7,16 +7,19 @@ es5id: 15.4.4.20-9-c-iii-3 description: Array.prototype.filter - return value of callbackfn is null ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return null; - } +function callbackfn(val, idx, obj) { + accessed = true; + return null; +} - var obj = { 0: 11, length: 1 }; +var obj = { + 0: 11, + length: 1 +}; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-30.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-30.js index 603c075672c674beec66b3b61449ac813b4dabbd..e21b710d61049f53424d31c7f2554bf99431242b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-30.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-30.js @@ -9,11 +9,11 @@ description: > callbackfn is treated as true value ---*/ - function callbackfn(val, idx, obj) { - return new Boolean(false); - } +function callbackfn(val, idx, obj) { + return new Boolean(false); +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-4.js index 957e1b506099223b8fd309bb6c9b7382e76cd92b..400819dc740ce47a7f608bdcc044b1b94432198c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-4.js @@ -9,16 +9,19 @@ description: > (value is false) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return false; - } +function callbackfn(val, idx, obj) { + accessed = true; + return false; +} - var obj = { 0: 11, length: 1 }; +var obj = { + 0: 11, + length: 1 +}; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-5.js index 3b3959c4f6285d8ffa084596070462547c2f910d..d33c906f24ac51dbe42dc18abe8ef83f60f0439c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-5.js @@ -9,13 +9,16 @@ description: > (value is true) ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { 0: 11, length: 1 }; +var obj = { + 0: 11, + length: 1 +}; - var newArr = Array.prototype.filter.call(obj, callbackfn); +var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-6.js index 59e225bab03587f4047802d3393d9b8d7932cd49..8cfdbcbfddb7a660ad614e8709d867df70deba6f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-6.js @@ -9,14 +9,14 @@ description: > (value is 0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return 0; - } +function callbackfn(val, idx, obj) { + accessed = true; + return 0; +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-7.js index 8b1efafcda11409f2193c1dacae7a37f33550ccd..766eb4034f9d494cdbe9dc75031a3893af5d5967 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-7.js @@ -9,14 +9,14 @@ description: > (value is +0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return +0; - } +function callbackfn(val, idx, obj) { + accessed = true; + return +0; +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-8.js index 3711ff9ef697eec2dec29aa2a1d3d7344af53cdd..ae10c8998be3da807430a71cf8cd171c9487f03c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-8.js @@ -9,14 +9,14 @@ description: > (value is -0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return -0; - } +function callbackfn(val, idx, obj) { + accessed = true; + return -0; +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-9.js index 33bd28e868d56da35d2c05d179d25241a423c9c2..c9f2d5772634e7788dd46a1b73ad49671e2ae7c8 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-9.js @@ -9,11 +9,11 @@ description: > (value is positive number) ---*/ - function callbackfn(val, idx, obj) { - return 5; - } +function callbackfn(val, idx, obj) { + return 5; +} - var newArr = [11].filter(callbackfn); +var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/create-ctor-non-object.js b/test/built-ins/Array/prototype/filter/create-ctor-non-object.js index 988fed039e0d84f48f73a684c2386e6b750b1930..e4f50c1cf0d10e9989261c82eb4fa8acef93f456 100644 --- a/test/built-ins/Array/prototype/filter/create-ctor-non-object.js +++ b/test/built-ins/Array/prototype/filter/create-ctor-non-object.js @@ -20,7 +20,9 @@ info: | var a = []; var callCount = 0; -var cb = function() { callCount += 0; }; +var cb = function() { + callCount += 0; +}; a.constructor = null; assert.throws(TypeError, function() { diff --git a/test/built-ins/Array/prototype/filter/create-ctor-poisoned.js b/test/built-ins/Array/prototype/filter/create-ctor-poisoned.js index a766e6896199237978844498079d47c027a32287..8dec316a7850da910e8657c632c360e8f0135074 100644 --- a/test/built-ins/Array/prototype/filter/create-ctor-poisoned.js +++ b/test/built-ins/Array/prototype/filter/create-ctor-poisoned.js @@ -17,7 +17,9 @@ info: | var a = []; var callCount = 0; -var cb = function() { callCount += 1; }; +var cb = function() { + callCount += 1; +}; Object.defineProperty(a, 'constructor', { get: function() { diff --git a/test/built-ins/Array/prototype/filter/create-non-array.js b/test/built-ins/Array/prototype/filter/create-non-array.js index 32ef7736f773fe34e89498327774ba2dc423f663..34c2a56a07b2dc0f99cf953db9e086ede973523d 100644 --- a/test/built-ins/Array/prototype/filter/create-non-array.js +++ b/test/built-ins/Array/prototype/filter/create-non-array.js @@ -16,7 +16,9 @@ info: | 4. If isArray is false, return ? ArrayCreate(length). ---*/ -var obj = { length: 0 }; +var obj = { + length: 0 +}; var callCount = 0; var result; Object.defineProperty(obj, 'constructor', { diff --git a/test/built-ins/Array/prototype/filter/create-revoked-proxy.js b/test/built-ins/Array/prototype/filter/create-revoked-proxy.js index aecf766f9ba45416c9e1f5a685701e54c10cbaec..3bdee5cd648682efd2ac309377fcc10651f9b259 100644 --- a/test/built-ins/Array/prototype/filter/create-revoked-proxy.js +++ b/test/built-ins/Array/prototype/filter/create-revoked-proxy.js @@ -26,7 +26,9 @@ features: [Proxy] var o = Proxy.revocable([], {}); var ctorCount = 0; var cbCount = 0; -var cb = function() { cbCount += 1; }; +var cb = function() { + cbCount += 1; +}; Object.defineProperty(o.proxy, 'constructor', { get: function() { diff --git a/test/built-ins/Array/prototype/filter/create-species-abrupt.js b/test/built-ins/Array/prototype/filter/create-species-abrupt.js index 42a4f2eda8a2de63c66ceb2a83bc4a0b6a56869b..4c461dd30f936c76455248db0aa4272c7b02313b 100644 --- a/test/built-ins/Array/prototype/filter/create-species-abrupt.js +++ b/test/built-ins/Array/prototype/filter/create-species-abrupt.js @@ -26,7 +26,9 @@ var Ctor = function() { throw new Test262Error(); }; var callCount = 0; -var cb = function() { callCount += 1; }; +var cb = function() { + callCount += 1; +}; var a = []; a.constructor = {}; a.constructor[Symbol.species] = Ctor; diff --git a/test/built-ins/Array/prototype/filter/create-species-non-ctor.js b/test/built-ins/Array/prototype/filter/create-species-non-ctor.js index cf5fba2ce8b89045b41ab77e88c40c01178911c4..890bf4d5216610aaf3efe8fcc9b3836a6e8f4879 100644 --- a/test/built-ins/Array/prototype/filter/create-species-non-ctor.js +++ b/test/built-ins/Array/prototype/filter/create-species-non-ctor.js @@ -25,7 +25,9 @@ features: [Symbol.species] var a = []; var callCount = 0; -var cb = function() { callCount += 1; }; +var cb = function() { + callCount += 1; +}; a.constructor = {}; a.constructor[Symbol.species] = parseInt; diff --git a/test/built-ins/Array/prototype/filter/create-species-poisoned.js b/test/built-ins/Array/prototype/filter/create-species-poisoned.js index 9edd338af7098b2c01a89f604be6182089c6deab..947e8f87014374728c111e51c81db10c177382f4 100644 --- a/test/built-ins/Array/prototype/filter/create-species-poisoned.js +++ b/test/built-ins/Array/prototype/filter/create-species-poisoned.js @@ -21,7 +21,9 @@ features: [Symbol.species] var a = []; var callCount = 0; -var cb = function() { callCount += 1; }; +var cb = function() { + callCount += 1; +}; a.constructor = {}; Object.defineProperty(a.constructor, Symbol.species, { diff --git a/test/built-ins/Array/prototype/find/return-found-value-predicate-result-is-true.js b/test/built-ins/Array/prototype/find/return-found-value-predicate-result-is-true.js index 073201a279c5a2caecc48ef193ed65a30a08dab0..16afbdf352837660221e59a6ed4a14b0ff28e29a 100644 --- a/test/built-ins/Array/prototype/find/return-found-value-predicate-result-is-true.js +++ b/test/built-ins/Array/prototype/find/return-found-value-predicate-result-is-true.js @@ -38,17 +38,27 @@ result = arr.find(function(val) { assert.sameValue(called, 3, 'predicate was called three times'); assert.sameValue(result, 'Bike'); -result = arr.find(function(val) { return 'string'; }); +result = arr.find(function(val) { + return 'string'; +}); assert.sameValue(result, 'Shoes', 'coerced string'); -result = arr.find(function(val) { return {}; }); +result = arr.find(function(val) { + return {}; +}); assert.sameValue(result, 'Shoes', 'coerced object'); -result = arr.find(function(val) { return Symbol(''); }); +result = arr.find(function(val) { + return Symbol(''); +}); assert.sameValue(result, 'Shoes', 'coerced Symbol'); -result = arr.find(function(val) { return 1; }); +result = arr.find(function(val) { + return 1; +}); assert.sameValue(result, 'Shoes', 'coerced number'); -result = arr.find(function(val) { return -1; }); +result = arr.find(function(val) { + return -1; +}); assert.sameValue(result, 'Shoes', 'coerced negative number'); diff --git a/test/built-ins/Array/prototype/find/return-undefined-if-predicate-returns-false-value.js b/test/built-ins/Array/prototype/find/return-undefined-if-predicate-returns-false-value.js index 65d471bac195df751cf6562cd6ba321a064505b1..0eb576508b5a4f59f2ed0bb04953a8d5db257d44 100644 --- a/test/built-ins/Array/prototype/find/return-undefined-if-predicate-returns-false-value.js +++ b/test/built-ins/Array/prototype/find/return-undefined-if-predicate-returns-false-value.js @@ -28,17 +28,27 @@ var result = arr.find(function(val) { assert.sameValue(called, 3, 'predicate was called three times'); assert.sameValue(result, undefined); -result = arr.find(function(val) { return ''; }); +result = arr.find(function(val) { + return ''; +}); assert.sameValue(result, undefined, 'coerced string'); -result = arr.find(function(val) { return undefined; }); +result = arr.find(function(val) { + return undefined; +}); assert.sameValue(result, undefined, 'coerced undefined'); -result = arr.find(function(val) { return null; }); +result = arr.find(function(val) { + return null; +}); assert.sameValue(result, undefined, 'coerced null'); -result = arr.find(function(val) { return 0; }); +result = arr.find(function(val) { + return 0; +}); assert.sameValue(result, undefined, 'coerced 0'); -result = arr.find(function(val) { return NaN; }); +result = arr.find(function(val) { + return NaN; +}); assert.sameValue(result, undefined, 'coerced NaN'); diff --git a/test/built-ins/Array/prototype/findIndex/return-index-predicate-result-is-true.js b/test/built-ins/Array/prototype/findIndex/return-index-predicate-result-is-true.js index f57d47aebc9a5640b91b4b7d7c4997f5153485ba..bddf1e3e4cda3910009827f1cc8356afc1c83a4f 100644 --- a/test/built-ins/Array/prototype/findIndex/return-index-predicate-result-is-true.js +++ b/test/built-ins/Array/prototype/findIndex/return-index-predicate-result-is-true.js @@ -38,17 +38,27 @@ result = arr.findIndex(function(val) { assert.sameValue(called, 3, 'predicate was called three times'); assert.sameValue(result, 2); -result = arr.findIndex(function(val) { return 'string'; }); +result = arr.findIndex(function(val) { + return 'string'; +}); assert.sameValue(result, 0, 'coerced string'); -result = arr.findIndex(function(val) { return {}; }); +result = arr.findIndex(function(val) { + return {}; +}); assert.sameValue(result, 0, 'coerced object'); -result = arr.findIndex(function(val) { return Symbol(''); }); +result = arr.findIndex(function(val) { + return Symbol(''); +}); assert.sameValue(result, 0, 'coerced Symbol'); -result = arr.findIndex(function(val) { return 1; }); +result = arr.findIndex(function(val) { + return 1; +}); assert.sameValue(result, 0, 'coerced number'); -result = arr.findIndex(function(val) { return -1; }); +result = arr.findIndex(function(val) { + return -1; +}); assert.sameValue(result, 0, 'coerced negative number'); diff --git a/test/built-ins/Array/prototype/findIndex/return-negative-one-if-predicate-returns-false-value.js b/test/built-ins/Array/prototype/findIndex/return-negative-one-if-predicate-returns-false-value.js index f5348ea596c090da837037c9ce3a4a73f24e03ac..b1e6eb76b7467232d9d6b1ff236b0af85d73e024 100644 --- a/test/built-ins/Array/prototype/findIndex/return-negative-one-if-predicate-returns-false-value.js +++ b/test/built-ins/Array/prototype/findIndex/return-negative-one-if-predicate-returns-false-value.js @@ -28,17 +28,27 @@ var result = arr.findIndex(function(val) { assert.sameValue(called, 3, 'predicate was called three times'); assert.sameValue(result, -1); -result = arr.findIndex(function(val) { return ''; }); +result = arr.findIndex(function(val) { + return ''; +}); assert.sameValue(result, -1, 'coerced string'); -result = arr.findIndex(function(val) { return undefined; }); +result = arr.findIndex(function(val) { + return undefined; +}); assert.sameValue(result, -1, 'coerced undefined'); -result = arr.findIndex(function(val) { return null; }); +result = arr.findIndex(function(val) { + return null; +}); assert.sameValue(result, -1, 'coerced null'); -result = arr.findIndex(function(val) { return 0; }); +result = arr.findIndex(function(val) { + return 0; +}); assert.sameValue(result, -1, 'coerced 0'); -result = arr.findIndex(function(val) { return NaN; }); +result = arr.findIndex(function(val) { + return NaN; +}); assert.sameValue(result, -1, 'coerced NaN'); diff --git a/test/built-ins/Array/prototype/flatMap/bound-function-argument.js b/test/built-ins/Array/prototype/flatMap/bound-function-argument.js index 95f5aeffe7ad41ac57d7a5df489f342af3d8a4a6..daa314115734b86a424be34d08bdc8c355638474 100644 --- a/test/built-ins/Array/prototype/flatMap/bound-function-argument.js +++ b/test/built-ins/Array/prototype/flatMap/bound-function-argument.js @@ -9,4 +9,6 @@ features: [Array.prototype.flatMap] ---*/ var a = [0, 0]; -assert.compareArray(a.flatMap(function(){ return this; }.bind([1, 2])), [1, 2, 1, 2]); +assert.compareArray(a.flatMap(function() { + return this; +}.bind([1, 2])), [1, 2, 1, 2]); diff --git a/test/built-ins/Array/prototype/flatMap/depth-always-one.js b/test/built-ins/Array/prototype/flatMap/depth-always-one.js index 851a9a74493307f0384e95d3d996e81e32183e43..4f5f672b484f133aeb01a3c5e4b1857fd9f84b93 100644 --- a/test/built-ins/Array/prototype/flatMap/depth-always-one.js +++ b/test/built-ins/Array/prototype/flatMap/depth-always-one.js @@ -13,7 +13,9 @@ assert.compareArray([1, 2].flatMap(function(e) { }), [1, 2, 2, 4], 'array depth is 1'); var result = [1, 2, 3].flatMap(function(ele) { - return [[ele * 2]]; + return [ + [ele * 2] + ]; }); assert.sameValue(result.length, 3, 'array depth is more than 1 - length'); assert.compareArray(result[0], [2], 'array depth is more than 1 - 1st element'); diff --git a/test/built-ins/Array/prototype/flatMap/non-callable-argument-throws.js b/test/built-ins/Array/prototype/flatMap/non-callable-argument-throws.js index 6d47d0233547094902d3ee1ef774cc5ca23d44b2..ab0f8ca86dc0e201c889ebb0c25fdea2b95eef7e 100644 --- a/test/built-ins/Array/prototype/flatMap/non-callable-argument-throws.js +++ b/test/built-ins/Array/prototype/flatMap/non-callable-argument-throws.js @@ -7,6 +7,6 @@ description: > features: [Array.prototype.flatMap] ---*/ -assert.throws(TypeError, function () { +assert.throws(TypeError, function() { [].flatMap({}); }, 'non callable argument'); diff --git a/test/built-ins/Array/prototype/flatMap/non-object-ctor-throws.js b/test/built-ins/Array/prototype/flatMap/non-object-ctor-throws.js index 21e44b6818612aa5dc983af54aea15bc0dce7e14..65767d2ce4de4d1e9c61491daf9e09cf0824172e 100644 --- a/test/built-ins/Array/prototype/flatMap/non-object-ctor-throws.js +++ b/test/built-ins/Array/prototype/flatMap/non-object-ctor-throws.js @@ -31,4 +31,3 @@ a.constructor = true; assert.throws(TypeError, function() { a.flatMap(); }, 'boolean value'); - diff --git a/test/built-ins/Array/prototype/flatMap/null-undefined-input-throws.js b/test/built-ins/Array/prototype/flatMap/null-undefined-input-throws.js index 5a4e966e25625fae3245897d023dbabf4257aadb..dcfe81aaf4a89134288272631f58841defb08e35 100644 --- a/test/built-ins/Array/prototype/flatMap/null-undefined-input-throws.js +++ b/test/built-ins/Array/prototype/flatMap/null-undefined-input-throws.js @@ -18,4 +18,3 @@ assert.throws(TypeError, function() { assert.throws(TypeError, function() { [].flatMap.call(void 0); }, 'undefined'); - diff --git a/test/built-ins/Array/prototype/flatMap/thisArg-argument.js b/test/built-ins/Array/prototype/flatMap/thisArg-argument.js index 95b95ca7a387b53847bd4334d9df923087f84882..34db60abdc847c87d660ce5650d9f029cec91086 100644 --- a/test/built-ins/Array/prototype/flatMap/thisArg-argument.js +++ b/test/built-ins/Array/prototype/flatMap/thisArg-argument.js @@ -12,9 +12,21 @@ features: [Array.prototype.flatMap] var a = {}; -assert(compareArray([1].flatMap(function() { return [this]; }, "TestString"), ["TestString"])); -assert(compareArray([1].flatMap(function() { return [this]; }, 1), [1])); -assert(compareArray([1].flatMap(function() { return [this]; }, null), [null])); -assert(compareArray([1].flatMap(function() { return [this]; }, true), [true])); -assert(compareArray([1].flatMap(function() { return [this]; }, a), [a])); -assert(compareArray([1].flatMap(function() { return [this]; }, void 0), [undefined])); +assert(compareArray([1].flatMap(function() { + return [this]; +}, "TestString"), ["TestString"])); +assert(compareArray([1].flatMap(function() { + return [this]; +}, 1), [1])); +assert(compareArray([1].flatMap(function() { + return [this]; +}, null), [null])); +assert(compareArray([1].flatMap(function() { + return [this]; +}, true), [true])); +assert(compareArray([1].flatMap(function() { + return [this]; +}, a), [a])); +assert(compareArray([1].flatMap(function() { + return [this]; +}, void 0), [undefined])); diff --git a/test/built-ins/Array/prototype/flatten/bound-function-call.js b/test/built-ins/Array/prototype/flatten/bound-function-call.js index ce4153b87cd0069ebe709c130f50ecc4f92423cc..fd35f0975f3a766daf04f67f3b75f8b19019d493 100644 --- a/test/built-ins/Array/prototype/flatten/bound-function-call.js +++ b/test/built-ins/Array/prototype/flatten/bound-function-call.js @@ -8,7 +8,10 @@ includes: [compareArray.js] features: [Array.prototype.flatten] ---*/ -var a = [[0],[1]]; +var a = [ + [0], + [1] +]; var actual = [].flatten.bind(a)(); assert.compareArray(actual, [0, 1], 'bound flatten'); diff --git a/test/built-ins/Array/prototype/flatten/empty-array-elements.js b/test/built-ins/Array/prototype/flatten/empty-array-elements.js index cbf2ae4b07b01ae22c8cd893998e25a702282da7..379b1e48cd87ef869ced614559cc815235347717 100644 --- a/test/built-ins/Array/prototype/flatten/empty-array-elements.js +++ b/test/built-ins/Array/prototype/flatten/empty-array-elements.js @@ -10,6 +10,15 @@ features: [Array.prototype.flatten] var a = {}; assert.compareArray([].flatten(), []); -assert.compareArray([[], []].flatten(), []); -assert.compareArray([[], [1]].flatten(), [1]); -assert.compareArray([[], [1, a]].flatten(), [1, a]); +assert.compareArray([ + [], + [] +].flatten(), []); +assert.compareArray([ + [], + [1] +].flatten(), [1]); +assert.compareArray([ + [], + [1, a] +].flatten(), [1, a]); diff --git a/test/built-ins/Array/prototype/flatten/empty-object-elements.js b/test/built-ins/Array/prototype/flatten/empty-object-elements.js index 356cab6606e3f34ac3728c49f5e4d66363b8c070..e1fcb18d31a4faa1c7b870fae04b64b1e0789f74 100644 --- a/test/built-ins/Array/prototype/flatten/empty-object-elements.js +++ b/test/built-ins/Array/prototype/flatten/empty-object-elements.js @@ -8,9 +8,15 @@ includes: [compareArray.js] features: [Array.prototype.flatten] ---*/ -var a = {}, b = {}; +var a = {}, + b = {}; assert.compareArray([a].flatten(), [a]); assert.compareArray([a, [b]].flatten(), [a, b]); -assert.compareArray([[a], b].flatten(), [a, b]); -assert.compareArray([[a], [b]].flatten(), [a, b]); +assert.compareArray([ + [a], b +].flatten(), [a, b]); +assert.compareArray([ + [a], + [b] +].flatten(), [a, b]); diff --git a/test/built-ins/Array/prototype/flatten/name.js b/test/built-ins/Array/prototype/flatten/name.js index 365c7e11cef4863b711666676f78ce73df3e234a..6d89ae6b7d016a47854ce9a15f98bd4c9c2aa091 100644 --- a/test/built-ins/Array/prototype/flatten/name.js +++ b/test/built-ins/Array/prototype/flatten/name.js @@ -18,4 +18,3 @@ assert.sameValue( verifyNotEnumerable(Array.prototype.flatten, 'name'); verifyNotWritable(Array.prototype.flatten, 'name'); verifyConfigurable(Array.prototype.flatten, 'name'); - diff --git a/test/built-ins/Array/prototype/flatten/null-undefined-elements.js b/test/built-ins/Array/prototype/flatten/null-undefined-elements.js index ef8fb3a53241f9209a133fb1079b99612eb2f121..8211fdcc28b5b6db36623f999b87b4368dfa71d3 100644 --- a/test/built-ins/Array/prototype/flatten/null-undefined-elements.js +++ b/test/built-ins/Array/prototype/flatten/null-undefined-elements.js @@ -11,7 +11,10 @@ features: [Array.prototype.flatten] var a = [void 0]; assert(compareArray([1, null, void 0].flatten(), [1, null, undefined])); -assert(compareArray([1,[null, void 0]].flatten(), [1, null, undefined])); -assert(compareArray([[null, void 0], [null, void 0]].flatten(), [null, undefined, null, undefined])); -assert(compareArray([1,[null, a]].flatten(1), [1, null, a])); -assert(compareArray([1,[null, a]].flatten(2), [1, null, undefined])); +assert(compareArray([1, [null, void 0]].flatten(), [1, null, undefined])); +assert(compareArray([ + [null, void 0], + [null, void 0] +].flatten(), [null, undefined, null, undefined])); +assert(compareArray([1, [null, a]].flatten(1), [1, null, a])); +assert(compareArray([1, [null, a]].flatten(2), [1, null, undefined])); diff --git a/test/built-ins/Array/prototype/flatten/null-undefined-input-throws.js b/test/built-ins/Array/prototype/flatten/null-undefined-input-throws.js index 3e711223f75bfd1d0d042ca6cdab0571c33a9c85..d3a5a59adc77b1c4c2bf30a14dbebf87a08a9585 100644 --- a/test/built-ins/Array/prototype/flatten/null-undefined-input-throws.js +++ b/test/built-ins/Array/prototype/flatten/null-undefined-input-throws.js @@ -18,4 +18,3 @@ assert.throws(TypeError, function() { assert.throws(TypeError, function() { [].flatten.call(void 0); }, 'undefined'); - diff --git a/test/built-ins/Array/prototype/flatten/symbol-object-create-null-depth-throws.js b/test/built-ins/Array/prototype/flatten/symbol-object-create-null-depth-throws.js index 9bcf98ae0c23a2b8366afbfd6b0a529580b13bd4..af58ce6b7d20662e512db629a36a98d1eda100b0 100644 --- a/test/built-ins/Array/prototype/flatten/symbol-object-create-null-depth-throws.js +++ b/test/built-ins/Array/prototype/flatten/symbol-object-create-null-depth-throws.js @@ -14,4 +14,3 @@ assert.throws(TypeError, function() { assert.throws(TypeError, function() { [].flatten(Object.create(null)); }, 'object create null'); - 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 1f7f8df82d0fdec0c30fc2969309f7cdf164e688..8e8bb700363bdc11291d8200cb5fc19224324b2a 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 @@ -9,5 +9,5 @@ description: Array.prototype.forEach applied to undefined assert.throws(TypeError, function() { - Array.prototype.forEach.call(undefined); // TypeError is thrown if value is undefined + Array.prototype.forEach.call(undefined); // TypeError is thrown if value is undefined }); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-10.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-10.js index e751161d6a2f19550e32341e85314b5edb173142..7ba92b9737e34f6f34f9f6d4cea02b3baf63ab24 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-10.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-10.js @@ -7,14 +7,14 @@ es5id: 15.4.4.18-1-10 description: Array.prototype.forEach applied to the Math object ---*/ - var result = false; +var result = false; - function callbackfn(val, idx, obj) { - result = ('[object Math]' === Object.prototype.toString.call(obj)); - } +function callbackfn(val, idx, obj) { + result = ('[object Math]' === Object.prototype.toString.call(obj)); +} - Math.length = 1; - Math[0] = 1; - Array.prototype.forEach.call(Math, callbackfn); +Math.length = 1; +Math[0] = 1; +Array.prototype.forEach.call(Math, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-11.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-11.js index 2ec98784d2edaec50d8d5ad1027955e40caf8f85..8d30c99daeb294f974e1851ccf3e87b8e0403a6b 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-11.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-11.js @@ -7,15 +7,16 @@ es5id: 15.4.4.18-1-11 description: Array.prototype.forEach applied to Date object ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = obj instanceof Date; - } +var result = false; - var obj = new Date(); - obj.length = 1; - obj[0] = 1; +function callbackfn(val, idx, obj) { + result = obj instanceof Date; +} - Array.prototype.forEach.call(obj, callbackfn); +var obj = new Date(); +obj.length = 1; +obj[0] = 1; + +Array.prototype.forEach.call(obj, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-12.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-12.js index 5e54175c65a61ab2af60d71d1feffa738f999e2c..c360a87716f2255df580b004ef0467aa530a5cdb 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-12.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-12.js @@ -7,15 +7,16 @@ es5id: 15.4.4.18-1-12 description: Array.prototype.forEach applied to RegExp object ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = obj instanceof RegExp; - } +var result = false; - var obj = new RegExp(); - obj.length = 1; - obj[0] = 1; +function callbackfn(val, idx, obj) { + result = obj instanceof RegExp; +} - Array.prototype.forEach.call(obj, callbackfn); +var obj = new RegExp(); +obj.length = 1; +obj[0] = 1; + +Array.prototype.forEach.call(obj, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-13.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-13.js index 70fc4362937c30a14e0e8a2200d47a4bdb9fe526..9759f019af4b49107ae7f45106992fd6ae89735b 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-13.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-13.js @@ -7,13 +7,14 @@ es5id: 15.4.4.18-1-13 description: Array.prototype.forEach applied to the JSON object ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = ('[object JSON]' === Object.prototype.toString.call(obj)); - } +var result = false; - JSON.length = 1; - JSON[0] = 1; - Array.prototype.forEach.call(JSON, callbackfn); +function callbackfn(val, idx, obj) { + result = ('[object JSON]' === Object.prototype.toString.call(obj)); +} + +JSON.length = 1; +JSON[0] = 1; +Array.prototype.forEach.call(JSON, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-14.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-14.js index b7a59755a57c5cd33334e67ab8c532a30448b8c8..e6c5caa104cdac2175466d11ce2e81dd98366b53 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-14.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-14.js @@ -7,15 +7,16 @@ es5id: 15.4.4.18-1-14 description: Array.prototype.forEach applied to Error object ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = obj instanceof Error; - } +var result = false; - var obj = new Error(); - obj.length = 1; - obj[0] = 1; +function callbackfn(val, idx, obj) { + result = obj instanceof Error; +} - Array.prototype.forEach.call(obj, callbackfn); +var obj = new Error(); +obj.length = 1; +obj[0] = 1; + +Array.prototype.forEach.call(obj, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-15.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-15.js index 6b9762524b8766c81142e0f9b2d98c515159c2a7..2ea3f1e44febd75fa33cddaf5d98d090e83375bd 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-15.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-15.js @@ -7,15 +7,16 @@ es5id: 15.4.4.18-1-15 description: Array.prototype.forEach applied to the Arguments object ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = ('[object Arguments]' === Object.prototype.toString.call(obj)); - } +var result = false; - var obj = (function () { - return arguments; - }("a", "b")); +function callbackfn(val, idx, obj) { + result = ('[object Arguments]' === Object.prototype.toString.call(obj)); +} - Array.prototype.forEach.call(obj, callbackfn); +var obj = (function() { + return arguments; +}("a", "b")); + +Array.prototype.forEach.call(obj, callbackfn); assert(result, 'result !== true'); 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 49ee29fb4010ab1bfdd74b7722a779940b73b0f4..bce24cc3fc17b037325ed17eddb66016b5469e02 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 @@ -9,5 +9,5 @@ description: Array.prototype.forEach applied to null assert.throws(TypeError, function() { - Array.prototype.forEach.call(null); // TypeError is thrown if value is null + Array.prototype.forEach.call(null); // TypeError is thrown if value is null }); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-3.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-3.js index fde0360220961f9c65d1ea52f04074f77000e3af..6434a1a5d5955b2d7fb5797981ef83a3e372603e 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-3.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-3.js @@ -7,15 +7,15 @@ es5id: 15.4.4.18-1-3 description: Array.prototype.forEach applied to boolean primitive ---*/ - var result = false; +var result = false; - function callbackfn(val, idx, obj) { - result = obj instanceof Boolean; - } +function callbackfn(val, idx, obj) { + result = obj instanceof Boolean; +} - Boolean.prototype[0] = true; - Boolean.prototype.length = 1; +Boolean.prototype[0] = true; +Boolean.prototype.length = 1; - Array.prototype.forEach.call(false, callbackfn); +Array.prototype.forEach.call(false, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-4.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-4.js index 899d60a7da0f7f929467e83aa9b6dc3c0125b4b2..87304f79b487a02083a46bd52549b2de42ebbb01 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-4.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-4.js @@ -7,16 +7,17 @@ es5id: 15.4.4.18-1-4 description: Array.prototype.forEach applied to Boolean object ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = obj instanceof Boolean; - } +var result = false; - var obj = new Boolean(true); - obj.length = 2; - obj[0] = 11; - obj[1] = 12; +function callbackfn(val, idx, obj) { + result = obj instanceof Boolean; +} - Array.prototype.forEach.call(obj, callbackfn); +var obj = new Boolean(true); +obj.length = 2; +obj[0] = 11; +obj[1] = 12; + +Array.prototype.forEach.call(obj, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-5.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-5.js index dbfdba7f9b60bc3337d1a0e011df68e1ad5d7f68..7afae81ba96b4cb85265fe0fe589ee5822fbca09 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-5.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-5.js @@ -7,14 +7,15 @@ es5id: 15.4.4.18-1-5 description: Array.prototype.forEach applied to number primitive ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = obj instanceof Number; - } +var result = false; - Number.prototype[0] = 1; - Number.prototype.length = 1; +function callbackfn(val, idx, obj) { + result = obj instanceof Number; +} - Array.prototype.forEach.call(2.5, callbackfn); +Number.prototype[0] = 1; +Number.prototype.length = 1; + +Array.prototype.forEach.call(2.5, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-6.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-6.js index a4417baced5d583905759158f2f54f55ee0cd918..8e33905dfb5bf6a2a361d32dea046d98a839adb2 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-6.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-6.js @@ -7,16 +7,17 @@ es5id: 15.4.4.18-1-6 description: Array.prototype.forEach applied to Number object ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = obj instanceof Number; - } +var result = false; - var obj = new Number(-128); - obj.length = 2; - obj[0] = 11; - obj[1] = 12; +function callbackfn(val, idx, obj) { + result = obj instanceof Number; +} - Array.prototype.forEach.call(obj, callbackfn); +var obj = new Number(-128); +obj.length = 2; +obj[0] = 11; +obj[1] = 12; + +Array.prototype.forEach.call(obj, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-7.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-7.js index c85736e356cdc259afbae2bea50efeda19acb8e2..7160b1c0484efb769d43b577158afbba63ffe121 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-7.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-7.js @@ -7,11 +7,12 @@ es5id: 15.4.4.18-1-7 description: Array.prototype.forEach applied to string primitive ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = obj instanceof String; - } +var result = false; - Array.prototype.forEach.call("abc", callbackfn); +function callbackfn(val, idx, obj) { + result = obj instanceof String; +} + +Array.prototype.forEach.call("abc", callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-8.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-8.js index 6aa6ade20149756d82a13565430616e7ed3d8618..3f2027f772d5a1668bcd0f2fa58bd10d722c155d 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-8.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-8.js @@ -7,12 +7,13 @@ es5id: 15.4.4.18-1-8 description: Array.prototype.forEach applied to String object ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = obj instanceof String; - } +var result = false; - var obj = new String("abc"); - Array.prototype.forEach.call(obj, callbackfn); +function callbackfn(val, idx, obj) { + result = obj instanceof String; +} + +var obj = new String("abc"); +Array.prototype.forEach.call(obj, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-9.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-9.js index 24024487f45388fd024ead61aaec0dd547ba8a52..38cd914432af5382db9056bc95e136c2dad5060a 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-9.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-9.js @@ -7,17 +7,18 @@ es5id: 15.4.4.18-1-9 description: Array.prototype.forEach applied to Function object ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = obj instanceof Function; - } +var result = false; - var obj = function (a, b) { - return a + b; - }; - obj[0] = 11; - obj[1] = 9; +function callbackfn(val, idx, obj) { + result = obj instanceof Function; +} - Array.prototype.forEach.call(obj, callbackfn); +var obj = function(a, b) { + return a + b; +}; +obj[0] = 11; +obj[1] = 9; + +Array.prototype.forEach.call(obj, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-1.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-1.js index a8cacea2b34029bcf111ed0607dcd46e494e4def..f6d82711cdffe5298f45ecf0645ea0ef88a3f3be 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-1.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-1.js @@ -9,18 +9,19 @@ description: > Array-like object ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = (obj.length === 2); - } +var result = false; - var obj = { - 0: 12, - 1: 11, - 2: 9, - length: 2 - }; +function callbackfn(val, idx, obj) { + result = (obj.length === 2); +} - Array.prototype.forEach.call(obj, callbackfn); +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: 2 +}; + +Array.prototype.forEach.call(obj, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-10.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-10.js index b62dda53caf99958ee4469b892b25839b7698d14..a4b5e78bbeab53aea87cf41063db1409b2f8e5c2 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-10.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-10.js @@ -9,28 +9,29 @@ description: > an inherited accessor property ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = (obj.length === 2); - } +var result = false; - var proto = {}; +function callbackfn(val, idx, obj) { + result = (obj.length === 2); +} - Object.defineProperty(proto, "length", { - get: function () { - return 2; - }, - configurable: true - }); +var proto = {}; - var Con = function () { }; - Con.prototype = proto; +Object.defineProperty(proto, "length", { + get: function() { + return 2; + }, + configurable: true +}); - var child = new Con(); - child[0] = 12; - child[1] = 11; - child[2] = 9; +var Con = function() {}; +Con.prototype = proto; - Array.prototype.forEach.call(child, callbackfn); +var child = new Con(); +child[0] = 12; +child[1] = 11; +child[2] = 9; + +Array.prototype.forEach.call(child, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-11.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-11.js index c28736d4581a56532eba3d1734ac389db07c9553..e9e36719e2f07552f8ded3ca86df936fd6f143b2 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-11.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-11.js @@ -9,20 +9,21 @@ description: > an own accessor property without a get function ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - } +var accessed = false; - var obj = { - 0: 11, - 1: 12 - }; - Object.defineProperty(obj, "length", { - set: function () { }, - configurable: true - }); +function callbackfn(val, idx, obj) { + accessed = true; +} - Array.prototype.forEach.call(obj, callbackfn); +var obj = { + 0: 11, + 1: 12 +}; +Object.defineProperty(obj, "length", { + set: function() {}, + configurable: true +}); + +Array.prototype.forEach.call(obj, callbackfn); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-12.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-12.js index c8649b335468b0ffe5a1f2ebc2fbaec2bde1131b..6bb1b8f12a004833580d53eb257285f5fe93ed27 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-12.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-12.js @@ -10,24 +10,28 @@ description: > property on an Array ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - } +var accessed = false; - Object.defineProperty(Object.prototype, "length", { - get: function () { - return 2; - }, - configurable: true - }); +function callbackfn(val, idx, obj) { + accessed = true; +} - var obj = { 0: 12, 1: 11 }; - Object.defineProperty(obj, "length", { - set: function () { }, - configurable: true - }); +Object.defineProperty(Object.prototype, "length", { + get: function() { + return 2; + }, + configurable: true +}); - Array.prototype.forEach.call(obj, callbackfn); +var obj = { + 0: 12, + 1: 11 +}; +Object.defineProperty(obj, "length", { + set: function() {}, + configurable: true +}); + +Array.prototype.forEach.call(obj, callbackfn); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-13.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-13.js index 200cd401c44ae13a5452cf3d218dde1402fd85f1..9dac1f4a26503727d018cce7d1e71dbb82cd0979 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-13.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-13.js @@ -9,25 +9,25 @@ description: > 'length' is inherited accessor property without a get function ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - } +function callbackfn(val, idx, obj) { + accessed = true; +} - var proto = {}; - Object.defineProperty(proto, "length", { - set: function () { }, - configurable: true - }); +var proto = {}; +Object.defineProperty(proto, "length", { + set: function() {}, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[0] = 11; - child[1] = 12; +var child = new Con(); +child[0] = 11; +child[1] = 12; - Array.prototype.forEach.call(child, callbackfn); +Array.prototype.forEach.call(child, callbackfn); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-14.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-14.js index a78c2fbdc878ddc57dcb4d54e5eb76d0520942f4..297cdf482c70ba4c88ca51cf2a1bfeabe30f64e2 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-14.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-14.js @@ -9,14 +9,17 @@ description: > 'length' property doesn't exist ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - } +function callbackfn(val, idx, obj) { + accessed = true; +} - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-17.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-17.js index 57e36efaa4b40b6e836b28b302f51881c52c9c0c..9f2cd87c73a24f9efbf4c1ef2efc61beb5d65a61 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-17.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-17.js @@ -9,15 +9,16 @@ description: > implements its own property get method ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = (obj.length === 2); - } +var result = false; - var func = function (a, b) { - arguments[2] = 9; - Array.prototype.forEach.call(arguments, callbackfn); - return result; - }; +function callbackfn(val, idx, obj) { + result = (obj.length === 2); +} + +var func = function(a, b) { + arguments[2] = 9; + Array.prototype.forEach.call(arguments, callbackfn); + return result; +}; assert(func(12, 11), 'func(12, 11) !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-18.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-18.js index 8089c6836868755a0a2cda94944fa49deb43247f..717904329a2a68fbb5195990f0570a3dc9c83f72 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-18.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-18.js @@ -9,13 +9,14 @@ description: > its own property get method ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = (obj.length === 3); - } +var result = false; - var str = new String("012"); +function callbackfn(val, idx, obj) { + result = (obj.length === 3); +} - Array.prototype.forEach.call(str, callbackfn); +var str = new String("012"); + +Array.prototype.forEach.call(str, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-19.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-19.js index da202f1588e9cef5247b45a2fb2a7978070e2651..200ad5818c455e34ee21a2adeb3ad74bafa92970 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-19.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-19.js @@ -9,18 +9,19 @@ description: > implements its own property get method ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = (obj.length === 2); - } +var result = false; - var fun = function (a, b) { - return a + b; - }; - fun[0] = 12; - fun[1] = 11; - fun[2] = 9; +function callbackfn(val, idx, obj) { + result = (obj.length === 2); +} - Array.prototype.forEach.call(fun, callbackfn); +var fun = function(a, b) { + return a + b; +}; +fun[0] = 12; +fun[1] = 11; +fun[2] = 9; + +Array.prototype.forEach.call(fun, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-2.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-2.js index 1f3da7255d9904237aae62945934314647901208..4f3c8f8c3b339aab75daf05c4889768ce97d6bc5 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-2.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-2.js @@ -7,11 +7,12 @@ es5id: 15.4.4.18-2-2 description: Array.prototype.forEach - 'length' is own data property on an Array ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = (obj.length === 2); - } +var result = false; - [12, 11].forEach(callbackfn); +function callbackfn(val, idx, obj) { + result = (obj.length === 2); +} + +[12, 11].forEach(callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-3.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-3.js index 3a70a3fa135d4dd6ba63d7de57f4954e7dcb297f..05c761a4f4147b1804396e14b8e778f9b3e8cdee 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-3.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-3.js @@ -9,22 +9,25 @@ description: > overrides an inherited data property on an Array-like object ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = (obj.length === 2); - } +var result = false; - var proto = { length: 3 }; +function callbackfn(val, idx, obj) { + result = (obj.length === 2); +} - var Con = function () { }; - Con.prototype = proto; +var proto = { + length: 3 +}; - var child = new Con(); - child.length = 2; - child[0] = 12; - child[1] = 11; - child[2] = 9; +var Con = function() {}; +Con.prototype = proto; - Array.prototype.forEach.call(child, callbackfn); +var child = new Con(); +child.length = 2; +child[0] = 12; +child[1] = 11; +child[2] = 9; + +Array.prototype.forEach.call(child, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-4.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-4.js index 4a5be142588b19b2c1b0d13fb300ce32688c5a26..9d522433395c8991e0074cebda094059f65d4aab 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-4.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-4.js @@ -9,14 +9,15 @@ description: > overrides an inherited data property on an Array ---*/ - var result = false; - var arrProtoLen; - function callbackfn(val, idx, obj) { - result = (obj.length === 2); - } +var result = false; +var arrProtoLen; - arrProtoLen = Array.prototype.length; - Array.prototype.length = 0; - [12, 11].forEach(callbackfn); +function callbackfn(val, idx, obj) { + result = (obj.length === 2); +} + +arrProtoLen = Array.prototype.length; +Array.prototype.length = 0; +[12, 11].forEach(callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-5.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-5.js index c261643e5ad09afe5e316c6171482c181012707d..21fd3b12c9d9feb0c85fa27ffea371168b18866f 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-5.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-5.js @@ -9,32 +9,33 @@ description: > an own data property that overrides an inherited accessor property ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = (obj.length === 2); - } - - var proto = {}; - - Object.defineProperty(proto, "length", { - get: function () { - return 3; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - Object.defineProperty(child, "length", { - value: 2, - configurable: true - }); - child[0] = 12; - child[1] = 11; - child[2] = 9; - - Array.prototype.forEach.call(child, callbackfn); +var result = false; + +function callbackfn(val, idx, obj) { + result = (obj.length === 2); +} + +var proto = {}; + +Object.defineProperty(proto, "length", { + get: function() { + return 3; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +Object.defineProperty(child, "length", { + value: 2, + configurable: true +}); +child[0] = 12; +child[1] = 11; +child[2] = 9; + +Array.prototype.forEach.call(child, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-6.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-6.js index e0ee2a2ed4e711251c37f6043de4fbfe1973da17..23627c89aad09949055f40d75fd64d07672ca686 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-6.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-6.js @@ -9,21 +9,24 @@ description: > an inherited data property ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = (obj.length === 2); - } +var result = false; - var proto = { length: 2 }; +function callbackfn(val, idx, obj) { + result = (obj.length === 2); +} - var Con = function () { }; - Con.prototype = proto; +var proto = { + length: 2 +}; - var child = new Con(); - child[0] = 12; - child[1] = 11; - child[2] = 9; +var Con = function() {}; +Con.prototype = proto; - Array.prototype.forEach.call(child, callbackfn); +var child = new Con(); +child[0] = 12; +child[1] = 11; +child[2] = 9; + +Array.prototype.forEach.call(child, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-7.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-7.js index e1fc969f4ac434887c4d98a946ddd5a7fabe5c07..2fb7ebdc3bb0ab62d216ae4f72fd5804a14f827d 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-7.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-7.js @@ -9,24 +9,25 @@ description: > an own accessor property ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = (obj.length === 2); - } +var result = false; - var obj = {}; +function callbackfn(val, idx, obj) { + result = (obj.length === 2); +} - Object.defineProperty(obj, "length", { - get: function () { - return 2; - }, - configurable: true - }); +var obj = {}; - obj[0] = 12; - obj[1] = 11; - obj[2] = 9; +Object.defineProperty(obj, "length", { + get: function() { + return 2; + }, + configurable: true +}); - Array.prototype.forEach.call(obj, callbackfn); +obj[0] = 12; +obj[1] = 11; +obj[2] = 9; + +Array.prototype.forEach.call(obj, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-8.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-8.js index e1da5228232dde3d89526d95f7ab28d4825cc77d..ee2588cd25905ac873617168c8528c8b8d60822a 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-8.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-8.js @@ -9,29 +9,32 @@ description: > an own accessor property that overrides an inherited data property ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = (obj.length === 2); - } +var result = false; - var proto = { length: 3 }; +function callbackfn(val, idx, obj) { + result = (obj.length === 2); +} - var Con = function () { }; - Con.prototype = proto; +var proto = { + length: 3 +}; - var child = new Con(); +var Con = function() {}; +Con.prototype = proto; - Object.defineProperty(child, "length", { - get: function () { - return 2; - }, - configurable: true - }); +var child = new Con(); - child[0] = 12; - child[1] = 11; - child[2] = 9; +Object.defineProperty(child, "length", { + get: function() { + return 2; + }, + configurable: true +}); - Array.prototype.forEach.call(child, callbackfn); +child[0] = 12; +child[1] = 11; +child[2] = 9; + +Array.prototype.forEach.call(child, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-9.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-9.js index 0b8017b05aaaa3d406492a2415c4b7c2917d7b70..98f607595825f114d5295651e67b60a5c0b2a01f 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-9.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-9.js @@ -10,36 +10,37 @@ description: > property ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = (obj.length === 2); - } +var result = false; - var proto = {}; +function callbackfn(val, idx, obj) { + result = (obj.length === 2); +} - Object.defineProperty(proto, "length", { - get: function () { - return 3; - }, - configurable: true - }); +var proto = {}; - var Con = function () { }; - Con.prototype = proto; +Object.defineProperty(proto, "length", { + get: function() { + return 3; + }, + configurable: true +}); - var child = new Con(); +var Con = function() {}; +Con.prototype = proto; - Object.defineProperty(child, "length", { - get: function () { - return 2; - }, - configurable: true - }); +var child = new Con(); - child[0] = 12; - child[1] = 11; - child[2] = 9; +Object.defineProperty(child, "length", { + get: function() { + return 2; + }, + configurable: true +}); - Array.prototype.forEach.call(child, callbackfn); +child[0] = 12; +child[1] = 11; +child[2] = 9; + +Array.prototype.forEach.call(child, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-1.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-1.js index 29126acb2b0d427dff134aecccc5c37b951b8782..61853f5cadaa58bad3c730a0e8b45bcd81524c5b 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-1.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-1.js @@ -7,14 +7,18 @@ es5id: 15.4.4.18-3-1 description: Array.prototype.forEach - value of 'length' is undefined ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - } +function callbackfn(val, idx, obj) { + accessed = true; +} - var obj = { 0: 0, 1: 1, length: undefined }; +var obj = { + 0: 0, + 1: 1, + length: undefined +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-10.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-10.js index 1b5fdbcfc3bc88f91fca70b4e1ee97e82b14baac..b82073f6a8049e1185179c472430bb93ea484420 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-10.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-10.js @@ -9,14 +9,17 @@ description: > NaN) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - } +function callbackfn(val, idx, obj) { + accessed = true; +} - var obj = { 0: 9, length: NaN }; +var obj = { + 0: 9, + length: NaN +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-11.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-11.js index 5244023de7e0be6b2e7c2f19616076d9406fa097..cc8e8892cff198cc19f87266d6a6c9d12978ce92 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-11.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-11.js @@ -9,14 +9,18 @@ description: > positive number ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - testResult = (val > 10); - } +function callbackfn(val, idx, obj) { + testResult = (val > 10); +} - var obj = { 1: 11, 2: 9, length: "2" }; +var obj = { + 1: 11, + 2: 9, + length: "2" +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-12.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-12.js index f50bbdc552b6bedbdb580271e5593fdc8ce1b9c6..f08f896a2a40fbbdea86eb9bbd28beec4ca762b4 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-12.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-12.js @@ -9,14 +9,18 @@ description: > negative number ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - testResult = (val > 10); - } +function callbackfn(val, idx, obj) { + testResult = (val > 10); +} - var obj = { 1: 11, 2: 9, length: "-4294967294" }; +var obj = { + 1: 11, + 2: 9, + length: "-4294967294" +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert.sameValue(testResult, false, 'testResult'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-13.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-13.js index 80e34f71688a4aa20d9e42c3134528bd93f3e907..a5816b0ce32df471865d83e3c494f49ab58a1f5f 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-13.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-13.js @@ -9,13 +9,17 @@ description: > decimal number ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - testResult = (val > 10); - } - var obj = { 1: 11, 2: 9, length: "2.5" }; +function callbackfn(val, idx, obj) { + testResult = (val > 10); +} +var obj = { + 1: 11, + 2: 9, + length: "2.5" +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-14.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-14.js index 482c69d42cc931b8280c3c5aa06973cdb7faf05d..a3583896a2b56c3b28ac60f335402571932743f5 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-14.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-14.js @@ -7,14 +7,17 @@ es5id: 15.4.4.18-3-14 description: Array.prototype.forEach - 'length' is a string containing -Infinity ---*/ - var accessed2 = false; +var accessed2 = false; - function callbackfn2(val, idx, obj) { - accessed2 = true; - } +function callbackfn2(val, idx, obj) { + accessed2 = true; +} - var obj2 = { 0: 9, length: "-Infinity" }; +var obj2 = { + 0: 9, + length: "-Infinity" +}; - Array.prototype.forEach.call(obj2, callbackfn2); +Array.prototype.forEach.call(obj2, callbackfn2); assert.sameValue(accessed2, false, 'accessed2'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-15.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-15.js index 09b71e39165dc0a8aacf06644b3547890e6924b7..2fb4ad6e90f5bdfe0e48bd0b187ca9d84ca82d52 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-15.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-15.js @@ -9,14 +9,18 @@ description: > exponential number ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - testResult = (val > 10); - } +function callbackfn(val, idx, obj) { + testResult = (val > 10); +} - var obj = { 1: 11, 2: 9, length: "2E0" }; +var obj = { + 1: 11, + 2: 9, + length: "2E0" +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-16.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-16.js index e6f77c16a77ebe8feac48513a0bb1e97cd5ffe47..4395836822b4d5b736c7b8f1fd8023aff1566ec9 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-16.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-16.js @@ -9,14 +9,18 @@ description: > number ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - testResult = (val > 10); - } +function callbackfn(val, idx, obj) { + testResult = (val > 10); +} - var obj = { 1: 11, 2: 9, length: "0x0002" }; +var obj = { + 1: 11, + 2: 9, + length: "0x0002" +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-17.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-17.js index e8ca4bd505bd7b5aaf1ecf6608599d9257e1d9f8..acf6a235dd4d7452df30558d5677aa62fef0f4ca 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-17.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-17.js @@ -9,14 +9,18 @@ description: > with leading zeros ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - testResult = (val > 10); - } +function callbackfn(val, idx, obj) { + testResult = (val > 10); +} - var obj = { 1: 11, 2: 9, length: "0002.00" }; +var obj = { + 1: 11, + 2: 9, + length: "0002.00" +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-18.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-18.js index 7b47f80bafc074ccb3f95f8edf275adf5e039655..070a95aa45a3f2652e916a4bbf4ebc2dbb37db40 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-18.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-18.js @@ -9,14 +9,17 @@ description: > convert to a number ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - } +function callbackfn(val, idx, obj) { + accessed = true; +} - var obj = { 0: 9, length: "asdf!_" }; +var obj = { + 0: 9, + length: "asdf!_" +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-19.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-19.js index 953f8ef8b7398be57901a0214740881f5db596cb..1c162f9f26f1f3d689c1b81cead7f111006823bc 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-19.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-19.js @@ -9,22 +9,22 @@ description: > an own toString method. ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - testResult = (val > 10); - } +function callbackfn(val, idx, obj) { + testResult = (val > 10); +} - var obj = { - 1: 11, - 2: 9, - length: { - toString: function () { - return '2'; - } - } - }; +var obj = { + 1: 11, + 2: 9, + length: { + toString: function() { + return '2'; + } + } +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-2.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-2.js index 03e951271e1b4befac386465d3cc4d141cc2b1f6..5dfb9e78278a81afc1cf8c94b76f3c3604ccaaaf 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-2.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-2.js @@ -9,13 +9,18 @@ description: > true) ---*/ - var testResult = false; - function callbackfn(val, idx, obj) { - testResult = (val > 10); - } +var testResult = false; - var obj = { 0: 11, 1: 9, length: true }; +function callbackfn(val, idx, obj) { + testResult = (val > 10); +} - Array.prototype.forEach.call(obj, callbackfn); +var obj = { + 0: 11, + 1: 9, + length: true +}; + +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-20.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-20.js index 6a1fed479006da9dc074b9d87a1533f7245a0651..64304dc3fab9a4b0c0ac79d4f897fdfcc8cb22f6 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-20.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-20.js @@ -9,22 +9,22 @@ description: > an own valueOf method. ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - testResult = (val > 10); - } +function callbackfn(val, idx, obj) { + testResult = (val > 10); +} - var obj = { - 1: 11, - 2: 9, - length: { - valueOf: function () { - return 2; - } - } - }; +var obj = { + 1: 11, + 2: 9, + length: { + valueOf: function() { + return 2; + } + } +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-21.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-21.js index e2be7cdb69c92fb2f570316c2f72772c47c1ef85..94681a1400bfb24e2b67437eccc09cab1e8c34d4 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-21.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-21.js @@ -10,30 +10,30 @@ description: > returns a string ---*/ - var testResult = false; - var firstStepOccured = false; - var secondStepOccured = false; +var testResult = false; +var firstStepOccured = false; +var secondStepOccured = false; - function callbackfn(val, idx, obj) { - testResult = (val > 10); - } +function callbackfn(val, idx, obj) { + testResult = (val > 10); +} - var obj = { - 1: 11, - 2: 9, - length: { - valueOf: function () { - firstStepOccured = true; - return {}; - }, - toString: function () { - secondStepOccured = true; - return '2'; - } - } - }; +var obj = { + 1: 11, + 2: 9, + length: { + valueOf: function() { + firstStepOccured = true; + return {}; + }, + toString: function() { + secondStepOccured = true; + return '2'; + } + } +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); assert(firstStepOccured, 'firstStepOccured !== true'); 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 6298b50ef1bf5ef2ab02dca4f57e8bc3335dfeb7..1dada065048e5bdb01719143fe5c335244f4fe3e 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 @@ -10,30 +10,30 @@ description: > primitive values ---*/ - var accessed = false; - var firstStepOccured = false; - var secondStepOccured = false; +var accessed = false; +var firstStepOccured = false; +var secondStepOccured = false; - function callbackfn(val, idx, obj) { - accessed = true; - } +function callbackfn(val, idx, obj) { + accessed = true; +} - var obj = { - 1: 11, - 2: 12, +var obj = { + 1: 11, + 2: 12, - length: { - valueOf: function () { - firstStepOccured = true; - return {}; - }, - toString: function () { - secondStepOccured = true; - return {}; - } - } - }; + length: { + valueOf: function() { + firstStepOccured = true; + return {}; + }, + toString: function() { + secondStepOccured = true; + return {}; + } + } +}; assert.throws(TypeError, function() { - Array.prototype.forEach.call(obj, callbackfn); + Array.prototype.forEach.call(obj, callbackfn); }); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-23.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-23.js index cf7cb7b30d6a0b6e343f5e531045084ab2f2579c..d8cc31d6cca9dcce56d28873411f8724688a368d 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-23.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-23.js @@ -10,38 +10,38 @@ description: > methods ---*/ - var testResult = false; - var valueOfAccessed = false; - var toStringAccessed = false; - - function callbackfn(val, idx, obj) { - testResult = (val > 10); - } - - var proto = { - valueOf: function () { - valueOfAccessed = true; - return 2; - } - }; - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - - child.toString = function () { - toStringAccessed = true; - return '1'; - }; - - var obj = { - 1: 11, - 2: 9, - length: child - }; - - Array.prototype.forEach.call(obj, callbackfn); +var testResult = false; +var valueOfAccessed = false; +var toStringAccessed = false; + +function callbackfn(val, idx, obj) { + testResult = (val > 10); +} + +var proto = { + valueOf: function() { + valueOfAccessed = true; + return 2; + } +}; + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); + +child.toString = function() { + toStringAccessed = true; + return '1'; +}; + +var obj = { + 1: 11, + 2: 9, + length: child +}; + +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); assert(valueOfAccessed, 'valueOfAccessed !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-24.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-24.js index 770f80e021624ba4292955e404b99fd3bd8a83d1..fb2da44e17808d85257f3a33e2ba39bf64f363fd 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-24.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-24.js @@ -9,18 +9,18 @@ description: > non-integer, ensure truncation occurs in the proper direction ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - testResult = (val > 10); - } +function callbackfn(val, idx, obj) { + testResult = (val > 10); +} - var obj = { - 1: 11, - 2: 9, - length: 2.685 - }; +var obj = { + 1: 11, + 2: 9, + length: 2.685 +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-25.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-25.js index e855f28d66aef375b0657139d6124d56ef843b0b..c9e1809c7bb3c5c1fc7a7bfa87df1eb02741648e 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-25.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-25.js @@ -9,18 +9,18 @@ description: > non-integer ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - testResult = (val > 10); - } +function callbackfn(val, idx, obj) { + testResult = (val > 10); +} - var obj = { - 1: 11, - 2: 9, - length: -4294967294.5 - }; +var obj = { + 1: 11, + 2: 9, + length: -4294967294.5 +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert.sameValue(testResult, false, 'testResult'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-3.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-3.js index a98ea617683dcc833561787b9a519e88a92c7956..467960654c278d77b65014245ab5c1ba2a1e00bb 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-3.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-3.js @@ -9,14 +9,18 @@ description: > 0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - } +function callbackfn(val, idx, obj) { + accessed = true; +} - var obj = { 0: 1, 1: 1, length: 0 }; +var obj = { + 0: 1, + 1: 1, + length: 0 +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-4.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-4.js index dc457c42a69c0d4b93735c14b031ca0916a9b930..1ac3e8c0b5d9e9fe991e2a2b10d0c1613f3695e4 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-4.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-4.js @@ -9,14 +9,17 @@ description: > +0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - } +function callbackfn(val, idx, obj) { + accessed = true; +} - var obj = { 0: 11, length: +0 }; +var obj = { + 0: 11, + length: +0 +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-5.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-5.js index 50348c00a62b660a0c03f7c21e2921267e942324..d8caecc2e684c69f73e9170e9ff2990c5b346b38 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-5.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-5.js @@ -9,14 +9,17 @@ description: > -0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - } +function callbackfn(val, idx, obj) { + accessed = true; +} - var obj = { 0: 11, length: -0 }; +var obj = { + 0: 11, + length: -0 +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-6.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-6.js index 41701e6e57a8c8c09d746577a8d204fdb295f7c3..1197b48160eec4031b3493b56fa808716f7218ef 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-6.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-6.js @@ -9,14 +9,18 @@ description: > positive) ---*/ - var testResult1 = false; +var testResult1 = false; - function callbackfn(val, idx, obj) { - testResult1 = (val > 10); - } +function callbackfn(val, idx, obj) { + testResult1 = (val > 10); +} - var obj = { 1: 11, 2: 9, length: 2 }; +var obj = { + 1: 11, + 2: 9, + length: 2 +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(testResult1, 'testResult1 !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-7.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-7.js index 05ffaedf48ef8deaf44317e3fd4c2693b3e0b320..f3b859b9b0e0d2a4eae3cba5cae1b3b4609f2006 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-7.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-7.js @@ -9,14 +9,18 @@ description: > negative) ---*/ - var testResult1 = false; +var testResult1 = false; - function callbackfn(val, idx, obj) { - testResult1 = (val > 10); - } +function callbackfn(val, idx, obj) { + testResult1 = (val > 10); +} - var obj = { 1: 11, 2: 9, length: -4294967294 }; +var obj = { + 1: 11, + 2: 9, + length: -4294967294 +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert.sameValue(testResult1, false, 'testResult1'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-9.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-9.js index 300fd705ddf0ecb0e1226fc106256545389f1b6e..3d3468809e1a4dc38b11019b123127790da11354 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-3-9.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-3-9.js @@ -9,14 +9,17 @@ description: > -Infinity) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - } +function callbackfn(val, idx, obj) { + accessed = true; +} - var obj = { 0: 9, length: -Infinity }; +var obj = { + 0: 9, + length: -Infinity +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); 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 0c1e6e517ccc8ee3eb162b29e44d3c68cb2ebb0e..81f4d15b656cd9a586a10538fcc183ff61d769e9 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.18-4-1 description: Array.prototype.forEach throws TypeError if callbackfn is undefined ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.forEach(); + arr.forEach(); }); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-10.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-10.js index d9ef1c8081e96b7d06ae27d4c9aea748d7b83c13..0dad22c77cdb310a4bd356c9301df78338bb1dfe 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-10.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-10.js @@ -9,15 +9,18 @@ description: > was thrown by step 2 ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - Object.defineProperty(obj, "length", { - get: function () { - throw new Test262Error(); - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + throw new Test262Error(); + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.forEach.call(obj, undefined); + Array.prototype.forEach.call(obj, undefined); }); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-11.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-11.js index 2ae6d34613accbbfd7543d5e01aa307c960bf89d..0a9bca0128260d56910158d5de22d74296679172 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-11.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-11.js @@ -9,19 +9,22 @@ description: > was thrown by step 3 ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - throw new Test262Error(); - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + throw new Test262Error(); + } + }; + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.forEach.call(obj, undefined); + Array.prototype.forEach.call(obj, undefined); }); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-12.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-12.js index 69581f68ec145e5b8f61684ddc1bdc9501bb5369..8bc18df1e510fdf30680745c26baf93a38fca72c 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-12.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-12.js @@ -7,11 +7,12 @@ es5id: 15.4.4.18-4-12 description: Array.prototype.forEach - 'callbackfn' is a function ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - } +var accessed = false; - [11, 9].forEach(callbackfn); +function callbackfn(val, idx, obj) { + accessed = true; +} + +[11, 9].forEach(callbackfn); assert(accessed, 'accessed !== true'); 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 1d94ede8a98344accac647401b229f72d4d0a7d5..09b8a247d73a3396bdd6b44d3406d93089afd59f 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 @@ -9,27 +9,29 @@ description: > as passing undefined for callbackfn ---*/ - var obj = { 10: 10 }; - var lengthAccessed = false; - var loopAccessed = false; +var obj = { + 10: 10 +}; +var lengthAccessed = false; +var loopAccessed = false; - Object.defineProperty(obj, "length", { - get: function () { - lengthAccessed = true; - return 20; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + lengthAccessed = true; + return 20; + }, + configurable: true +}); - Object.defineProperty(obj, "0", { - get: function () { - loopAccessed = true; - return 10; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + loopAccessed = true; + return 10; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.forEach.call(obj); + Array.prototype.forEach.call(obj); }); 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 b3f465b7970d28bf1a86f713d5787df764bd2792..a26b2ea39fc909c1d7ba0d924e4117ec61675a4e 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 @@ -9,7 +9,7 @@ description: > unreferenced ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(ReferenceError, function() { - arr.forEach(foo); + 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 b04887033387656227409d23673c0914088da320..81934e7ea4ca483933a32d8887ab2ee253e484ac 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.18-4-3 description: Array.prototype.forEach throws TypeError if callbackfn is null ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.forEach(null); + 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 b9a1d8952611b45ac283e3a689c8cab34915d722..399cdbf5b4d81c5e79f1b07997e721dfd619dd8c 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.18-4-4 description: Array.prototype.forEach throws TypeError if callbackfn is boolean ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.forEach(true); + 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 1ffe8b09462d87fc039fb10c8c9992ded6c7ef0a..866d6fddafea6be875a7aa10b0eb336df670b3f3 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.18-4-5 description: Array.prototype.forEach throws TypeError if callbackfn is number ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.forEach(5); + 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 146bb7df2d3a2f94d5883c5eb839cc8ab7d2490b..4cf36be9874e768fbe6c526c6bbeada85908cc4a 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.18-4-6 description: Array.prototype.forEach throws TypeError if callbackfn is string ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.forEach("abc"); + 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 93d142b9b61cd6d327bcb4fef406cf535e5cb436..3379dbe02e00b7e87ec614a8f7fb96fa851d1a63 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 @@ -9,7 +9,7 @@ description: > without Call internal method ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.forEach(new Object()); + 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 9ea17000ac1cfb4aea64a2b307432447ab7e9ec8..09f9862fefaf425c4f10775a21e4a6887503b588 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 @@ -9,18 +9,21 @@ description: > visible when an exception occurs ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - accessed = true; - return 2; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + accessed = true; + return 2; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.forEach.call(obj, null); + Array.prototype.forEach.call(obj, null); }); 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 8600794ddf5f95903e64b03138daa784bebefb38..75b0065b3207d45a3e81967e20daa7a03a7c6704 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 @@ -9,22 +9,25 @@ description: > visible when an exception occurs ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - accessed = true; - return "2"; - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + accessed = true; + return "2"; + } + }; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.forEach.call(obj, null); + Array.prototype.forEach.call(obj, null); }); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-1-s.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-1-s.js index 540b38d09d8a3ff19416e5a1d6210499db841c71..c4b4c0df4c133adb73cb4a8740d359f37d3a9ad8 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-1-s.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-1-s.js @@ -8,14 +8,14 @@ description: Array.prototype.forEach - thisArg not passed to strict callbackfn flags: [noStrict] ---*/ - var innerThisCorrect = false; +var innerThisCorrect = false; - function callbackfn(val, idx, obj) { - "use strict"; - innerThisCorrect = this===undefined; - return true; - } +function callbackfn(val, idx, obj) { + "use strict"; + innerThisCorrect = this === undefined; + return true; +} - [1].forEach(callbackfn); +[1].forEach(callbackfn); assert(innerThisCorrect, 'innerThisCorrect !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-1.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-1.js index ae937bd6ec3ea835e06c36e54397a1963f017ffe..6dd49f78f1cd64473f92105de2f1ccc51ed5b2b2 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-1.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-1.js @@ -9,14 +9,15 @@ flags: [noStrict] ---*/ (function() { - this._15_4_4_18_5_1 = false; - var _15_4_4_18_5_1 = true; - var result; - function callbackfn(val, idx, obj) { - result = this._15_4_4_18_5_1; - } - var arr = [1]; - arr.forEach(callbackfn) + this._15_4_4_18_5_1 = false; + var _15_4_4_18_5_1 = true; + var result; -assert.sameValue(result, false, 'result'); + function callbackfn(val, idx, obj) { + result = this._15_4_4_18_5_1; + } + var arr = [1]; + arr.forEach(callbackfn) + + assert.sameValue(result, false, 'result'); })(); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-10.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-10.js index 914cfafaebcc7f2297781bf0968dc13f28f015f9..771626914ada8ca8a69a5e95e72da11df94d3756 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-10.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-10.js @@ -7,13 +7,13 @@ es5id: 15.4.4.18-5-10 description: Array.prototype.forEach - Array Object can be used as thisArg ---*/ - var result = false; - var objArray = []; +var result = false; +var objArray = []; - function callbackfn(val, idx, obj) { - result = (this === objArray); - } +function callbackfn(val, idx, obj) { + result = (this === objArray); +} - [11].forEach(callbackfn, objArray); +[11].forEach(callbackfn, objArray); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-11.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-11.js index 0f0e203b3747af239a335838d24d8da3c280d87f..9975fe11c9c8090abe5c90b53db126e1d3efbcb7 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-11.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-11.js @@ -7,13 +7,13 @@ es5id: 15.4.4.18-5-11 description: Array.prototype.forEach - String Object can be used as thisArg ---*/ - var result = false; - var objString = new String(); +var result = false; +var objString = new String(); - function callbackfn(val, idx, obj) { - result = (this === objString); - } +function callbackfn(val, idx, obj) { + result = (this === objString); +} - [11].forEach(callbackfn, objString); +[11].forEach(callbackfn, objString); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-12.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-12.js index 76e1b95671ead1f0ed4265b6c668b90e5970149f..4aa627ea0cd7b5495d3bc71fbfbccfafdc939d1d 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-12.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-12.js @@ -7,13 +7,13 @@ es5id: 15.4.4.18-5-12 description: Array.prototype.forEach - Boolean Object can be used as thisArg ---*/ - var result = false; - var objBoolean = new Boolean(); +var result = false; +var objBoolean = new Boolean(); - function callbackfn(val, idx, obj) { - result = (this === objBoolean); - } +function callbackfn(val, idx, obj) { + result = (this === objBoolean); +} - [11].forEach(callbackfn, objBoolean); +[11].forEach(callbackfn, objBoolean); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-13.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-13.js index 7657769762bf4fb9e918eeee374dd5284147e1cf..0ca2d8c48e88039612990a8dc8f7db38944f3636 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-13.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-13.js @@ -7,13 +7,13 @@ es5id: 15.4.4.18-5-13 description: Array.prototype.forEach - Number Object can be used as thisArg ---*/ - var result = false; - var objNumber = new Number(); +var result = false; +var objNumber = new Number(); - function callbackfn(val, idx, obj) { - result = (this === objNumber); - } +function callbackfn(val, idx, obj) { + result = (this === objNumber); +} - [11].forEach(callbackfn, objNumber); +[11].forEach(callbackfn, objNumber); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-14.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-14.js index 9033553789bd754513bb79ccd94996ffff72a964..8c1b7fcd53ecb9387c1445135199de8fd8494acf 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-14.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-14.js @@ -7,11 +7,12 @@ es5id: 15.4.4.18-5-14 description: Array.prototype.forEach - the Math object can be used as thisArg ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = (this === Math); - } +var result = false; - [11].forEach(callbackfn, Math); +function callbackfn(val, idx, obj) { + result = (this === Math); +} + +[11].forEach(callbackfn, Math); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-15.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-15.js index d4154fead7f997f7b63f7cfa931f024ae19f08e0..8835b6bdcff4025c5366874f1979d8b3eb648037 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-15.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-15.js @@ -7,13 +7,13 @@ es5id: 15.4.4.18-5-15 description: Array.prototype.forEach - Date Object can be used as thisArg ---*/ - var result = false; - var objDate = new Date(); +var result = false; +var objDate = new Date(); - function callbackfn(val, idx, obj) { - result = (this === objDate); - } +function callbackfn(val, idx, obj) { + result = (this === objDate); +} - [11].forEach(callbackfn, objDate); +[11].forEach(callbackfn, objDate); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-16.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-16.js index 67f48ac06d259ea1c7171172b9a70f708235a816..a0f3cb83dd65b3cb365eb46b572ff6e4614a7c3d 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-16.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-16.js @@ -7,13 +7,13 @@ es5id: 15.4.4.18-5-16 description: Array.prototype.forEach - RegExp Object can be used as thisArg ---*/ - var result = false; - var objRegExp = new RegExp(); +var result = false; +var objRegExp = new RegExp(); - function callbackfn(val, idx, obj) { - result = (this === objRegExp); - } +function callbackfn(val, idx, obj) { + result = (this === objRegExp); +} - [11].forEach(callbackfn, objRegExp); +[11].forEach(callbackfn, objRegExp); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-17.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-17.js index 5d9ec5130ca41e84eee6b6a58c362fef02bc4a68..2aea48e64ea37409d507f4f53841bee369335f6e 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-17.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-17.js @@ -7,11 +7,12 @@ es5id: 15.4.4.18-5-17 description: Array.prototype.forEach - the JSON object can be used as thisArg ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = (this === JSON); - } +var result = false; - [11].forEach(callbackfn, JSON); +function callbackfn(val, idx, obj) { + result = (this === JSON); +} + +[11].forEach(callbackfn, JSON); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-18.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-18.js index 237bd7b389907771a255a22696e2eac7c958e8b9..84480af75fa921ec4cd743fb419930e4b0211b80 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-18.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-18.js @@ -7,13 +7,13 @@ es5id: 15.4.4.18-5-18 description: Array.prototype.forEach - Error Object can be used as thisArg ---*/ - var result = false; - var objError = new RangeError(); +var result = false; +var objError = new RangeError(); - function callbackfn(val, idx, obj) { - result = (this === objError); - } +function callbackfn(val, idx, obj) { + result = (this === objError); +} - [11].forEach(callbackfn, objError); +[11].forEach(callbackfn, objError); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-19.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-19.js index 0ffb3591d08d65a702077d1526a7e4acc8791fa1..cf428f4401bb760a2640395ea8e2eb5c374b48a9 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-19.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-19.js @@ -9,17 +9,17 @@ description: > thisArg ---*/ - var result = false; - var arg; +var result = false; +var arg; - function callbackfn(val, idx, obj) { - result = (this === arg); - } +function callbackfn(val, idx, obj) { + result = (this === arg); +} - (function fun() { - arg = arguments; - }(1, 2, 3)); +(function fun() { + arg = arguments; +}(1, 2, 3)); - [11].forEach(callbackfn, arg); +[11].forEach(callbackfn, arg); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-2.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-2.js index 194c4ed484d0978129d0182053e253920d63ca1e..7c62ee13dd3448ceb032555ac1bfbd03063f9588 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-2.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-2.js @@ -7,16 +7,17 @@ es5id: 15.4.4.18-5-2 description: Array.prototype.forEach - thisArg is Object ---*/ - var res = false; - var o = new Object(); - o.res = true; - var result; - function callbackfn(val, idx, obj) - { - result = this.res; - } +var res = false; +var o = new Object(); +o.res = true; +var result; - var arr = [1]; - arr.forEach(callbackfn,o) +function callbackfn(val, idx, obj) +{ + result = this.res; +} + +var arr = [1]; +arr.forEach(callbackfn, o) assert.sameValue(result, true, 'result'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-21.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-21.js index 3a3e5c9626739686f867ef65b1d43459c18b529f..19b8de2faae9dd80fcf2bdf841843a3e8ba93ba1 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-21.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-21.js @@ -8,11 +8,12 @@ description: Array.prototype.forEach - the global object can be used as thisArg ---*/ var global = this; - var result = false; - function callbackfn(val, idx, obj) { - result = (this === global); - } +var result = false; - [11].forEach(callbackfn, this); +function callbackfn(val, idx, obj) { + result = (this === global); +} + +[11].forEach(callbackfn, this); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-22.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-22.js index ae22b88b03eac460449f84118249d6394c9b1c22..22fe09f8eecd369a245eed67adb028c347bf4ba8 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-22.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-22.js @@ -7,12 +7,12 @@ es5id: 15.4.4.18-5-22 description: Array.prototype.forEach - boolean primitive can be used as thisArg ---*/ - var result = false; +var result = false; - function callbackfn(val, idx, obj) { - result = (this.valueOf() === false); - } +function callbackfn(val, idx, obj) { + result = (this.valueOf() === false); +} - [11].forEach(callbackfn, false); +[11].forEach(callbackfn, false); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-23.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-23.js index 5fc0674f06763471049dd3e4728626d5f2b97670..c74f302aa790995a963268063521cc720703f8a1 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-23.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-23.js @@ -7,11 +7,12 @@ es5id: 15.4.4.18-5-23 description: Array.prototype.forEach - number primitive can be used as thisArg ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = (this.valueOf() === 101); - } +var result = false; - [11].forEach(callbackfn, 101); +function callbackfn(val, idx, obj) { + result = (this.valueOf() === 101); +} + +[11].forEach(callbackfn, 101); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-24.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-24.js index 6b774576bce767193a74a0a642f46c9f8289d7e8..fc1c4fa6f952b90c3e13025b0eec7fa6cc1c808c 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-24.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-24.js @@ -7,11 +7,12 @@ es5id: 15.4.4.18-5-24 description: Array.prototype.forEach - string primitive can be used as thisArg ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = (this.valueOf() === "abc"); - } +var result = false; - [11].forEach(callbackfn, "abc"); +function callbackfn(val, idx, obj) { + result = (this.valueOf() === "abc"); +} + +[11].forEach(callbackfn, "abc"); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-25.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-25.js index f32dd6f8102c0fa48e07bb64ae6a367a9957274a..af345a918861ca0f4350708796832ac3174e349e 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-25.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-25.js @@ -8,16 +8,17 @@ description: Array.prototype.forEach - thisArg not passed flags: [noStrict] ---*/ - function innerObj() { - this._15_4_4_18_5_25 = true; - var _15_4_4_18_5_25 = false; - var result; - function callbackfn(val, idx, obj) { - result = this._15_4_4_18_5_25; - } - var arr = [1]; - arr.forEach(callbackfn) - this.retVal = !result; - } +function innerObj() { + this._15_4_4_18_5_25 = true; + var _15_4_4_18_5_25 = false; + var result; + + function callbackfn(val, idx, obj) { + result = this._15_4_4_18_5_25; + } + var arr = [1]; + arr.forEach(callbackfn) + this.retVal = !result; +} assert(new innerObj().retVal, 'new innerObj().retVal !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-3.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-3.js index 7ce819a4fcf131c35dd6f48bc8604f8002b5777b..738c6624f9d8b2bde2fd7bbd2ad433deec6705d1 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-3.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-3.js @@ -7,16 +7,17 @@ es5id: 15.4.4.18-5-3 description: Array.prototype.forEach - thisArg is Array ---*/ - var res = false; - var a = new Array(); - a.res = true; - var result; - function callbackfn(val, idx, obj) - { - result = this.res; - } +var res = false; +var a = new Array(); +a.res = true; +var result; - var arr = [1]; - arr.forEach(callbackfn,a) +function callbackfn(val, idx, obj) +{ + result = this.res; +} + +var arr = [1]; +arr.forEach(callbackfn, a) assert.sameValue(result, true, 'result'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-4.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-4.js index 211bafd486be6d05081669c8188ae94129b9bc07..6a88eded2ec9247f8e146948599583f927911dbe 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-4.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-4.js @@ -9,17 +9,18 @@ description: > template(prototype) ---*/ - var res = false; - var result; - function callbackfn(val, idx, obj) - { - result = this.res; - } +var res = false; +var result; - function foo(){} - foo.prototype.res = true; - var f = new foo(); - var arr = [1]; - arr.forEach(callbackfn,f) +function callbackfn(val, idx, obj) +{ + result = this.res; +} + +function foo() {} +foo.prototype.res = true; +var f = new foo(); +var arr = [1]; +arr.forEach(callbackfn, f) assert.sameValue(result, true, 'result'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-5.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-5.js index 3f3d7ba8cc55a78f32a2e085104812e490da3c50..eedf65b799e2f7500a7d1d6cc4a137c5c284d21c 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-5.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-5.js @@ -7,18 +7,19 @@ es5id: 15.4.4.18-5-5 description: Array.prototype.forEach - thisArg is object from object template ---*/ - var res = false; - var result; - function callbackfn(val, idx, obj) - { - result = this.res; - } +var res = false; +var result; - function foo(){} - var f = new foo(); - f.res = true; +function callbackfn(val, idx, obj) +{ + result = this.res; +} - var arr = [1]; - arr.forEach(callbackfn,f) +function foo() {} +var f = new foo(); +f.res = true; + +var arr = [1]; +arr.forEach(callbackfn, f) assert.sameValue(result, true, 'result'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-6.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-6.js index bcbb7bb55ce9aa9883b74a9f6b6feb03e4fd4f14..00e62309bea43952c72f342f54a596714db351a6 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-6.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-6.js @@ -7,17 +7,18 @@ es5id: 15.4.4.18-5-6 description: Array.prototype.forEach - thisArg is function ---*/ - var res = false; - var result; - function callbackfn(val, idx, obj) - { - result = this.res; - } +var res = false; +var result; - function foo(){} - foo.res = true; +function callbackfn(val, idx, obj) +{ + result = this.res; +} - var arr = [1]; - arr.forEach(callbackfn,foo) +function foo() {} +foo.res = true; + +var arr = [1]; +arr.forEach(callbackfn, foo) assert.sameValue(result, true, 'result'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-7.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-7.js index d7550402786448075d8e9ed28f3726221be36f6b..c5db1a536b614bd8dd7bbee7a63db618be78198c 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-7.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-7.js @@ -7,12 +7,12 @@ es5id: 15.4.4.18-5-7 description: Array.prototype.forEach - built-in functions can be used as thisArg ---*/ - var result = false; +var result = false; - function callbackfn(val, idx, obj) { - result = (this === eval); - } +function callbackfn(val, idx, obj) { + result = (this === eval); +} - [11].forEach(callbackfn, eval); +[11].forEach(callbackfn, eval); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-9.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-9.js index 81097bd2f0f919a4a442413eac2fef8899c7c403..9dede756a347beee69b5af1548f40fb3a269572c 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-9.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-9.js @@ -7,13 +7,13 @@ es5id: 15.4.4.18-5-9 description: Array.prototype.forEach - Function Object can be used as thisArg ---*/ - var result = false; - var objString = function () { }; +var result = false; +var objString = function() {}; - function callbackfn(val, idx, obj) { - result = (this === objString); - } +function callbackfn(val, idx, obj) { + result = (this === objString); +} - [11].forEach(callbackfn, objString); +[11].forEach(callbackfn, objString); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-1.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-1.js index 304a956838597b9361a6a28e7284d7a486c3e9a9..0ee2556d65cef5de403bf5433811615c77b86581 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-1.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-1.js @@ -9,15 +9,16 @@ description: > array after the call ---*/ - var callCnt = 0; - function callbackfn(val, idx, obj) - { - callCnt++; - arr[2] = 3; - arr[5] = 6; - } +var callCnt = 0; - var arr = [1,2,,4,5]; - arr.forEach(callbackfn); +function callbackfn(val, idx, obj) +{ + callCnt++; + arr[2] = 3; + arr[5] = 6; +} + +var arr = [1, 2, , 4, 5]; +arr.forEach(callbackfn); assert.sameValue(callCnt, 5, 'callCnt'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-2.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-2.js index 427fee6c85bada7802c99ad25a02339b28b06fa9..240795f062a5c5911eac95c09a5af44910befc1d 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-2.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-2.js @@ -9,15 +9,16 @@ description: > after the call ---*/ - var callCnt = 0; - function callbackfn(val, idx, obj) - { - if(callCnt == 0) - delete arr[3]; - callCnt++; - } +var callCnt = 0; - var arr = [1,2,3,4,5]; - arr.forEach(callbackfn) +function callbackfn(val, idx, obj) +{ + if (callCnt == 0) + delete arr[3]; + callCnt++; +} + +var arr = [1, 2, 3, 4, 5]; +arr.forEach(callbackfn) assert.sameValue(callCnt, 4, 'callCnt'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-3.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-3.js index c45a36fc089310e451e89fe945041571e55a35c3..d81ed613feec1e806b638883a5f8d1eb70f3a81e 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-3.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-3.js @@ -9,14 +9,15 @@ description: > Array.length is decreased ---*/ - var callCnt = 0; - function callbackfn(val, idx, obj) - { - arr.length=3; - callCnt++; - } +var callCnt = 0; - var arr = [1,2,3,4,5]; - arr.forEach(callbackfn); +function callbackfn(val, idx, obj) +{ + arr.length = 3; + callCnt++; +} + +var arr = [1, 2, 3, 4, 5]; +arr.forEach(callbackfn); assert.sameValue(callCnt, 3, 'callCnt'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-4.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-4.js index c178ead68286f89ab3400664213dbee6fbf7f220..96180c3ab70d873a82f62f6508ac0ab03fcfcf41 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-4.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-4.js @@ -9,16 +9,17 @@ description: > sparse array ---*/ - var callCnt = 0; - function callbackfn(val, idx, obj) - { - arr[1000] = 3; - callCnt++; - } +var callCnt = 0; - var arr = new Array(10); - arr[1] = 1; - arr[2] = 2; - arr.forEach(callbackfn); +function callbackfn(val, idx, obj) +{ + arr[1000] = 3; + callCnt++; +} + +var arr = new Array(10); +arr[1] = 1; +arr[2] = 2; +arr.forEach(callbackfn); assert.sameValue(callCnt, 2, 'callCnt'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-5.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-5.js index 71a7d7b939aa97d58deb044d97e08438d21cdaec..9c56fa65cfce9c5405461c449fdc99bbb90b0d23 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-5.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-5.js @@ -9,17 +9,18 @@ description: > call when same index is also present in prototype ---*/ - var callCnt = 0; - function callbackfn(val, idx, obj) - { - delete arr[4]; - callCnt++; - } +var callCnt = 0; - Array.prototype[4] = 5; +function callbackfn(val, idx, obj) +{ + delete arr[4]; + callCnt++; +} - var arr = [1,2,3,4,5]; - arr.forEach(callbackfn) - delete Array.prototype[4]; +Array.prototype[4] = 5; + +var arr = [1, 2, 3, 4, 5]; +arr.forEach(callbackfn) +delete Array.prototype[4]; assert.sameValue(callCnt, 5, 'callCnt'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-7.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-7.js index ba099415402bd94f3bedede9f3f6f8ae86e32c4d..eb8ad48c670b7a028d4b5a08073822e036c55767 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-7.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-7.js @@ -9,16 +9,16 @@ description: > after the call ---*/ - var result = false; - var arr = [1, 2, 3, 4, 5]; +var result = false; +var arr = [1, 2, 3, 4, 5]; - function callbackfn(val, Idx, obj) { - arr[4] = 6; - if (val >= 6) { - result = true; - } - } +function callbackfn(val, Idx, obj) { + arr[4] = 6; + if (val >= 6) { + result = true; + } +} - arr.forEach(callbackfn); +arr.forEach(callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-8.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-8.js index df0a1c9bc0f2000cadb4592488c4fc246b85ae24..8a2065833ac3ba36a056258971556aa09e866935 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-8.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-8.js @@ -7,14 +7,18 @@ es5id: 15.4.4.18-7-8 description: Array.prototype.forEach - no observable effects occur if len is 0 ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - } +function callbackfn(val, idx, obj) { + accessed = true; +} - var obj = { 0: 11, 1: 12, length: 0 }; +var obj = { + 0: 11, + 1: 12, + length: 0 +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-9.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-9.js index 1c9ab103775b845af627e5b5f08c0cb39d320150..361e22528558158aa65b5d78b33c161e10f5b8ac 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-9.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-9.js @@ -9,21 +9,26 @@ description: > number of iterations ---*/ - var called = 0; - function callbackfn(val, idx, obj) { - called++; - } +var called = 0; - var obj = { 1: 12, 2: 9, length: 2 }; +function callbackfn(val, idx, obj) { + called++; +} - Object.defineProperty(obj, "0", { - get: function () { - obj.length = 3; - return 11; - }, - configurable: true - }); +var obj = { + 1: 12, + 2: 9, + length: 2 +}; - Array.prototype.forEach.call(obj, callbackfn); +Object.defineProperty(obj, "0", { + get: function() { + obj.length = 3; + return 11; + }, + configurable: true +}); + +Array.prototype.forEach.call(obj, callbackfn); assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-1.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-1.js index 647090637124d904544c9d40ba85bc4817b9658e..ad7133ffb39d232e6c2476645327d8191c0a2d92 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-1.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-1.js @@ -9,14 +9,15 @@ description: > been assigned values ---*/ - var callCnt = 0; - function callbackfn(val, idx, obj) - { - callCnt++; - } +var callCnt = 0; - var arr = new Array(10); - arr[1] = undefined; - arr.forEach(callbackfn); +function callbackfn(val, idx, obj) +{ + callCnt++; +} + +var arr = new Array(10); +arr[1] = undefined; +arr.forEach(callbackfn); assert.sameValue(callCnt, 1, 'callCnt'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-10.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-10.js index 716fc69ff568d0ad88f0e23b79ca53cff9433c75..b3e6e5cc3dfee6fc9e60a96de63ad84766d5328b 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-10.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-10.js @@ -9,28 +9,31 @@ description: > prototype index property not to be visited on an Array-like Object ---*/ - var accessed = false; - var testResult = true; +var accessed = false; +var testResult = true; - function callbackfn(val, idx, obj) { - accessed = true; - if (idx === 3) { - testResult = false; - } - } +function callbackfn(val, idx, obj) { + accessed = true; + if (idx === 3) { + testResult = false; + } +} - var obj = { 2: 2, length: 20 }; +var obj = { + 2: 2, + length: 20 +}; - Object.defineProperty(obj, "0", { - get: function () { - delete Object.prototype[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + delete Object.prototype[1]; + return 0; + }, + configurable: true +}); - Object.prototype[1] = 1; - Array.prototype.forEach.call(obj, callbackfn); +Object.prototype[1] = 1; +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-11.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-11.js index e505e3d4dc5a892afa18c7a9a2b2fade2dc08ee9..5c7ee84f70387de56d3d31ac74ec323803d13ff5 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-11.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-11.js @@ -9,28 +9,28 @@ description: > prototype index property not to be visited on an Array ---*/ - var accessed = false; - var testResult = true; +var accessed = false; +var testResult = true; - function callbackfn(val, idx, obj) { - accessed = true; - if (idx === 1) { - testResult = false; - } - } +function callbackfn(val, idx, obj) { + accessed = true; + if (idx === 1) { + testResult = false; + } +} - var arr = [0, , ]; +var arr = [0, , ]; - Object.defineProperty(arr, "0", { - get: function () { - delete Array.prototype[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete Array.prototype[1]; + return 0; + }, + configurable: true +}); - Array.prototype[1] = 1; - arr.forEach(callbackfn); +Array.prototype[1] = 1; +arr.forEach(callbackfn); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-12.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-12.js index a9350d2996927787e404c6345c666af8c2532b69..a7de152f1154152bcc8df64645e7b7a745253497 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-12.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-12.js @@ -10,25 +10,29 @@ description: > Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 1) { - testResult = true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 1) { + testResult = true; + } +} - var obj = { 0: 0, 1: 111, length: 10 }; +var obj = { + 0: 0, + 1: 111, + length: 10 +}; - Object.defineProperty(obj, "0", { - get: function () { - delete obj[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + delete obj[1]; + return 0; + }, + configurable: true +}); - Object.prototype[1] = 1; - Array.prototype.forEach.call(obj, callbackfn); +Object.prototype[1] = 1; +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-13.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-13.js index b0b704f1a97283543e289727f436cb52025da999..ecc5607a50bbc7c3ceccba6513a073d05791b139 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-13.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-13.js @@ -9,24 +9,24 @@ description: > property causes prototype index property to be visited on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 1) { - testResult = true; - } - } - var arr = [0, 111]; +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 1) { + testResult = true; + } +} +var arr = [0, 111]; - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); - Array.prototype[1] = 1; - arr.forEach(callbackfn); +Array.prototype[1] = 1; +arr.forEach(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-14.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-14.js index 8106ac8ed81209db3cda883458e0cde269f45d16..8a09839a584e2773fd44ab255cbba2c0343f096a 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-14.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-14.js @@ -9,27 +9,27 @@ description: > property not to be visited ---*/ - var accessed = false; - var testResult = true; +var accessed = false; +var testResult = true; - function callbackfn(val, idx, obj) { - accessed = true; - if (idx === 3) { - testResult = false; - } - } +function callbackfn(val, idx, obj) { + accessed = true; + if (idx === 3) { + testResult = false; + } +} - var arr = [0, 1, 2, "last"]; +var arr = [0, 1, 2, "last"]; - Object.defineProperty(arr, "0", { - get: function () { - arr.length = 3; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + arr.length = 3; + return 0; + }, + configurable: true +}); - arr.forEach(callbackfn); +arr.forEach(callbackfn); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-15.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-15.js index 57a7cb646bed0749d8e87948c0948c3e6c5d6349..d92cf600a513b59b782119ce441b6c3ce71ae575 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-15.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-15.js @@ -9,30 +9,30 @@ description: > prototype property causes prototype index property to be visited ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 2 && val === "prototype") { - testResult = true; - } - } - var arr = [0, 1, 2]; +function callbackfn(val, idx, obj) { + if (idx === 2 && val === "prototype") { + testResult = true; + } +} +var arr = [0, 1, 2]; - Object.defineProperty(Array.prototype, "2", { - get: function () { - return "prototype"; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "2", { + get: function() { + return "prototype"; + }, + configurable: true +}); - Object.defineProperty(arr, "1", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); - arr.forEach(callbackfn); +arr.forEach(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-16.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-16.js index c337ed6a780e64b54caebc1e9d4f87479954d5c5..864b5aac6d6a25634ff554a50e8e557b22aa36a4 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-16.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-16.js @@ -10,31 +10,31 @@ description: > flags: [noStrict] ---*/ - var testResult = false; - - function callbackfn(val, idx, obj) { - if (idx === 2 && val === "unconfigurable") { - testResult = true; - } - } - - var arr = [0, 1, 2]; - - Object.defineProperty(arr, "2", { - get: function () { - return "unconfigurable"; - }, - configurable: false - }); - - Object.defineProperty(arr, "1", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); - - arr.forEach(callbackfn); +var testResult = false; + +function callbackfn(val, idx, obj) { + if (idx === 2 && val === "unconfigurable") { + testResult = true; + } +} + +var arr = [0, 1, 2]; + +Object.defineProperty(arr, "2", { + get: function() { + return "unconfigurable"; + }, + configurable: false +}); + +Object.defineProperty(arr, "1", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); + +arr.forEach(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-2.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-2.js index 4d1ba1c19e52bf9af622dc2f0b2cc4e04bf5957a..abc78638b8aca931d9a4425dba0d0831c987a6df 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-2.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-2.js @@ -9,24 +9,24 @@ description: > here ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 2 && val === "length") { - testResult = true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 2 && val === "length") { + testResult = true; + } +} - var obj = {}; +var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - obj[2] = "length"; - return 3; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + obj[2] = "length"; + return 3; + }, + configurable: true +}); - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-3.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-3.js index 71abd46a0f7f7305a54a355572b9aadc976ae455..d949efd18671b261544d0ec86d3a7a89df25622d 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-3.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-3.js @@ -9,26 +9,29 @@ description: > here ---*/ - var accessed = false; - var testResult = true; +var accessed = false; +var testResult = true; - function callbackfn(val, idx, obj) { - accessed = true; - if (idx === 8) { - testResult = false; - } - } - var obj = { 2: 6.99, 8: 19 }; +function callbackfn(val, idx, obj) { + accessed = true; + if (idx === 8) { + testResult = false; + } +} +var obj = { + 2: 6.99, + 8: 19 +}; - Object.defineProperty(obj, "length", { - get: function () { - delete obj[8]; - return 10; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + delete obj[8]; + return 10; + }, + configurable: true +}); - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-4.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-4.js index d9315e91dfa35786b7c8a9f154427322ac094264..af22a021966f2b55019ea96a399767300e654f4f 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-4.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-4.js @@ -9,29 +9,31 @@ description: > current position are visited on an Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 1) { - testResult = true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 1) { + testResult = true; + } +} - var obj = { length: 2 }; +var obj = { + length: 2 +}; - Object.defineProperty(obj, "0", { - get: function () { - Object.defineProperty(obj, "1", { - get: function () { - return 1; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + Object.defineProperty(obj, "1", { + get: function() { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-5.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-5.js index 0afda4bd38a30b4e80eba43fcf86cbdc2407a3b9..fda33ef758577a64a356858b5f9b3924bb086164 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-5.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-5.js @@ -9,29 +9,29 @@ description: > current position are visited on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 1) { - testResult = true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 1) { + testResult = true; + } +} - var arr = [0, , 2]; +var arr = [0, , 2]; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(arr, "1", { - get: function () { - return 1; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(arr, "1", { + get: function() { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - arr.forEach(callbackfn); +arr.forEach(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-6.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-6.js index a26a16afeed269dad88f31bfc109a266df28aebe..8e5262582f24e2d03cb0822802d6239c7631547c 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-6.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-6.js @@ -9,29 +9,31 @@ description: > after current position are visited on an Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 6.99) { - testResult = true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 6.99) { + testResult = true; + } +} - var obj = { length: 2 }; +var obj = { + length: 2 +}; - Object.defineProperty(obj, "0", { - get: function () { - Object.defineProperty(Object.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + Object.defineProperty(Object.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-7.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-7.js index 48619ba101f0b5f712108f6cf1372397d84eec16..11d9bd6ecf3807c6787b42896bc42515640ac86e 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-7.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-7.js @@ -9,29 +9,29 @@ description: > after current position are visited on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 6.99) { - testResult = true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 6.99) { + testResult = true; + } +} - var arr = [0, , 2]; +var arr = [0, , 2]; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(Array.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(Array.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - arr.forEach(callbackfn); +arr.forEach(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-8.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-8.js index d850238c62acb0fd462dd8ecfc25bdfdfa17f53c..0e7f8c30841bcb03ee8a91ddba05ee44f418beb4 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-8.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-8.js @@ -9,34 +9,36 @@ description: > property not to be visited on an Array-like object ---*/ - var accessed = false; - var testResult = true; - - function callbackfn(val, idx, obj) { - accessed = true; - if (idx === 1) { - testResult = false; - } - } - - var obj = { length: 2 }; - - Object.defineProperty(obj, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - - Object.defineProperty(obj, "0", { - get: function () { - delete obj[1]; - return 0; - }, - configurable: true - }); - - Array.prototype.forEach.call(obj, callbackfn); +var accessed = false; +var testResult = true; + +function callbackfn(val, idx, obj) { + accessed = true; + if (idx === 1) { + testResult = false; + } +} + +var obj = { + length: 2 +}; + +Object.defineProperty(obj, "1", { + get: function() { + return 6.99; + }, + configurable: true +}); + +Object.defineProperty(obj, "0", { + get: function() { + delete obj[1]; + return 0; + }, + configurable: true +}); + +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-9.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-9.js index b9fda4c355f838f16e66e2a6508a40390cbb64f4..aa579d22b935354b9aa5b33b238cfcaa3dd43018 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-9.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-9.js @@ -9,34 +9,34 @@ description: > property not to be visited on an Array ---*/ - var accessed = false; - var testResult = true; - - function callbackfn(val, idx, obj) { - accessed = true; - if (idx === 1) { - testResult = false; - } - } - - var arr = [1, 2]; - - Object.defineProperty(arr, "1", { - get: function () { - return "6.99"; - }, - configurable: true - }); - - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); - - arr.forEach(callbackfn); +var accessed = false; +var testResult = true; + +function callbackfn(val, idx, obj) { + accessed = true; + if (idx === 1) { + testResult = false; + } +} + +var arr = [1, 2]; + +Object.defineProperty(arr, "1", { + get: function() { + return "6.99"; + }, + configurable: true +}); + +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); + +arr.forEach(callbackfn); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-1.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-1.js index 8983f724e3d7524f7a201ed000b83c03e299bec2..4261196fb7f9f9b8c74ec2f3221a7e06d0a6d788 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-1.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-1.js @@ -9,17 +9,20 @@ description: > property on an Array-like object ---*/ - var kValue = { }; - var testResult = false; +var kValue = {}; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 5) { - testResult = (val === kValue); - } - } +function callbackfn(val, idx, obj) { + if (idx === 5) { + testResult = (val === kValue); + } +} - var obj = { 5: kValue, length: 100 }; +var obj = { + 5: kValue, + length: 100 +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-10.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-10.js index 4b6a3b8aa1ef669e8a6fd0bc18fa2f9d2005f570..1411c10bd442a8c794ce65b0eb47d82beaf83a2c 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-10.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-10.js @@ -9,23 +9,23 @@ description: > property on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 2) { - testResult = (val === 12); - } - } +function callbackfn(val, idx, obj) { + if (idx === 2) { + testResult = (val === 12); + } +} - var arr = []; +var arr = []; - Object.defineProperty(arr, "2", { - get: function () { - return 12; - }, - configurable: true - }); +Object.defineProperty(arr, "2", { + get: function() { + return 12; + }, + configurable: true +}); - arr.forEach(callbackfn); +arr.forEach(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-11.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-11.js index d886a548f3d623461a58b73f9f232328d6d71358..b313ad7c6a21afbc9d0e56806c9d39df3097ef2f 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-11.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-11.js @@ -10,29 +10,31 @@ description: > Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 0) { - testResult = (val === 11); - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 11); + } +} - var proto = { 0: 5 }; +var proto = { + 0: 5 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 10; +var child = new Con(); +child.length = 10; - Object.defineProperty(child, "0", { - get: function () { - return 11; - }, - configurable: true - }); +Object.defineProperty(child, "0", { + get: function() { + return 11; + }, + configurable: true +}); - Array.prototype.forEach.call(child, callbackfn); +Array.prototype.forEach.call(child, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-12.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-12.js index 8c97ccda436176e95f85fbca3004bf2e7e666fde..493e9632c4954a99e50aa95832a8a84e328a4280 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-12.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-12.js @@ -9,25 +9,25 @@ description: > property that overrides an inherited data property on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 0) { - testResult = (val === 111); - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 111); + } +} - var arr = []; +var arr = []; - Array.prototype[0] = 10; +Array.prototype[0] = 10; - Object.defineProperty(arr, "0", { - get: function () { - return 111; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + return 111; + }, + configurable: true +}); - arr.forEach(callbackfn); +arr.forEach(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-13.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-13.js index 5b5966bd869db15d8ecd62a6ca776113493ea522..c3d66f5f4b6b5b0e06a28413dce6a474fadf03dc 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-13.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-13.js @@ -10,37 +10,37 @@ description: > Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 1) { - testResult = (val === 12); - } - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + testResult = (val === 12); + } +} - var proto = {}; +var proto = {}; - Object.defineProperty(proto, "1", { - get: function () { - return 6; - }, - configurable: true - }); +Object.defineProperty(proto, "1", { + get: function() { + return 6; + }, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 10; +var child = new Con(); +child.length = 10; - Object.defineProperty(child, "1", { - get: function () { - return 12; - }, - configurable: true - }); +Object.defineProperty(child, "1", { + get: function() { + return 12; + }, + configurable: true +}); - Array.prototype.forEach.call(child, callbackfn); +Array.prototype.forEach.call(child, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-14.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-14.js index 8222ec722b3b2cad3ebcca657b5ae465a6898c63..e87ed433ee96bb246367fcb198553aac76a97287 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-14.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-14.js @@ -9,30 +9,30 @@ description: > property that overrides an inherited accessor property on an Array ---*/ - var testResult = false; - - function callbackfn(val, idx, obj) { - if (idx === 0) { - testResult = (val === 11); - } - } - - var arr = []; - - Object.defineProperty(Array.prototype, "0", { - get: function () { - return 5; - }, - configurable: true - }); - - Object.defineProperty(arr, "0", { - get: function () { - return 11; - }, - configurable: true - }); - - arr.forEach(callbackfn); +var testResult = false; + +function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 11); + } +} + +var arr = []; + +Object.defineProperty(Array.prototype, "0", { + get: function() { + return 5; + }, + configurable: true +}); + +Object.defineProperty(arr, "0", { + get: function() { + return 11; + }, + configurable: true +}); + +arr.forEach(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-15.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-15.js index 4782e16db370438a92345d74001a1f8df768adc0..5eebc81eabc8c4bd2591d8bf6f5744eda788543d 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-15.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-15.js @@ -9,29 +9,29 @@ description: > accessor property on an Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 1) { - testResult = (val === 11); - } - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + testResult = (val === 11); + } +} - var proto = {}; +var proto = {}; - Object.defineProperty(proto, "1", { - get: function () { - return 11; - }, - configurable: true - }); +Object.defineProperty(proto, "1", { + get: function() { + return 11; + }, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 20; +var child = new Con(); +child.length = 20; - Array.prototype.forEach.call(child, callbackfn); +Array.prototype.forEach.call(child, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-16.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-16.js index 5abba48e7c76012b6110046450da4edcc8ab5048..bf0c514cc6eb01a2fd0c951edd23675e9cd04c88 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-16.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-16.js @@ -9,21 +9,21 @@ description: > accessor property on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 0) { - testResult = (val === 11); - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 11); + } +} - Object.defineProperty(Array.prototype, "0", { - get: function () { - return 11; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return 11; + }, + configurable: true +}); - [, , , ].forEach(callbackfn); +[, , , ].forEach(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-17.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-17.js index a3258cbd51de0e431550d69953f92eab8e7ce42a..c63d80321cfebcfdb61b0a4c92bda22d1e1eadeb 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-17.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-17.js @@ -9,20 +9,22 @@ description: > property without a get function on an Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 1) { - testResult = (typeof val === "undefined"); - } - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + testResult = (typeof val === "undefined"); + } +} - var obj = { length: 2 }; - Object.defineProperty(obj, "1", { - set: function () { }, - configurable: true - }); +var obj = { + length: 2 +}; +Object.defineProperty(obj, "1", { + set: function() {}, + configurable: true +}); - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-18.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-18.js index a6a8df0775ad091d131ed31cd5156d1421f83c99..ae7114850f9b3b4556dce532e53db165ec7966c3 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-18.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-18.js @@ -9,21 +9,21 @@ description: > property without a get function on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 0) { - testResult = (typeof val === "undefined"); - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (typeof val === "undefined"); + } +} - var arr = []; +var arr = []; - Object.defineProperty(arr, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(arr, "0", { + set: function() {}, + configurable: true +}); - arr.forEach(callbackfn); +arr.forEach(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-19.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-19.js index 12b0e0f29b8e4169a1abbe296d57bb565c1a46de..2c1a00be6b789dc27f2e5b4d6df773a548cdfb67 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-19.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-19.js @@ -10,28 +10,30 @@ description: > accessor property on an Array-like object ---*/ - var testResult = false; - - function callbackfn(val, idx, obj) { - if (idx === 1) { - testResult = (typeof val === "undefined"); - } - } - - var obj = { length: 2 }; - - Object.defineProperty(obj, "1", { - set: function () { }, - configurable: true - }); - - Object.defineProperty(Object.prototype, "1", { - get: function () { - return 10; - }, - configurable: true - }); - - Array.prototype.forEach.call(obj, callbackfn); +var testResult = false; + +function callbackfn(val, idx, obj) { + if (idx === 1) { + testResult = (typeof val === "undefined"); + } +} + +var obj = { + length: 2 +}; + +Object.defineProperty(obj, "1", { + set: function() {}, + configurable: true +}); + +Object.defineProperty(Object.prototype, "1", { + get: function() { + return 10; + }, + configurable: true +}); + +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-2.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-2.js index 03ba5f4a12bcadbb145fc39362f94e8c7600866b..c5c0e5942926eb2a0100faa559fe62ed5b87364f 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-2.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-2.js @@ -9,14 +9,14 @@ description: > property on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 0) { - testResult = (val === 11); - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 11); + } +} - [11].forEach(callbackfn); +[11].forEach(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-20.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-20.js index 6bd5c5402acd6a5a70435ada26cf2bf29ad8fa0d..3d12eb66818c901db976fb21f9c071888cc9b1d0 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-20.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-20.js @@ -10,28 +10,28 @@ description: > accessor property on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 0) { - testResult = (typeof val === "undefined"); - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (typeof val === "undefined"); + } +} - var arr = []; +var arr = []; - Object.defineProperty(arr, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(arr, "0", { + set: function() {}, + configurable: true +}); - Object.defineProperty(Array.prototype, "0", { - get: function () { - return 100; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return 100; + }, + configurable: true +}); - arr.forEach(callbackfn); +arr.forEach(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-21.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-21.js index d952c57dc09e18df3a8d6336cfb53e7fb39ba623..a185cb0a02deb65c4b321e6f5b50dc1f0ba54f2d 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-21.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-21.js @@ -9,26 +9,26 @@ description: > accessor property without a get function on an Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 1) { - testResult = (typeof val === "undefined"); - } - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + testResult = (typeof val === "undefined"); + } +} - var proto = {}; - Object.defineProperty(proto, "1", { - set: function () { }, - configurable: true - }); +var proto = {}; +Object.defineProperty(proto, "1", { + set: function() {}, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 2; +var child = new Con(); +child.length = 2; - Array.prototype.forEach.call(child, callbackfn); +Array.prototype.forEach.call(child, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-22.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-22.js index baf2b2bcfe735b080614d6d668f09f236bd231f9..c3ccfca7b93483e983e2b53e5739e936da72e339 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-22.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-22.js @@ -9,19 +9,19 @@ description: > accessor property without a get function on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 0) { - testResult = (typeof val === "undefined"); - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (typeof val === "undefined"); + } +} - Object.defineProperty(Array.prototype, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + set: function() {}, + configurable: true +}); - [, 1].forEach(callbackfn); +[, 1].forEach(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-25.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-25.js index 51930b840f661afef9dd268e869a80d028df3078..7f192e129b2b4fbefea71f035a5d7387d1e44235 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-25.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-25.js @@ -10,18 +10,18 @@ description: > is less than number of parameters) ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 0) { - testResult = (val === 11); - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 11); + } +} - var func = function (a, b) { - return Array.prototype.forEach.call(arguments, callbackfn); - }; +var func = function(a, b) { + return Array.prototype.forEach.call(arguments, callbackfn); +}; - func(11); +func(11); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-26.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-26.js index 51aefae34ca2a404abb2613658c0146c20fdee76..22775361f3e9a049c730e76f3df573b9a4a5d497 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-26.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-26.js @@ -10,27 +10,27 @@ description: > equals number of parameters) ---*/ - var called = 0; - var testResult = false; +var called = 0; +var testResult = false; - function callbackfn(val, idx, obj) { - called++; - if (called !== 1 && !testResult) { - return; - } - if (idx === 0) { - testResult = (val === 11); - } else if (idx === 1) { - testResult = (val === 9); - } else { - testResult = false; - } - } +function callbackfn(val, idx, obj) { + called++; + if (called !== 1 && !testResult) { + return; + } + if (idx === 0) { + testResult = (val === 11); + } else if (idx === 1) { + testResult = (val === 9); + } else { + testResult = false; + } +} - var func = function (a, b) { - Array.prototype.forEach.call(arguments, callbackfn); - }; +var func = function(a, b) { + Array.prototype.forEach.call(arguments, callbackfn); +}; - func(11, 9); +func(11, 9); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-27.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-27.js index 21734ecca0e3f5c721f72a65a2607d4a65e09f2f..8ae05bc5ace6c6d0e062fff3c5ef52b8a9c61d4c 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-27.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-27.js @@ -10,29 +10,29 @@ description: > is greater than number of parameters) ---*/ - var called = 0; - var testResult = false; +var called = 0; +var testResult = false; - function callbackfn(val, idx, obj) { - called++; - if (called !== 1 && !testResult) { - return; - } - if (idx === 0) { - testResult = (val === 11); - } else if (idx === 1) { - testResult = (val === 12); - } else if (idx === 2) { - testResult = (val === 9); - } else { - testResult = false; - } - } +function callbackfn(val, idx, obj) { + called++; + if (called !== 1 && !testResult) { + return; + } + if (idx === 0) { + testResult = (val === 11); + } else if (idx === 1) { + testResult = (val === 12); + } else if (idx === 2) { + testResult = (val === 9); + } else { + testResult = false; + } +} - var func = function (a, b) { - return Array.prototype.forEach.call(arguments, callbackfn); - }; +var func = function(a, b) { + return Array.prototype.forEach.call(arguments, callbackfn); +}; - func(11, 12, 9); +func(11, 12, 9); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-28.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-28.js index 7bf82871907a7266a4320e0d337c6f611650a93f..ca2a6f90215f3e77e2cee106fd526ab82da785ad 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-28.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-28.js @@ -9,35 +9,35 @@ description: > iterations is observed on an Array ---*/ - var preIterVisible = false; - var arr = []; - var testResult = false; +var preIterVisible = false; +var arr = []; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 1) { - testResult = (val === 9); - } - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + testResult = (val === 9); + } +} - Object.defineProperty(arr, "0", { - get: function () { - preIterVisible = true; - return 11; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + preIterVisible = true; + return 11; + }, + configurable: true +}); - Object.defineProperty(arr, "1", { - get: function () { - if (preIterVisible) { - return 9; - } else { - return 13; - } - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + if (preIterVisible) { + return 9; + } else { + return 13; + } + }, + configurable: true +}); - arr.forEach(callbackfn); +arr.forEach(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-29.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-29.js index 9d9da525ad7fc02e5f771842e3ce04c1d1593cf7..12f468ac7f62c7324af2fcbe5c0c0f46e1b7f26d 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-29.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-29.js @@ -9,35 +9,37 @@ description: > iterations is observed on an Array-like object ---*/ - var preIterVisible = false; - var obj = { length: 2 }; - var testResult = false; +var preIterVisible = false; +var obj = { + length: 2 +}; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 1) { - testResult = (val === 9); - } - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + testResult = (val === 9); + } +} - Object.defineProperty(obj, "0", { - get: function () { - preIterVisible = true; - return 11; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + preIterVisible = true; + return 11; + }, + configurable: true +}); - Object.defineProperty(obj, "1", { - get: function () { - if (preIterVisible) { - return 9; - } else { - return 13; - } - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + if (preIterVisible) { + return 9; + } else { + return 13; + } + }, + configurable: true +}); - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-3.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-3.js index c7abc31d73479afd4d9b494c0f2203c715070bcf..7ee64853f124d463635eccfbf396cc1d335827e9 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-3.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-3.js @@ -9,24 +9,26 @@ description: > property that overrides an inherited data property on an Array ---*/ - var kValue = "abc"; - var testResult = false; +var kValue = "abc"; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 5) { - testResult = (val === kValue); - } - } +function callbackfn(val, idx, obj) { + if (idx === 5) { + testResult = (val === kValue); + } +} - var proto = { 5: 100 }; +var proto = { + 5: 100 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[5] = kValue; - child.length = 10; +var child = new Con(); +child[5] = kValue; +child.length = 10; - Array.prototype.forEach.call(child, callbackfn); +Array.prototype.forEach.call(child, callbackfn); assert(testResult, 'testResult !== 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 0787f9b955586916e6ee150164fa09cb063ef788..2ded257f9f01d572ff171d21a98f4d4151dc3aa9 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 @@ -9,30 +9,35 @@ description: > terminate iteration on an Array-like object ---*/ - var obj = { 0: 11, 5: 10, 10: 8, length: 20 }; - var accessed = false; +var obj = { + 0: 11, + 5: 10, + 10: 8, + length: 20 +}; +var accessed = false; - function callbackfn(val, idx, obj) { - if (idx > 1) { - accessed = true; - } - } +function callbackfn(val, idx, obj) { + if (idx > 1) { + accessed = true; + } +} - Object.defineProperty(obj, "1", { - get: function () { - throw new RangeError("unhandle exception happened in getter"); - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true +}); - Object.defineProperty(obj, "2", { - get: function () { - accessed = true; - return 100; - }, - configurable: true - }); +Object.defineProperty(obj, "2", { + get: function() { + accessed = true; + return 100; + }, + configurable: true +}); assert.throws(RangeError, function() { - Array.prototype.forEach.call(obj, callbackfn); + Array.prototype.forEach.call(obj, callbackfn); }); 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 e8da569a8e7988b27b4b141fd5c7905d6d42bffd..b6745f6d10153f7aa5b7792ec0e4535416c4a766 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 @@ -9,33 +9,33 @@ description: > terminate iteration on an Array-like object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - if (idx > 1) { - accessed = true; - } - } +function callbackfn(val, idx, obj) { + if (idx > 1) { + accessed = true; + } +} - var arr = []; - arr[5] = 10; - arr[10] = 100; +var arr = []; +arr[5] = 10; +arr[10] = 100; - Object.defineProperty(arr, "1", { - get: function () { - throw new RangeError("unhandle exception happened in getter"); - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true +}); - Object.defineProperty(arr, "2", { - get: function () { - accessed = true; - return 100; - }, - configurable: true - }); +Object.defineProperty(arr, "2", { + get: function() { + accessed = true; + return 100; + }, + configurable: true +}); assert.throws(RangeError, function() { - arr.forEach(callbackfn); + arr.forEach(callbackfn); }); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-4.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-4.js index ed8fffe015565fd3db987e30d415cbf3a0da9edd..3aa9c4573756961b223b5d75e6bc26373681a09c 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-4.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-4.js @@ -9,16 +9,16 @@ description: > property that overrides an inherited data property on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 0) { - testResult = (val === 12); - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 12); + } +} - Array.prototype[0] = 11; +Array.prototype[0] = 11; - [12].forEach(callbackfn); +[12].forEach(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-5.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-5.js index 4ddef569aeca482d1bdfea6998a3b153f7766eac..0cba85375358b8403e2506ecc80602f0004deb98 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-5.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-5.js @@ -10,33 +10,33 @@ description: > Array-like object ---*/ - var testResult = false; - - function callbackfn(val, idx, obj) { - if (idx === 0) { - testResult = (val === 11); - } - } - - var proto = {}; - - Object.defineProperty(proto, "0", { - get: function () { - return 5; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 2; - Object.defineProperty(child, "0", { - value: 11, - configurable: true - }); - - Array.prototype.forEach.call(child, callbackfn); +var testResult = false; + +function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 11); + } +} + +var proto = {}; + +Object.defineProperty(proto, "0", { + get: function() { + return 5; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 2; +Object.defineProperty(child, "0", { + value: 11, + configurable: true +}); + +Array.prototype.forEach.call(child, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-6.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-6.js index 691feab76b3fe07a43653c576180fa4dc7213365..213de16bd8ca21bff2601c56221f61c0097b6490 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-6.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-6.js @@ -9,21 +9,21 @@ description: > property that overrides an inherited accessor property on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 0) { - testResult = (val === 11); - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 11); + } +} - Object.defineProperty(Array.prototype, "0", { - get: function () { - return 9; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return 9; + }, + configurable: true +}); - [11].forEach(callbackfn); +[11].forEach(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-7.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-7.js index 75d5890f867eefa6bcb0359cb2cf359d314eb5d1..28f747e836172732afd21d864006bc4ce14d3bea 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-7.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-7.js @@ -9,23 +9,25 @@ description: > data property on an Array-like object ---*/ - var kValue = 'abc'; - var testResult = false; +var kValue = 'abc'; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 5) { - testResult = (val === kValue); - } - } +function callbackfn(val, idx, obj) { + if (idx === 5) { + testResult = (val === kValue); + } +} - var proto = { 5: kValue }; +var proto = { + 5: kValue +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 10; +var child = new Con(); +child.length = 10; - Array.prototype.forEach.call(child, callbackfn); +Array.prototype.forEach.call(child, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-8.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-8.js index 8943de8186117b3bb4689fd3771145f989443ad7..9ede560ba4c43635503e027d7529fd7d5d827d9d 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-8.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-8.js @@ -9,16 +9,16 @@ description: > data property on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 1) { - testResult = (val === 13); - } - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + testResult = (val === 13); + } +} - Array.prototype[1] = 13; +Array.prototype[1] = 13; - [, , , ].forEach(callbackfn); +[, , , ].forEach(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-9.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-9.js index d2fc330af9f2e134abc70572440c8594b21c7394..51c77ca23ea30823ddcdf5fa4d200d78e0395531 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-9.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-9.js @@ -9,23 +9,26 @@ description: > property on an Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(val, idx, obj) { - if (idx === 0) { - testResult = (val === 11); - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 11); + } +} - var obj = { 10: 10, length: 20 }; +var obj = { + 10: 10, + length: 20 +}; - Object.defineProperty(obj, "0", { - get: function () { - return 11; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + return 11; + }, + configurable: true +}); - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-1.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-1.js index 189dc1a57f20f732667017b9a9b0935630a700d5..e0eb4782991e2b78f775ecddb955ccaf40cff599 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-1.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-1.js @@ -7,18 +7,19 @@ es5id: 15.4.4.18-7-c-ii-1 description: Array.prototype.forEach - callbackfn called with correct parameters ---*/ - var bPar = true; - var bCalled = false; - function callbackfn(val, idx, obj) - { - bCalled = true; - if(obj[idx] !== val) - bPar = false; - } +var bPar = true; +var bCalled = false; - var arr = [0,1,true,null,new Object(),"five"]; - arr[999999] = -6.6; - arr.forEach(callbackfn); +function callbackfn(val, idx, obj) +{ + bCalled = true; + if (obj[idx] !== val) + bPar = false; +} + +var arr = [0, 1, true, null, new Object(), "five"]; +arr[999999] = -6.6; +arr.forEach(callbackfn); assert.sameValue(bCalled, true, 'bCalled'); assert.sameValue(bPar, true, 'bPar'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-10.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-10.js index 4e44bb713b8013be155a23c8b527cef9ef2415b3..1f6e4baa39421b8f1f1d34f9b5753425c72f2627 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-10.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-10.js @@ -9,11 +9,12 @@ description: > parameter ---*/ - var result = false; - function callbackfn(val) { - result = (val > 10); - } +var result = false; - [11].forEach(callbackfn); +function callbackfn(val) { + result = (val > 10); +} + +[11].forEach(callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-11.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-11.js index f0a81a8718173fe08ca5e664876f518753229172..a2991bb19c7a2212dde89458347c570258b6d281 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-11.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-11.js @@ -9,11 +9,12 @@ description: > parameter ---*/ - var result = false; - function callbackfn(val, idx) { - result = (val > 10 && arguments[2][idx] === val); - } +var result = false; - [11].forEach(callbackfn); +function callbackfn(val, idx) { + result = (val > 10 && arguments[2][idx] === val); +} + +[11].forEach(callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-12.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-12.js index af31ca180b1423588b773e439dac6d7d1773958b..667bec2276d0033de82a1edeb34a46e65cd86cda 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-12.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-12.js @@ -9,11 +9,12 @@ description: > parameter ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = (val > 10 && obj[idx] === val); - } +var result = false; - [11].forEach(callbackfn); +function callbackfn(val, idx, obj) { + result = (val > 10 && obj[idx] === val); +} + +[11].forEach(callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-13.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-13.js index 80df8a4195663b694d0fcb26de1e23bbcd58bce0..46a0ec317fc8cef3ed7171b924f73c8dc56cbf8e 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-13.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-13.js @@ -7,11 +7,12 @@ es5id: 15.4.4.18-7-c-ii-13 description: Array.prototype.forEach - callbackfn that uses arguments ---*/ - var result = false; - function callbackfn() { - result = (arguments[2][arguments[1]] === arguments[0]); - } +var result = false; - [11].forEach(callbackfn); +function callbackfn() { + result = (arguments[2][arguments[1]] === arguments[0]); +} + +[11].forEach(callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-16.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-16.js index ef9ff8c4f7e6bce835d713c0e190dbccd7457777..739bae5f3de3dff80b88018a77b9898222b65a26 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-16.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-16.js @@ -9,13 +9,17 @@ description: > object when T is not an object (T is a boolean) ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = (this.valueOf() !== false); - } +var result = false; - var obj = { 0: 11, length: 2 }; +function callbackfn(val, idx, obj) { + result = (this.valueOf() !== false); +} - Array.prototype.forEach.call(obj, callbackfn, false); +var obj = { + 0: 11, + length: 2 +}; + +Array.prototype.forEach.call(obj, callbackfn, false); assert.sameValue(result, false, 'result'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-17.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-17.js index 8967922b2cf6b0c66c6127a5b4bd9d3c7464a601..44e2e9bacaa26e3e9dff5732e67f8d77df6bb024 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-17.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-17.js @@ -9,13 +9,17 @@ description: > object when T is not an object (T is a number) ---*/ - var result = false; - function callbackfn(val, idx, o) { - result = (5 === this.valueOf()); - } +var result = false; - var obj = { 0: 11, length: 2 }; +function callbackfn(val, idx, o) { + result = (5 === this.valueOf()); +} - Array.prototype.forEach.call(obj, callbackfn, 5); +var obj = { + 0: 11, + length: 2 +}; + +Array.prototype.forEach.call(obj, callbackfn, 5); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-18.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-18.js index 3b073f0195da974c552a339f30407f6584acea95..3cf057a311f72ab0f8cc319a3571646fbedf9784 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-18.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-18.js @@ -9,13 +9,17 @@ description: > object when T is not an object (T is a string) ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = ('hello' === this.valueOf()); - } +var result = false; - var obj = { 0: 11, length: 2 }; +function callbackfn(val, idx, obj) { + result = ('hello' === this.valueOf()); +} - Array.prototype.forEach.call(obj, callbackfn, "hello"); +var obj = { + 0: 11, + length: 2 +}; + +Array.prototype.forEach.call(obj, callbackfn, "hello"); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-19.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-19.js index 677a50236c6f30b7ff8f3ae1288d3c82ec924ea3..df0f1401e0d2fa0c45659ab99f82bd36dd1c0ea6 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-19.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-19.js @@ -7,18 +7,24 @@ es5id: 15.4.4.18-7-c-ii-19 description: Array.prototype.forEach - non-indexed properties are not called ---*/ - var accessed = false; - var result = true; - function callbackfn(val, idx, obj) { - accessed = true; - if (val === 8) { - result = false; - } - } +var accessed = false; +var result = true; - var obj = { 0: 11, 10: 12, non_index_property: 8, length: 20 }; +function callbackfn(val, idx, obj) { + accessed = true; + if (val === 8) { + result = false; + } +} - Array.prototype.forEach.call(obj, callbackfn); +var obj = { + 0: 11, + 10: 12, + non_index_property: 8, + length: 20 +}; + +Array.prototype.forEach.call(obj, callbackfn); assert(result, 'result !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-2.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-2.js index 4140f28cb139a98fc87f49af790064bbdce20a93..6dcd31b1392e5e74d17f709c12d0abbba8b656f4 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-2.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-2.js @@ -7,17 +7,18 @@ es5id: 15.4.4.18-7-c-ii-2 description: Array.prototype.forEach - callbackfn takes 3 arguments ---*/ - var parCnt = 3; - var bCalled = false - function callbackfn(val, idx, obj) - { - bCalled = true; - if(arguments.length !== 3) - parCnt = arguments.length; //verify if callbackfn was called with 3 parameters - } +var parCnt = 3; +var bCalled = false - var arr = [0,1,2,3,4,5,6,7,8,9]; - arr.forEach(callbackfn); +function callbackfn(val, idx, obj) +{ + bCalled = true; + if (arguments.length !== 3) + parCnt = arguments.length; //verify if callbackfn was called with 3 parameters +} + +var arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; +arr.forEach(callbackfn); assert.sameValue(bCalled, true, 'bCalled'); assert.sameValue(parCnt, 3, 'parCnt'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-20.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-20.js index cf6b3fe8b3c4997025626ad913886883b599ea45..d0a6f846d605a37eceeab58cf25a8b653c3cc228 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-20.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-20.js @@ -9,15 +9,21 @@ description: > parameters (thisArg is correct) ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = (10 === this.threshold); - } +var result = false; - var thisArg = { threshold: 10 }; +function callbackfn(val, idx, obj) { + result = (10 === this.threshold); +} - var obj = { 0: 11, length: 1 }; +var thisArg = { + threshold: 10 +}; - Array.prototype.forEach.call(obj, callbackfn, thisArg); +var obj = { + 0: 11, + length: 1 +}; + +Array.prototype.forEach.call(obj, callbackfn, thisArg); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-21.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-21.js index 9879606253f84a0d63cd6a9c5fc9a41f763b755f..a165b482097d0f7f8f476acc64f5621442d3256f 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-21.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-21.js @@ -9,23 +9,27 @@ description: > parameters (kValue is correct) ---*/ - var resultOne = false; - var resultTwo = false; +var resultOne = false; +var resultTwo = false; - function callbackfn(val, idx, obj) { - if (idx === 0) { - resultOne = (val === 11); - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + resultOne = (val === 11); + } - if (idx === 1) { - resultTwo = (val === 12); - } + if (idx === 1) { + resultTwo = (val === 12); + } - } +} - var obj = { 0: 11, 1: 12, length: 2 }; +var obj = { + 0: 11, + 1: 12, + length: 2 +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(resultOne, 'resultOne !== true'); assert(resultTwo, 'resultTwo !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-22.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-22.js index 3f7fa9349f57c1e36faf5a4637ceda52eff82f21..8b29f06dab622c312282c1710835d4b0a57dea2c 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-22.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-22.js @@ -9,23 +9,27 @@ description: > parameters (the index k is correct) ---*/ - var resultOne = false; - var resultTwo = false; +var resultOne = false; +var resultTwo = false; - function callbackfn(val, idx, obj) { - if (val === 11) { - resultOne = (idx === 0); - } +function callbackfn(val, idx, obj) { + if (val === 11) { + resultOne = (idx === 0); + } - if (val === 12) { - resultTwo = (idx === 1); - } + if (val === 12) { + resultTwo = (idx === 1); + } - } +} - var obj = { 0: 11, 1: 12, length: 2 }; +var obj = { + 0: 11, + 1: 12, + length: 2 +}; - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(resultOne, 'resultOne !== true'); assert(resultTwo, 'resultTwo !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-23.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-23.js index 559f0ea68cc3f7ef69f0afa3faf951ba99589661..24ae74378ff9207f1c4e31890adcbeac5de8dc48 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-23.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-23.js @@ -9,13 +9,16 @@ description: > parameters (this object O is correct) ---*/ - var result = false; - var obj = { 0: 11, length: 2 }; +var result = false; +var obj = { + 0: 11, + length: 2 +}; - function callbackfn(val, idx, o) { - result = (obj === o); - } +function callbackfn(val, idx, o) { + result = (obj === o); +} - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-4.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-4.js index aafb439dd1f68886dac9d21ae7feaff1a59670f5..89d2da4a0d1b95d0078439fadf6c79a4aabbb007 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-4.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-4.js @@ -9,20 +9,21 @@ description: > order ---*/ - var arr = [0, 1, 2, 3, 4, 5]; - var lastIdx = 0; - var called = 0; - var result = true; - function callbackfn(val, idx, o) { - called++; - if (lastIdx !== idx) { - result = false; - } else { - lastIdx++; - } - } +var arr = [0, 1, 2, 3, 4, 5]; +var lastIdx = 0; +var called = 0; +var result = true; - arr.forEach(callbackfn); +function callbackfn(val, idx, o) { + called++; + if (lastIdx !== idx) { + result = false; + } else { + lastIdx++; + } +} + +arr.forEach(callbackfn); assert(result, 'result !== true'); assert.sameValue(arr.length, called, 'arr.length'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-5.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-5.js index 11159ba6fbca484b18995314148a8bbb84eb0c60..1b597b8ed18863b2273a78bbf5141faa9261fdc9 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-5.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-5.js @@ -9,23 +9,23 @@ description: > iteration and not prior to starting the loop on an Array ---*/ - var result = true; - var kIndex = []; +var result = true; +var kIndex = []; - //By below way, we could verify that k would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time. - function callbackfn(val, idx, obj) { - //Each position should be visited one time, which means k is accessed one time during iterations. - if (typeof kIndex[idx] === "undefined") { - //when current position is visited, its previous index should has been visited. - if (idx !== 0 && typeof kIndex[idx - 1] === "undefined") { - result = false; - } - kIndex[idx] = 1; - } else { - result = false; - } - } +//By below way, we could verify that k would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time. +function callbackfn(val, idx, obj) { + //Each position should be visited one time, which means k is accessed one time during iterations. + if (typeof kIndex[idx] === "undefined") { + //when current position is visited, its previous index should has been visited. + if (idx !== 0 && typeof kIndex[idx - 1] === "undefined") { + result = false; + } + kIndex[idx] = 1; + } else { + result = false; + } +} - [11, 12, 13, 14].forEach(callbackfn, undefined); +[11, 12, 13, 14].forEach(callbackfn, undefined); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-6.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-6.js index b1474e751c9bba10423a41c4e71d223e90f48074..22d73e78be6235ce361467258b805a9bc814d973 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-6.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-6.js @@ -9,17 +9,20 @@ description: > consistent ---*/ - var result = false; - var obj = { 0: 11, length: 1 }; - var thisArg = {}; +var result = false; +var obj = { + 0: 11, + length: 1 +}; +var thisArg = {}; - function callbackfn() { - result = (this === thisArg && - arguments[0] === 11 && - arguments[1] === 0 && - arguments[2] === obj); - } +function callbackfn() { + result = (this === thisArg && + arguments[0] === 11 && + arguments[1] === 0 && + arguments[2] === obj); +} - Array.prototype.forEach.call(obj, callbackfn, thisArg); +Array.prototype.forEach.call(obj, callbackfn, thisArg); assert(result, 'result !== true'); 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 0941fe49bf85ef83e9e8733156f208b0bcd0423b..c7f28a11f64ca3f87c13a887040a24cd3a26e021 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 @@ -9,19 +9,24 @@ description: > callbackfn terminate iteration ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - if (idx > 0) { - accessed = true; - } - if (idx === 0) { - throw new Error("Exception occurred in callbackfn"); - } - } +function callbackfn(val, idx, obj) { + if (idx > 0) { + accessed = true; + } + if (idx === 0) { + throw new Error("Exception occurred in callbackfn"); + } +} - var obj = { 0: 11, 4: 10, 10: 8, length: 20 }; +var obj = { + 0: 11, + 4: 10, + 10: 8, + length: 20 +}; assert.throws(Error, function() { - Array.prototype.forEach.call(obj, callbackfn); + Array.prototype.forEach.call(obj, callbackfn); }); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-8.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-8.js index c1b460cc3e03f584c743da6473fdda802faf6312..452044f84c3a3fc985b84cc613003d6258110c78 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-8.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-8.js @@ -9,19 +9,23 @@ description: > previous iterations is observed ---*/ - var result = false; - var obj = { 0: 11, 1: 12, length: 2 }; +var result = false; +var obj = { + 0: 11, + 1: 12, + length: 2 +}; - function callbackfn(val, idx, o) { - if (idx === 0) { - obj[idx + 1] = 8; - } +function callbackfn(val, idx, o) { + if (idx === 0) { + obj[idx + 1] = 8; + } - if (idx === 1) { - result = (val === 8); - } - } + if (idx === 1) { + result = (val === 8); + } +} - Array.prototype.forEach.call(obj, callbackfn); +Array.prototype.forEach.call(obj, callbackfn); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-9.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-9.js index b8396ea609169a286326e643b6f138d08ad293d6..5f6aa9cfd09eefd7f8a4278071ac15cec38500b6 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-9.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-9.js @@ -9,11 +9,12 @@ description: > parameter ---*/ - var called = 0; - function callbackfn() { - called++; - } +var called = 0; - [11, 12].forEach(callbackfn); +function callbackfn() { + called++; +} + +[11, 12].forEach(callbackfn); assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-1.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-1.js index 4716477c779e36aca5112c1fa53f7ad6405ed9c2..cf592c1e4228cc9870c352339e4bc9d094c8693c 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-1.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-1.js @@ -9,8 +9,11 @@ description: > (empty array) ---*/ - var callCnt = 0; - function cb(){callCnt++} - var i = [].forEach(cb); +var callCnt = 0; + +function cb() { + callCnt++ +} +var i = [].forEach(cb); assert.sameValue(callCnt, 0, 'callCnt'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-10.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-10.js index ef289af4301613a2f2c9243a7d5219d4c9778cb7..37344074848cf52c2e5fc914da4e83b604f2f845 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-10.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-10.js @@ -7,13 +7,17 @@ es5id: 15.4.4.18-8-10 description: Array.prototype.forEach - subclassed array when length is reduced ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = 1; +foo.prototype = new Array(1, 2, 3); - var callCnt = 0; - function cb(){callCnt++} - var i = f.forEach(cb); +function foo() {} +var f = new foo(); +f.length = 1; + +var callCnt = 0; + +function cb() { + callCnt++ +} +var i = f.forEach(cb); assert.sameValue(callCnt, 1, 'callCnt'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-11.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-11.js index 9c70a3a059884020591d0d9a25323bf1307477be..d594b58a20c4f0093d7f616cc25df0ed5e490724 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-11.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-11.js @@ -9,12 +9,12 @@ description: > called on ---*/ - function callbackfn(val, idx, obj) - { - return true; - } - var arr = [1,2,3,4,5]; - arr.forEach(callbackfn); +function callbackfn(val, idx, obj) +{ + return true; +} +var arr = [1, 2, 3, 4, 5]; +arr.forEach(callbackfn); assert.sameValue(arr[0], 1, 'arr[0]'); assert.sameValue(arr[1], 2, 'arr[1]'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-12.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-12.js index 74e0eef2ca7319ed1cbc063d30db01019f425879..3b92ddb24cac239a5c14ccd78a661f8297934022 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-12.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-12.js @@ -7,15 +7,16 @@ es5id: 15.4.4.18-8-12 description: Array.prototype.forEach doesn't visit expandos ---*/ - var callCnt = 0; - function callbackfn(val, idx, obj) - { - callCnt++; - } - var arr = [1,2,3,4,5]; - arr["i"] = 10; - arr[true] = 11; +var callCnt = 0; - arr.forEach(callbackfn); +function callbackfn(val, idx, obj) +{ + callCnt++; +} +var arr = [1, 2, 3, 4, 5]; +arr["i"] = 10; +arr[true] = 11; + +arr.forEach(callbackfn); assert.sameValue(callCnt, 5, 'callCnt'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-13.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-13.js index 8137d9b4aca87ef0979332d4d32a0da2f8bb00c1..de40f14e3001db95a0d585c391fbdb729aded8e3 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-13.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-13.js @@ -9,12 +9,13 @@ description: > 0 ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - } +var accessed = false; - var result = [].forEach(callbackfn); +function callbackfn(val, idx, obj) { + accessed = true; +} + +var result = [].forEach(callbackfn); assert.sameValue(typeof result, "undefined", 'typeof result'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-2.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-2.js index 24a5efda0b556609c3dc1b0395ffeaa8adc485d9..96c4cdc45d981bc591c358db6ee304c58158a1e3 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-2.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-2.js @@ -9,13 +9,17 @@ description: > (subclassed Array, length overridden to null (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = null; +foo.prototype = new Array(1, 2, 3); - var callCnt = 0; - function cb(){callCnt++} - var i = f.forEach(cb); +function foo() {} +var f = new foo(); +f.length = null; + +var callCnt = 0; + +function cb() { + callCnt++ +} +var i = f.forEach(cb); assert.sameValue(callCnt, 0, 'callCnt'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-3.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-3.js index ad6d2c88d322617a67a49fda54aba81e33374979..9dbf01bec98f0c1518a46460b3220de7637e9950 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-3.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-3.js @@ -9,13 +9,17 @@ description: > (subclassed Array, length overridden to false (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = false; +foo.prototype = new Array(1, 2, 3); - var callCnt = 0; - function cb(){callCnt++} - var i = f.forEach(cb); +function foo() {} +var f = new foo(); +f.length = false; + +var callCnt = 0; + +function cb() { + callCnt++ +} +var i = f.forEach(cb); assert.sameValue(callCnt, 0, 'callCnt'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-4.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-4.js index eca6eb28c5289827917003836bc82041dde4be34..fd9bfba94055d0d32f4c9d9d2a8c396e8382400a 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-4.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-4.js @@ -9,13 +9,17 @@ description: > (subclassed Array, length overridden to 0 (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = 0; +foo.prototype = new Array(1, 2, 3); - var callCnt = 0; - function cb(){callCnt++} - var i = f.forEach(cb); +function foo() {} +var f = new foo(); +f.length = 0; + +var callCnt = 0; + +function cb() { + callCnt++ +} +var i = f.forEach(cb); assert.sameValue(callCnt, 0, 'callCnt'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-5.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-5.js index 89ef96a1dbd19ecbeae180e7fa1a15699725a032..6e3ce9beedefed2884c3c75011d04b987951a8ff 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-5.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-5.js @@ -9,13 +9,17 @@ description: > (subclassed Array, length overridden to '0' (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = '0'; +foo.prototype = new Array(1, 2, 3); - var callCnt = 0; - function cb(){callCnt++} - var i = f.forEach(cb); +function foo() {} +var f = new foo(); +f.length = '0'; + +var callCnt = 0; + +function cb() { + callCnt++ +} +var i = f.forEach(cb); assert.sameValue(callCnt, 0, 'callCnt'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-6.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-6.js index 57bf3415d19b68a2d861bcddaf6edef5652fc978..0e26ea86fcb4d85455665db57561f9555b6e0f3e 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-6.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-6.js @@ -9,15 +9,23 @@ description: > (subclassed Array, length overridden with obj with valueOf) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - var o = { valueOf: function () { return 0;}}; - f.length = o; +function foo() {} +var f = new foo(); - var callCnt = 0; - function cb(){callCnt++} - var i = f.forEach(cb); +var o = { + valueOf: function() { + return 0; + } +}; +f.length = o; + +var callCnt = 0; + +function cb() { + callCnt++ +} +var i = f.forEach(cb); assert.sameValue(callCnt, 0, 'callCnt'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-7.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-7.js index 941c6ee3fb19154e93052a1f2dab2c7479be5b02..d08dadd7acb9fe78d6b30d0a6f81801dd80acc81 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-7.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-7.js @@ -10,20 +10,28 @@ description: > (toString)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - var o = { toString: function () { return '0';}}; - f.length = o; +function foo() {} +var f = new foo(); - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - var callCnt = 0; - function cb(){callCnt++} - var i = f.forEach(cb); +var o = { + toString: function() { + return '0'; + } +}; +f.length = o; + +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +var callCnt = 0; + +function cb() { + callCnt++ +} +var i = f.forEach(cb); assert.sameValue(callCnt, 0, 'callCnt'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-8.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-8.js index acfa321f405ee3e8f214d55c718d7e9e970f35c0..dee5abda64b63a73d9ae09f3a440a6f212ee7105 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-8.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-8.js @@ -9,27 +9,31 @@ description: > (subclassed Array, length overridden with [] ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - f.length = []; +function foo() {} +var f = new foo(); - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - // - // The toString( ) method on Array converts the array elements to strings, - // then returns the result of concatenating these strings, with commas in - // between. An array with no elements converts to the empty string, which - // converts to the number 0. If an array has a single element that is a - // number n, the array converts to a string representation of n, which is - // then converted back to n itself. If an array contains more than one element, - // or if its one element is not a number, the array converts to NaN. - var callCnt = 0; - function cb(){callCnt++} - var i = f.forEach(cb); +f.length = []; + +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +// +// The toString( ) method on Array converts the array elements to strings, +// then returns the result of concatenating these strings, with commas in +// between. An array with no elements converts to the empty string, which +// converts to the number 0. If an array has a single element that is a +// number n, the array converts to a string representation of n, which is +// then converted back to n itself. If an array contains more than one element, +// or if its one element is not a number, the array converts to NaN. +var callCnt = 0; + +function cb() { + callCnt++ +} +var i = f.forEach(cb); assert.sameValue(callCnt, 0, 'callCnt'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-9.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-9.js index 3e36453a42af97f36a244e0b3d731f770494dfde..2ce7678bf1db01475f7075000418c4a2cf681933 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-9.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-9.js @@ -9,28 +9,32 @@ description: > (subclassed Array, length overridden with [0] ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - - f.length = [0]; - - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - // - // The toString( ) method on Array converts the array elements to strings, - // then returns the result of concatenating these strings, with commas in - // between. An array with no elements converts to the empty string, which - // converts to the number 0. If an array has a single element that is a - // number n, the array converts to a string representation of n, which is - // then converted back to n itself. If an array contains more than one element, - // or if its one element is not a number, the array converts to NaN. - - var callCnt = 0; - function cb(){callCnt++} - var i = f.forEach(cb); +foo.prototype = new Array(1, 2, 3); + +function foo() {} +var f = new foo(); + +f.length = [0]; + +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +// +// The toString( ) method on Array converts the array elements to strings, +// then returns the result of concatenating these strings, with commas in +// between. An array with no elements converts to the empty string, which +// converts to the number 0. If an array has a single element that is a +// number n, the array converts to a string representation of n, which is +// then converted back to n itself. If an array contains more than one element, +// or if its one element is not a number, the array converts to NaN. + +var callCnt = 0; + +function cb() { + callCnt++ +} +var i = f.forEach(cb); assert.sameValue(callCnt, 0, 'callCnt'); diff --git a/test/built-ins/Array/prototype/forEach/S15.4.4.18_A1.js b/test/built-ins/Array/prototype/forEach/S15.4.4.18_A1.js index bdaef05035ecba0c8df4c473f54ca1bbb0d83359..0cfaf6ea8d6789eb33583a9b3629d4333619bc94 100644 --- a/test/built-ins/Array/prototype/forEach/S15.4.4.18_A1.js +++ b/test/built-ins/Array/prototype/forEach/S15.4.4.18_A1.js @@ -8,4 +8,6 @@ es5id: 15.4.4.18_A1 description: Freezes array.forEach during a forEach to see if it works ---*/ -['z'].forEach(function(){ Object.freeze(Array.prototype.forEach); }); +['z'].forEach(function() { + Object.freeze(Array.prototype.forEach); +}); diff --git a/test/built-ins/Array/prototype/forEach/S15.4.4.18_A2.js b/test/built-ins/Array/prototype/forEach/S15.4.4.18_A2.js index a95da06dda4bbf48d112a62e71e89576423c4977..c743d247efe10a88c371d703a2187faaeec68594 100644 --- a/test/built-ins/Array/prototype/forEach/S15.4.4.18_A2.js +++ b/test/built-ins/Array/prototype/forEach/S15.4.4.18_A2.js @@ -9,6 +9,8 @@ description: Freezes array.forEach during a forEach to see if it works ---*/ function foo() { - ['z'].forEach(function(){ Object.freeze(Array.prototype.forEach); }); + ['z'].forEach(function() { + Object.freeze(Array.prototype.forEach); + }); } foo(); diff --git a/test/built-ins/Array/prototype/includes/fromIndex-equal-or-greater-length-returns-false.js b/test/built-ins/Array/prototype/includes/fromIndex-equal-or-greater-length-returns-false.js index ebca5a0430442c3109006aa0e7dec2ee6152d7f6..84bb4526d8ecd8feb11cc90a23598c2f64d085b3 100644 --- a/test/built-ins/Array/prototype/includes/fromIndex-equal-or-greater-length-returns-false.js +++ b/test/built-ins/Array/prototype/includes/fromIndex-equal-or-greater-length-returns-false.js @@ -18,6 +18,6 @@ info: | 8. Return false. ---*/ -var sample = [ 7, 7, 7, 7 ]; +var sample = [7, 7, 7, 7]; assert.sameValue(sample.includes(7, 4), false, "length"); assert.sameValue(sample.includes(7, 5), false, "length + 1"); diff --git a/test/built-ins/Array/prototype/includes/search-not-found-returns-false.js b/test/built-ins/Array/prototype/includes/search-not-found-returns-false.js index 6d5393dbb7b29d3ae233bc448e54e95f1ff4d48e..7d98d2a68bc9859adf8d6df48c714b15098dab0f 100644 --- a/test/built-ins/Array/prototype/includes/search-not-found-returns-false.js +++ b/test/built-ins/Array/prototype/includes/search-not-found-returns-false.js @@ -35,7 +35,9 @@ assert.sameValue([null].includes(undefined), false, "undefined"); assert.sameValue([Symbol("1")].includes(Symbol("1")), false, "symbol"); assert.sameValue([{}].includes({}), false, "object"); -assert.sameValue([[]].includes([]), false, "array"); +assert.sameValue([ + [] +].includes([]), false, "array"); var sample = [42]; assert.sameValue(sample.includes(sample), false, "this"); diff --git a/test/built-ins/Array/prototype/includes/sparse.js b/test/built-ins/Array/prototype/includes/sparse.js index bd272fe93530a97ccc01e29e678107f0141b2e0f..751c2c928ed279f26fe8c7d74608c6c516c94c27 100644 --- a/test/built-ins/Array/prototype/includes/sparse.js +++ b/test/built-ins/Array/prototype/includes/sparse.js @@ -21,18 +21,18 @@ info: | ---*/ assert.sameValue( - [ , , , ].includes(undefined), + [, , , ].includes(undefined), true, "[ , , , ].includes(undefined)" ); assert.sameValue( - [ , , , 42, ].includes(undefined, 4), + [, , , 42, ].includes(undefined, 4), false, "[ , , , 42, ].includes(undefined, 4)" ); -var sample = [ , , , 42, , ]; +var sample = [, , , 42, , ]; assert.sameValue( sample.includes(undefined), diff --git a/test/built-ins/Array/prototype/includes/tolength-length.js b/test/built-ins/Array/prototype/includes/tolength-length.js index a3c868474a83db91172128e4ae38276c6f64cb17..c1e82b9da585ec184f9caa3f44c6bea8673ed692 100644 --- a/test/built-ins/Array/prototype/includes/tolength-length.js +++ b/test/built-ins/Array/prototype/includes/tolength-length.js @@ -72,8 +72,16 @@ assert.sameValue([].includes.call(obj, "a"), false, "false"); obj.length = true; assert.sameValue([].includes.call(obj, "a"), true, "true"); -obj.length = { valueOf: function() { return 2; } }; +obj.length = { + valueOf: function() { + return 2; + } +}; assert.sameValue([].includes.call(obj, "b"), true, "ordinary object.valueOf"); -obj.length = { toString: function() { return 2; } }; +obj.length = { + toString: function() { + return 2; + } +}; assert.sameValue([].includes.call(obj, "b"), true, "ordinary object.toString"); 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 1eb9ef72e07e8f12635ebcbb6557d2911769b459..ea9ca6068f5f86bdbbbd75beb83ad4ee890ee46d 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 @@ -9,5 +9,5 @@ description: Array.prototype.indexOf applied to undefined throws a TypeError assert.throws(TypeError, function() { - Array.prototype.indexOf.call(undefined); + Array.prototype.indexOf.call(undefined); }); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-10.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-10.js index 1a552021883296689367fdef2ddc42426bb80466..4622e10a06ca8983ee1a8c654278ffb17623c22e 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-10.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-10.js @@ -7,7 +7,7 @@ es5id: 15.4.4.14-1-10 description: Array.prototype.indexOf applied to the Math object ---*/ - Math[1] = true; - Math.length = 2; +Math[1] = true; +Math.length = 2; assert.sameValue(Array.prototype.indexOf.call(Math, true), 1, 'Array.prototype.indexOf.call(Math, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-11.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-11.js index bcb3b21eadf242a942d4cf796e86e4d51e0d8a48..51d4a331e99e42a1566e9dd3d4939e4d2a074c8a 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-11.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-11.js @@ -7,8 +7,8 @@ es5id: 15.4.4.14-1-11 description: Array.prototype.indexOf applied to Date object ---*/ - var obj = new Date(); - obj.length = 2; - obj[1] = true; +var obj = new Date(); +obj.length = 2; +obj[1] = true; assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-12.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-12.js index c416b6e1b96cc849ed9e23269e034f3d12bbce40..4c23949e9c1215bd42e43d861a64fecb5e068904 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-12.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-12.js @@ -7,8 +7,8 @@ es5id: 15.4.4.14-1-12 description: Array.prototype.indexOf applied to RegExp object ---*/ - var obj = new RegExp(); - obj.length = 2; - obj[1] = true; +var obj = new RegExp(); +obj.length = 2; +obj[1] = true; assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-13.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-13.js index c1ca78731658d81330a4ce5dfe935f59d27a49fe..b339869a0a0dadd9517735815c1f6d8d19bb3682 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-13.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-13.js @@ -7,9 +7,9 @@ es5id: 15.4.4.14-1-13 description: Array.prototype.indexOf applied to the JSON object ---*/ - var targetObj = {}; +var targetObj = {}; - JSON[3] = targetObj; - JSON.length = 5; +JSON[3] = targetObj; +JSON.length = 5; assert.sameValue(Array.prototype.indexOf.call(JSON, targetObj), 3, 'Array.prototype.indexOf.call(JSON, targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-14.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-14.js index 6f116d5ceec7c410db64d04999103e03bc39cc46..06c02d8f184e4661ab6f95617380c281b23803f8 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-14.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-14.js @@ -7,8 +7,8 @@ es5id: 15.4.4.14-1-14 description: Array.prototype.indexOf applied to Error object ---*/ - var obj = new SyntaxError(); - obj[1] = true; - obj.length = 2; +var obj = new SyntaxError(); +obj[1] = true; +obj.length = 2; assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-15.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-15.js index 7a6c9b7ca42ea9d2ac59d7173ebc6a8dab8bf5da..598ba594e1a2052ede35f459fa80e4011b0d3e60 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-15.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-15.js @@ -7,9 +7,9 @@ es5id: 15.4.4.14-1-15 description: Array.prototype.indexOf applied to Arguments object ---*/ - function fun() { - return arguments; - } - var obj = fun(1, true, 3); +function fun() { + return arguments; +} +var obj = fun(1, true, 3); assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); 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 5584d5f68fb0d3f7c63698935ada78466084bd8e..5e348a54ec4018452bd9da251c9316b6ae54c1c0 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 @@ -9,5 +9,5 @@ description: Array.prototype.indexOf applied to null throws a TypeError assert.throws(TypeError, function() { - Array.prototype.indexOf.call(null); + Array.prototype.indexOf.call(null); }); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-3.js index 510a693ed46c445022bad10785633f544a6e73cd..3bfe5e7a6ea7af24b13b783ce4eff875d0b7e862 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-3.js @@ -7,9 +7,9 @@ es5id: 15.4.4.14-1-3 description: Array.prototype.indexOf applied to boolean primitive ---*/ - var targetObj = {}; +var targetObj = {}; - Boolean.prototype[1] = targetObj; - Boolean.prototype.length = 2; +Boolean.prototype[1] = targetObj; +Boolean.prototype.length = 2; assert.sameValue(Array.prototype.indexOf.call(true, targetObj), 1, 'Array.prototype.indexOf.call(true, targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-4.js index 844e34af49932a40b5548e02372b7f4466c6a603..5f0dd9ed5fef11e0785cb8d936e9971b8587c7d2 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-4.js @@ -7,8 +7,8 @@ es5id: 15.4.4.14-1-4 description: Array.prototype.indexOf applied to Boolean Object ---*/ - var obj = new Boolean(false); - obj.length = 2; - obj[1] = true; +var obj = new Boolean(false); +obj.length = 2; +obj[1] = true; assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-5.js index ccca65776021a0cfb35e918623bfe9f2732fab43..4fa661c8b8a6073b0c70412b32b945255c3f48db 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-5.js @@ -7,9 +7,9 @@ es5id: 15.4.4.14-1-5 description: Array.prototype.indexOf applied to number primitive ---*/ - var targetObj = {}; +var targetObj = {}; - Number.prototype[1] = targetObj; - Number.prototype.length = 2; +Number.prototype[1] = targetObj; +Number.prototype.length = 2; assert.sameValue(Array.prototype.indexOf.call(5, targetObj), 1, 'Array.prototype.indexOf.call(5, targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-6.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-6.js index c6416ebe4e9ce6e1467ed73a2dba984151920b8e..928377959bff49fe1dc34192d003bf1eb7df2c98 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-6.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-6.js @@ -7,8 +7,8 @@ es5id: 15.4.4.14-1-6 description: Array.prototype.indexOf applied to Number object ---*/ - var obj = new Number(-3); - obj.length = 2; - obj[1] = true; +var obj = new Number(-3); +obj.length = 2; +obj[1] = true; assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-8.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-8.js index 46575fb68dacaf421676815062acb228e9316396..eaa29361e3ef18d2415f3b2c0fc1ce2352f96ecf 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-8.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-8.js @@ -7,6 +7,6 @@ es5id: 15.4.4.14-1-8 description: Array.prototype.indexOf applied to String object ---*/ - var obj = new String("null"); +var obj = new String("null"); assert.sameValue(Array.prototype.indexOf.call(obj, 'l'), 2, 'Array.prototype.indexOf.call(obj, "l")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-9.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-9.js index 76d8e87c0b7bc120edf4ab637fd99460fb9d0f29..065d31bc7400c7114d6d65c74d86214222af8c86 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-9.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-9.js @@ -7,9 +7,9 @@ es5id: 15.4.4.14-1-9 description: Array.prototype.indexOf applied to Function object ---*/ - var obj = function (a, b) { - return a + b; - }; - obj[1] = true; +var obj = function(a, b) { + return a + b; +}; +obj[1] = true; assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-10-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-10-1.js index c0d6c537acfcebcbbee52d2ce22ba265920858a9..8a77b86f52e3ac0a703411ad59bdf9c09bf509ea 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-10-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-10-1.js @@ -9,13 +9,13 @@ description: > array ---*/ - var a = new Array(); - a[100] = 1; - a[99999] = ""; - a[10] = new Object(); - a[5555] = 5.5; - a[123456] = "str"; - a[5] = 1E+309; +var a = new Array(); +a[100] = 1; +a[99999] = ""; +a[10] = new Object(); +a[5555] = 5.5; +a[123456] = "str"; +a[5] = 1E+309; assert.sameValue(a.indexOf(1), 100, 'a.indexOf(1)'); assert.sameValue(a.indexOf(""), 99999, 'a.indexOf("")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-10-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-10-2.js index 124043c97fde7591a773c54e3a01e7e82ff6be40..fbb92688888091b584e3f68d7bc9cd6b6dcf062e 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-10-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-10-2.js @@ -9,12 +9,19 @@ description: > access any other properties ---*/ - var accessed = false; - var f = {length: 0}; - Object.defineProperty(f,"0",{get: function () {accessed = true; return 1;}}); +var accessed = false; +var f = { + length: 0 +}; +Object.defineProperty(f, "0", { + get: function() { + accessed = true; + return 1; + } +}); - var i = Array.prototype.indexOf.call(f,1); +var i = Array.prototype.indexOf.call(f, 1); assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-1.js index 61dd7f294625568ef44081993bcdc3af62aad882..e14c28ba318ff4b282b5986a2e043a7361c2cc15 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-1.js @@ -9,8 +9,14 @@ description: > Array-like object ---*/ - var objOne = { 1: true, length: 2 }; - var objTwo = { 2: true, length: 2 }; +var objOne = { + 1: true, + length: 2 +}; +var objTwo = { + 2: true, + length: 2 +}; assert.sameValue(Array.prototype.indexOf.call(objOne, true), 1, 'Array.prototype.indexOf.call(objOne, true)'); assert.sameValue(Array.prototype.indexOf.call(objTwo, true), -1, 'Array.prototype.indexOf.call(objTwo, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-10.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-10.js index f4c6f0b83a10827d7553d1d16c3424f101dadaf1..bde4a7b79be33bb51b5dd5b6ef8d90a9c0a5c41d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-10.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-10.js @@ -7,21 +7,21 @@ es5id: 15.4.4.14-2-10 description: Array.prototype.indexOf - 'length' is inherited accessor property ---*/ - var proto = {}; - Object.defineProperty(proto, "length", { - get: function () { - return 2; - }, - configurable: true - }); +var proto = {}; +Object.defineProperty(proto, "length", { + get: function() { + return 2; + }, + configurable: true +}); - var Con = function () {}; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var childOne = new Con(); - childOne[1] = true; - var childTwo = new Con(); - childTwo[2] = true; +var childOne = new Con(); +childOne[1] = true; +var childTwo = new Con(); +childTwo[2] = true; assert.sameValue(Array.prototype.indexOf.call(childOne, true), 1, 'Array.prototype.indexOf.call(childOne, true)'); assert.sameValue(Array.prototype.indexOf.call(childTwo, true), -1, 'Array.prototype.indexOf.call(childTwo, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-11.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-11.js index bb89914e0b5b7289e32a07ecf8fb6638e6e58af2..d5d473e994dccafe807534d5f202da29f01f901d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-11.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-11.js @@ -9,10 +9,12 @@ description: > without a get function ---*/ - var obj = { 1: true }; - Object.defineProperty(obj, "length", { - set: function () { }, - configurable: true - }); +var obj = { + 1: true +}; +Object.defineProperty(obj, "length", { + set: function() {}, + configurable: true +}); assert.sameValue(Array.prototype.indexOf.call(obj, true), -1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-12.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-12.js index ff9ac06df0756b88e08f75b6b7ddd8091afa282e..205d52fbe5b593c66acc80b0000494f950f4a991 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-12.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-12.js @@ -10,17 +10,19 @@ description: > property ---*/ - Object.defineProperty(Object.prototype, "length", { - get: function () { - return 20; - }, - configurable: true - }); +Object.defineProperty(Object.prototype, "length", { + get: function() { + return 20; + }, + configurable: true +}); - var obj = { 1: 1 }; - Object.defineProperty(obj, "length", { - set: function () { }, - configurable: true - }); +var obj = { + 1: 1 +}; +Object.defineProperty(obj, "length", { + set: function() {}, + configurable: true +}); assert.sameValue(Array.prototype.indexOf.call(obj, 1), -1, 'Array.prototype.indexOf.call(obj, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-13.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-13.js index 6aa17ff1ea6a49344f379c0e583900abf61b687e..833c45d701725c3a78953d98c5c0c0981395e0ac 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-13.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-13.js @@ -9,16 +9,16 @@ description: > without a get function ---*/ - var proto = {}; - Object.defineProperty(proto, "length", { - set: function () { }, - configurable: true - }); +var proto = {}; +Object.defineProperty(proto, "length", { + set: function() {}, + configurable: true +}); - var Con = function () {}; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[1] = true; +var child = new Con(); +child[1] = true; assert.sameValue(Array.prototype.indexOf.call(child, true), -1, 'Array.prototype.indexOf.call(child, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-14.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-14.js index 6ffd345dbee4c0f2c0a091b65a1606efb3e548d9..8807657e82c875c98f60df3f2f8b8ffb363e8dfe 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-14.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-14.js @@ -7,6 +7,9 @@ es5id: 15.4.4.14-2-14 description: Array.prototype.indexOf - 'length' is undefined property ---*/ - var obj = { 0: true, 1: true }; +var obj = { + 0: true, + 1: true +}; assert.sameValue(Array.prototype.indexOf.call(obj, true), -1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-17.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-17.js index 2df7594957a8776d6d2b57138174b1a7f77bbcbf..cce214933dbe57af604d74bd49b528075d85b9c2 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-17.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-17.js @@ -9,10 +9,10 @@ description: > implements its own property get method ---*/ - var func = function (a, b) { - arguments[2] = false; - return Array.prototype.indexOf.call(arguments, true) === 1 && - Array.prototype.indexOf.call(arguments, false) === -1; - }; +var func = function(a, b) { + arguments[2] = false; + return Array.prototype.indexOf.call(arguments, true) === 1 && + Array.prototype.indexOf.call(arguments, false) === -1; +}; assert(func(0, true), 'func(0, true) !== true'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-18.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-18.js index e48cb33de8cdc2b24bc6dc03b579583651789467..e739dd81a1bf042c6f8345cdb6a3f9c27cc90b82 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-18.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-18.js @@ -9,9 +9,9 @@ description: > its own property get method ---*/ - var str = new String("012"); +var str = new String("012"); - String.prototype[3] = "3"; +String.prototype[3] = "3"; assert.sameValue(Array.prototype.indexOf.call(str, "2"), 2, 'Array.prototype.indexOf.call(str, "2")'); assert.sameValue(Array.prototype.indexOf.call(str, "3"), -1, 'Array.prototype.indexOf.call(str, "3")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-19.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-19.js index 09bb09dd3a513cb5709aa3b07cbfedc56f795ffd..b5735739ff54332dbe784c8f44f82317723dd9b7 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-19.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-19.js @@ -9,11 +9,11 @@ description: > implements its own property get method ---*/ - var obj = function (a, b) { - return a + b; - }; - obj[1] = "b"; - obj[2] = "c"; +var obj = function(a, b) { + return a + b; +}; +obj[1] = "b"; +obj[2] = "c"; assert.sameValue(Array.prototype.indexOf.call(obj, obj[1]), 1, 'Array.prototype.indexOf.call(obj, obj[1])'); assert.sameValue(Array.prototype.indexOf.call(obj, obj[2]), -1, 'Array.prototype.indexOf.call(obj, obj[2])'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-2.js index d1fb4b7bb67191aa67ef3353ca15d5110a03bb1c..9fba718211c7d56b4e92da874b73cfb1434d71f4 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-2.js @@ -7,9 +7,9 @@ es5id: 15.4.4.14-2-2 description: Array.prototype.indexOf - 'length' is own data property on an Array ---*/ - var targetObj = {}; +var targetObj = {}; - Array.prototype[2] = targetObj; +Array.prototype[2] = targetObj; assert.sameValue([0, targetObj].indexOf(targetObj), 1, '[0, targetObj].indexOf(targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-3.js index c0c72be3b03da57b66bdeb1f9f312f0647cc194a..db7ecfe83911134174a94e0acebb71f1b0800a14 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-3.js @@ -9,13 +9,15 @@ description: > overrides an inherited data property on an Array-like object ---*/ - var proto = { length: 0 }; +var proto = { + length: 0 +}; - var Con = function () {}; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 2; - child[1] = true; +var child = new Con(); +child.length = 2; +child[1] = true; assert.sameValue(Array.prototype.indexOf.call(child, true), 1, 'Array.prototype.indexOf.call(child, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-4.js index 5a4f6f2386d56c80276cb05a1f8bc6f1ccdc680d..dfc01cd8d78760a03c73257fa206f815e744b8c5 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-4.js @@ -9,10 +9,10 @@ description: > overrides an inherited data property on an Array ---*/ - var targetObj = {}; - var arrProtoLen; +var targetObj = {}; +var arrProtoLen; - arrProtoLen = Array.prototype.length; - Array.prototype.length = 0; +arrProtoLen = Array.prototype.length; +Array.prototype.length = 0; assert.sameValue([0, targetObj].indexOf(targetObj), 1, '[0, targetObj].indexOf(targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-5.js index 8c5523964a59fe924f8f11e327f6203f68114c61..0f3909236cbd91730151223e7c2a00dd45bd6241 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-5.js @@ -9,23 +9,23 @@ description: > overrides an inherited accessor property on an Array-like object ---*/ - var proto = {}; - Object.defineProperty(proto, "length", { - get: function () { - return 0; - }, - configurable: true - }); +var proto = {}; +Object.defineProperty(proto, "length", { + get: function() { + return 0; + }, + configurable: true +}); - var Con = function () {}; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); +var child = new Con(); - Object.defineProperty(child, "length", { - value: 2, - configurable: true - }); - child[1] = true; +Object.defineProperty(child, "length", { + value: 2, + configurable: true +}); +child[1] = true; assert.sameValue(Array.prototype.indexOf.call(child, true), 1, 'Array.prototype.indexOf.call(child, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-6.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-6.js index 39788558ae66a81f0a2303f393c86b7871335e8a..79269969a1465757a6ca2dc037f1bfccac65afaf 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-6.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-6.js @@ -7,15 +7,17 @@ es5id: 15.4.4.14-2-6 description: Array.prototype.indexOf - 'length' is an inherited data property ---*/ - var proto = { length: 2 }; +var proto = { + length: 2 +}; - var Con = function () {}; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var childOne = new Con(); - childOne[1] = true; - var childTwo = new Con(); - childTwo[2] = true; +var childOne = new Con(); +childOne[1] = true; +var childTwo = new Con(); +childTwo[2] = true; assert.sameValue(Array.prototype.indexOf.call(childOne, true), 1, 'Array.prototype.indexOf.call(childOne, true)'); assert.sameValue(Array.prototype.indexOf.call(childTwo, true), -1, 'Array.prototype.indexOf.call(childTwo, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-7.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-7.js index 975a8673ab65a5e0822635cf0cd0553d65b6c663..6a0ec25878aa44cca165b04daa78df50bee19343 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-7.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-7.js @@ -7,20 +7,24 @@ es5id: 15.4.4.14-2-7 description: Array.prototype.indexOf - 'length' is own accessor property ---*/ - var objOne = { 1: true }; - var objTwo = { 2: true }; - Object.defineProperty(objOne, "length", { - get: function () { - return 2; - }, - configurable: true - }); - Object.defineProperty(objTwo, "length", { - get: function () { - return 2; - }, - configurable: true - }); +var objOne = { + 1: true +}; +var objTwo = { + 2: true +}; +Object.defineProperty(objOne, "length", { + get: function() { + return 2; + }, + configurable: true +}); +Object.defineProperty(objTwo, "length", { + get: function() { + return 2; + }, + configurable: true +}); assert.sameValue(Array.prototype.indexOf.call(objOne, true), 1, 'Array.prototype.indexOf.call(objOne, true)'); assert.sameValue(Array.prototype.indexOf.call(objTwo, true), -1, 'Array.prototype.indexOf.call(objTwo, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-8.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-8.js index 92bf58f7ab0ffd9730b50465a16050f7b28a8627..8ad55630ea2f300cfb9b387cc67cead04c58bdb8 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-8.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-8.js @@ -9,19 +9,21 @@ description: > overrides an inherited data property ---*/ - var proto = { length: 0 }; +var proto = { + length: 0 +}; - var Con = function () {}; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[1] = true; +var child = new Con(); +child[1] = true; - Object.defineProperty(child, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(child, "length", { + get: function() { + return 2; + }, + configurable: true +}); assert.sameValue(Array.prototype.indexOf.call(child, true), 1, 'Array.prototype.indexOf.call(child, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-9.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-9.js index 5ec60e0581b0b213d123acb4dc77030fa45b64a6..2bf8c82efe5811d905dd64ca6503e8863dd513a8 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-9.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-9.js @@ -9,25 +9,25 @@ description: > overrides an inherited accessor property ---*/ - var proto = {}; - Object.defineProperty(proto, "length", { - get: function () { - return 0; - }, - configurable: true - }); +var proto = {}; +Object.defineProperty(proto, "length", { + get: function() { + return 0; + }, + configurable: true +}); - var Con = function () {}; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[1] = true; +var child = new Con(); +child[1] = true; - Object.defineProperty(child, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(child, "length", { + get: function() { + return 2; + }, + configurable: true +}); assert.sameValue(Array.prototype.indexOf.call(child, true), 1, 'Array.prototype.indexOf.call(child, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-1.js index 528bb1f48913020405cbb8a49451125addfd5e5a..0787c3a9c450d74924d06dffa9a98067e8879c9d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-1.js @@ -7,6 +7,10 @@ es5id: 15.4.4.14-3-1 description: Array.prototype.indexOf - value of 'length' is undefined ---*/ - var obj = { 0: 1, 1: 1, length: undefined }; +var obj = { + 0: 1, + 1: 1, + length: undefined +}; assert.sameValue(Array.prototype.indexOf.call(obj, 1), -1, 'Array.prototype.indexOf.call(obj, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-10.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-10.js index 2d422228ca9c383aa3293a776f6055f450905fff..503c2206df354bad39848000859561c85ea5e0d1 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-10.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-10.js @@ -9,6 +9,9 @@ description: > (value is NaN) ---*/ - var obj = { 0: 0, length: NaN }; +var obj = { + 0: 0, + length: NaN +}; assert.sameValue(Array.prototype.indexOf.call(obj, 0), -1, 'Array.prototype.indexOf.call(obj, 0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-11.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-11.js index dbccc238b986b785af2e3ca461f173a2c846096d..9914d8d78ceaa62fce3a52c57e19d786fd948d3a 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-11.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-11.js @@ -9,7 +9,11 @@ description: > positive number ---*/ - var obj = { 1: 1, 2: 2, length: "2" }; +var obj = { + 1: 1, + 2: 2, + length: "2" +}; assert.sameValue(Array.prototype.indexOf.call(obj, 1), 1, 'Array.prototype.indexOf.call(obj, 1)'); assert.sameValue(Array.prototype.indexOf.call(obj, 2), -1, 'Array.prototype.indexOf.call(obj, 2)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-12.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-12.js index c147d9355385fcc1ac168ef5b48243a25665f894..edc04e60cb77698480385490cb7c05615bd4fe1e 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-12.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-12.js @@ -9,7 +9,11 @@ description: > negative number ---*/ - var obj = { 1: "true", 2: "2", length: "-4294967294" }; +var obj = { + 1: "true", + 2: "2", + length: "-4294967294" +}; assert.sameValue(Array.prototype.indexOf.call(obj, "true"), -1, 'Array.prototype.indexOf.call(obj, "true")'); assert.sameValue(Array.prototype.indexOf.call(obj, "2"), -1, 'Array.prototype.indexOf.call(obj, "2")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-13.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-13.js index d2ff4af50f0909468fe314e1cbc7f55704ce9b9a..0b2ea6bb6d259705f98cfca93c700e1e0fad36f1 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-13.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-13.js @@ -9,7 +9,11 @@ description: > decimal number ---*/ - var obj = { 199: true, 200: "200.59", length: "200.59" }; +var obj = { + 199: true, + 200: "200.59", + length: "200.59" +}; assert.sameValue(Array.prototype.indexOf.call(obj, true), 199, 'Array.prototype.indexOf.call(obj, true)'); assert.sameValue(Array.prototype.indexOf.call(obj, "200.59"), -1, 'Array.prototype.indexOf.call(obj, "200.59")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-14.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-14.js index f37712cf3199af8c71780f05cfaced4ce4ae3a50..ec4c578d212006e284c3503e119f2fefa9a3bb4c 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-14.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-14.js @@ -9,9 +9,21 @@ description: > +/-Infinity ---*/ - var objOne = { 0: true, 1: true, length: "Infinity" }; - var objTwo = { 0: true, 1: true, length: "+Infinity" }; - var objThree = { 0: true, 1: true, length: "-Infinity" }; +var objOne = { + 0: true, + 1: true, + length: "Infinity" +}; +var objTwo = { + 0: true, + 1: true, + length: "+Infinity" +}; +var objThree = { + 0: true, + 1: true, + length: "-Infinity" +}; assert.sameValue(Array.prototype.indexOf.call(objOne, true), 0, 'Array.prototype.indexOf.call(objOne, true)'); assert.sameValue(Array.prototype.indexOf.call(objTwo, true), 0, 'Array.prototype.indexOf.call(objTwo, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-15.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-15.js index e35a97c2cd0355104273603f5dcaade75602948c..2bf0dd8b2bf8bfa3bc88e2a78be38543ba8d5a58 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-15.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-15.js @@ -9,7 +9,11 @@ description: > exponential number ---*/ - var obj = { 1: true, 2: "2E0", length: "2E0" }; +var obj = { + 1: true, + 2: "2E0", + length: "2E0" +}; assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); assert.sameValue(Array.prototype.indexOf.call(obj, "2E0"), -1, 'Array.prototype.indexOf.call(obj, "2E0")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-16.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-16.js index adc6ff83a49bc58ff8962e2a90cbd23a09b22de2..c3cd2c458ffcc6ab91bbc34a84fd604fda21be3f 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-16.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-16.js @@ -9,7 +9,11 @@ description: > number ---*/ - var obj = { 10: true, 11: "0x00B", length: "0x00B" }; +var obj = { + 10: true, + 11: "0x00B", + length: "0x00B" +}; assert.sameValue(Array.prototype.indexOf.call(obj, true), 10, 'Array.prototype.indexOf.call(obj, true)'); assert.sameValue(Array.prototype.indexOf.call(obj, "0x00B"), -1, 'Array.prototype.indexOf.call(obj, "0x00B")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-17.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-17.js index 3f5d9a17350fbdb188b2bf892cb3b4fd09eb05cf..66bb812c35de8e9d756767a1164eae2e16c8dfeb 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-17.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-17.js @@ -9,7 +9,11 @@ description: > with leading zeros ---*/ - var obj = { 1: true, 2: "0002.0", length: "0002.0" }; +var obj = { + 1: true, + 2: "0002.0", + length: "0002.0" +}; assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); assert.sameValue(Array.prototype.indexOf.call(obj, "0002.0"), -1, 'Array.prototype.indexOf.call(obj, "0002.0")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-18.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-18.js index 71c052c5bf6a17e6aeadb1eb81c1476a55332b99..382df40af81cb571946078770351c275d9bac09f 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-18.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-18.js @@ -9,6 +9,10 @@ description: > convert to a number ---*/ - var obj = { 0: true, 100: true, length: "one" }; +var obj = { + 0: true, + 100: true, + length: "one" +}; assert.sameValue(Array.prototype.indexOf.call(obj, true), -1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-19.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-19.js index 17a3c545acd8f049946d42f4e99673b454fc143e..b770f05777e790d5e9ce96aaef90743cf5522c99 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-19.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-19.js @@ -9,22 +9,22 @@ description: > an own toString method. ---*/ - // objects inherit the default valueOf() method from Object - // that simply returns itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. +// objects inherit the default valueOf() method from Object +// that simply returns itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. - var obj = { - 1: true, - 2: 2, +var obj = { + 1: true, + 2: 2, - length: { - toString: function () { - return '2'; - } - } - }; + length: { + toString: function() { + return '2'; + } + } +}; assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); assert.sameValue(Array.prototype.indexOf.call(obj, 2), -1, 'Array.prototype.indexOf.call(obj, 2)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-2.js index 8cfa825b898404ca6c6d8baa9d1adc73d7bc829e..a645ce3b0b7649fc156fed6e56d6a57f3654ac00 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-2.js @@ -9,7 +9,11 @@ description: > (value is true) ---*/ - var obj = { 0: 0, 1: 1, length: true }; +var obj = { + 0: 0, + 1: 1, + length: true +}; assert.sameValue(Array.prototype.indexOf.call(obj, 0), 0, 'Array.prototype.indexOf.call(obj, 0)'); assert.sameValue(Array.prototype.indexOf.call(obj, 1), -1, 'Array.prototype.indexOf.call(obj, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-20.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-20.js index 3479154f06fb843044ac6275f5990136a493505d..6c9c56ff27b654c781de5f8b7cb5140d0ccd7729 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-20.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-20.js @@ -9,16 +9,16 @@ description: > an own valueOf method. ---*/ - //valueOf method will be invoked first, since hint is Number - var obj = { - 1: true, - 2: 2, - length: { - valueOf: function () { - return 2; - } - } - }; +//valueOf method will be invoked first, since hint is Number +var obj = { + 1: true, + 2: 2, + length: { + valueOf: function() { + return 2; + } + } +}; assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); assert.sameValue(Array.prototype.indexOf.call(obj, 2), -1, 'Array.prototype.indexOf.call(obj, 2)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-21.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-21.js index a9ad676ad94f841425a906caef68419790df683e..f1de649c8745af291164d62a53f90178a71bac7d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-21.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-21.js @@ -10,23 +10,23 @@ description: > returns a string ---*/ - var toStringAccessed = false; - var valueOfAccessed = false; +var toStringAccessed = false; +var valueOfAccessed = false; - var obj = { - 1: true, - length: { - toString: function () { - toStringAccessed = true; - return '2'; - }, +var obj = { + 1: true, + length: { + toString: function() { + toStringAccessed = true; + return '2'; + }, - valueOf: function () { - valueOfAccessed = true; - return {}; - } - } - }; + valueOf: function() { + valueOfAccessed = true; + return {}; + } + } +}; assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); assert(toStringAccessed, 'toStringAccessed !== true'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-22.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-22.js index 5cb92837cbbba325991ae31fa891422e1c9f5189..ad43241289180bd8984a2fa3ea529863dcfd7888 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-22.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-22.js @@ -10,25 +10,25 @@ description: > primitive values ---*/ - var toStringAccessed = false; - var valueOfAccessed = false; +var toStringAccessed = false; +var valueOfAccessed = false; - var obj = { - length: { - toString: function () { - toStringAccessed = true; - return {}; - }, +var obj = { + length: { + toString: function() { + toStringAccessed = true; + return {}; + }, - valueOf: function () { - valueOfAccessed = true; - return {}; - } - } - }; + valueOf: function() { + valueOfAccessed = true; + return {}; + } + } +}; assert.throws(TypeError, function() { - Array.prototype.indexOf.call(obj); + Array.prototype.indexOf.call(obj); }); assert(toStringAccessed, 'toStringAccessed'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-23.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-23.js index 5b30d00cf6b0984132614a2f3434395db45739c1..a87a044d5feb7095db6fb0f4c873b574287e2d20 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-23.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-23.js @@ -10,29 +10,29 @@ description: > methods ---*/ - var toStringAccessed = false; - var valueOfAccessed = false; +var toStringAccessed = false; +var valueOfAccessed = false; - var proto = { - valueOf: function () { - valueOfAccessed = true; - return 2; - } - }; +var proto = { + valueOf: function() { + valueOfAccessed = true; + return 2; + } +}; - var Con = function () {}; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.toString = function () { - toStringAccessed = true; - return 2; - }; +var child = new Con(); +child.toString = function() { + toStringAccessed = true; + return 2; +}; - var obj = { - 1: true, - length: child - }; +var obj = { + 1: true, + length: child +}; assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); assert(valueOfAccessed, 'valueOfAccessed !== true'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-24.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-24.js index 539f8d669dc649ab603cb59c3ca961177717236b..109eca9ec1837db9832131d7081755f283b49640 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-24.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-24.js @@ -9,7 +9,11 @@ description: > non-integer, ensure truncation occurs in the proper direction ---*/ - var obj = { 122: true, 123: false, length: 123.321 }; //length will be 123 finally +var obj = { + 122: true, + 123: false, + length: 123.321 +}; //length will be 123 finally assert.sameValue(Array.prototype.indexOf.call(obj, true), 122, 'Array.prototype.indexOf.call(obj, true)'); assert.sameValue(Array.prototype.indexOf.call(obj, false), -1, 'Array.prototype.indexOf.call(obj, false)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-25.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-25.js index 4e275b17fbd43acce07214a393b8c0a8443075cf..d1c35a48584440adcf6efc56c2f779b587289767 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-25.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-25.js @@ -9,7 +9,11 @@ description: > non-integer ---*/ - var obj = { 1: true, 2: false, length: -4294967294.5 }; //length will be 0 finally +var obj = { + 1: true, + 2: false, + length: -4294967294.5 +}; //length will be 0 finally assert.sameValue(Array.prototype.indexOf.call(obj, true), -1, 'Array.prototype.indexOf.call(obj, true)'); assert.sameValue(Array.prototype.indexOf.call(obj, false), -1, 'Array.prototype.indexOf.call(obj, false)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-28.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-28.js index 62702eed764b628d3aa36e4fd459a3212c52afb9..b6f651f6950a81e244f5e3233300447a28e10f9a 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-28.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-28.js @@ -9,12 +9,12 @@ description: > (2^32) ---*/ - var targetObj = {}; - var obj = { - 0: targetObj, - 4294967294: targetObj, - 4294967295: targetObj, - length: 4294967296 - }; +var targetObj = {}; +var obj = { + 0: targetObj, + 4294967294: targetObj, + 4294967295: targetObj, + length: 4294967296 +}; assert.sameValue(Array.prototype.indexOf.call(obj, targetObj), 0, 'Array.prototype.indexOf.call(obj, targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-29.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-29.js index 23bb38ae782a44c3114018a382170a140f484376..41298b8a34a75104bc3707f7ee01bde782765bac 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-29.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-29.js @@ -9,12 +9,12 @@ description: > (2^32 + 1) ---*/ - var targetObj = {}; - var obj = { - 0: targetObj, - 1: 4294967297, - length: 4294967297 - }; +var targetObj = {}; +var obj = { + 0: targetObj, + 1: 4294967297, + length: 4294967297 +}; assert.sameValue(Array.prototype.indexOf.call(obj, targetObj), 0, 'Array.prototype.indexOf.call(obj, targetObj)'); assert.sameValue(Array.prototype.indexOf.call(obj, 4294967297), 1, 'Array.prototype.indexOf.call(obj, 4294967297)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-3.js index 83c239e170a2a28a53fefbf5ccfc3a124fa092a3..2db8c77fc69dbf853a09704a85171ca9a7213a4a 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-3.js @@ -9,6 +9,9 @@ description: > 0) ---*/ - var obj = { 0: true, length: 0 }; +var obj = { + 0: true, + length: 0 +}; assert.sameValue(Array.prototype.indexOf.call(obj, true), -1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-4.js index e2dc4190fa601350d2ec6828118e71097ffc0923..c2f4f22c838dbac4ca8fa673765501e0f04bc9e1 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-4.js @@ -9,6 +9,9 @@ description: > +0) ---*/ - var obj = { 0: true, length: +0 }; +var obj = { + 0: true, + length: +0 +}; assert.sameValue(Array.prototype.indexOf.call(obj, true), -1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-5.js index 6fccac8750e8dcfb0a1e07112bc6f3e7960ba4b2..4ca356c5f92ce9a395e4496760e93532d9c19f79 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-5.js @@ -9,6 +9,9 @@ description: > -0) ---*/ - var obj = { 0: true, length: -0 }; +var obj = { + 0: true, + length: -0 +}; assert.sameValue(Array.prototype.indexOf.call(obj, true), -1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-6.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-6.js index 50cc7c262cff273a27c497507e4b6fb0464dbf4c..841c6b02ed759820656e04d34084cb8e87cc0b7e 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-6.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-6.js @@ -9,7 +9,11 @@ description: > positive) ---*/ - var obj = { 3: true, 4: false, length: 4 }; +var obj = { + 3: true, + 4: false, + length: 4 +}; assert.sameValue(Array.prototype.indexOf.call(obj, true), 3, 'Array.prototype.indexOf.call(obj, true)'); assert.sameValue(Array.prototype.indexOf.call(obj, false), -1, 'Array.prototype.indexOf.call(obj, false)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-7.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-7.js index 1ff3602c0b8a28de40542156b23d24439369b726..bbc47c9817e5db322ad457f765d5e0b2bb775b3b 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-7.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-7.js @@ -9,7 +9,11 @@ description: > negative) ---*/ - var obj = { 4: true, 5: false, length: 5 - Math.pow(2, 32) }; +var obj = { + 4: true, + 5: false, + length: 5 - Math.pow(2, 32) +}; assert.sameValue(Array.prototype.indexOf.call(obj, true), -1, 'Array.prototype.indexOf.call(obj, true)'); assert.sameValue(Array.prototype.indexOf.call(obj, false), -1, 'Array.prototype.indexOf.call(obj, false)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-8.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-8.js index c7873e9ee77e665312d858cdaa777a9fb2d9f924..b7ffedc0c6a8f4165007cbf9bfeaba0030912769 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-8.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-8.js @@ -9,6 +9,9 @@ description: > Infinity) ---*/ - var obj = { 0: 0, length: Infinity }; +var obj = { + 0: 0, + length: Infinity +}; assert.sameValue(Array.prototype.indexOf.call(obj, 0), 0, 'Array.prototype.indexOf.call(obj, 0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-9.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-9.js index faf4a227c4f00458cdf8e66fbe52e3bd7925a26d..00fafbc745cc3f45a0f0647022c48000a6c09d39 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-9.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-9.js @@ -9,6 +9,9 @@ description: > -Infinity) ---*/ - var obj = { 0: 0, length: -Infinity }; +var obj = { + 0: 0, + length: -Infinity +}; assert.sameValue(Array.prototype.indexOf.call(obj, 0), -1, 'Array.prototype.indexOf.call(obj, 0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-1.js index 5b6a62eb9963de23e2e3d4972eed8dda26f155ed..7f753d7855e9ab379ad959f0af89147afd9c215f 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-1.js @@ -7,6 +7,6 @@ es5id: 15.4.4.14-4-1 description: Array.prototype.indexOf returns -1 if 'length' is 0 (empty array) ---*/ - var i = [].indexOf(42); +var i = [].indexOf(42); assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-10.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-10.js index 6af3e10a85511c0f7118d2208dc8fd6310c1cb78..47a90a22878a29009cc30b8094848f3dfe708bd7 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-10.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-10.js @@ -7,7 +7,11 @@ es5id: 15.4.4.14-4-10 description: Array.prototype.indexOf - 'length' is a number of value -6e-1 ---*/ - var targetObj = []; - var obj = { 0: targetObj, 100: targetObj, length: -6e-1 }; +var targetObj = []; +var obj = { + 0: targetObj, + 100: targetObj, + length: -6e-1 +}; assert.sameValue(Array.prototype.indexOf.call(obj, targetObj), -1, 'Array.prototype.indexOf.call(obj, targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-11.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-11.js index 3410cb85c842f034db5baf45e2d0c8b674cf453a..94da778486dc8f009b70413f9cc7aa95215772ad 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-11.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-11.js @@ -7,7 +7,11 @@ es5id: 15.4.4.14-4-11 description: Array.prototype.indexOf - 'length' is an empty string ---*/ - var targetObj = []; - var obj = { 0: targetObj, 100: targetObj, length: "" }; +var targetObj = []; +var obj = { + 0: targetObj, + 100: targetObj, + length: "" +}; assert.sameValue(Array.prototype.indexOf.call(obj, targetObj), -1, 'Array.prototype.indexOf.call(obj, targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-2.js index 485bcf04e6969a39c6f6a9683bc182512a8ed3d3..e39faf7b10f39ca3834e3b2cde92ab0541954122 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-2.js @@ -9,7 +9,9 @@ description: > overridden to null (type conversion)) ---*/ - var i = Array.prototype.indexOf.call({length: null}, 1); +var i = Array.prototype.indexOf.call({ + length: null +}, 1); assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-3.js index 535a46c8e18875eb5eeb72c0d54cbb2a880c1d5f..ccca42340fd2352d9e46ef185c65126188442955 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-3.js @@ -9,7 +9,9 @@ description: > overridden to false (type conversion)) ---*/ - var i = Array.prototype.indexOf.call({length: false}, 1); +var i = Array.prototype.indexOf.call({ + length: false +}, 1); assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-4.js index c614ca938522b63e9cc25f457721979a2f99d788..d665e97c1f0254887efd5c2398ea463ea49c7988 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-4.js @@ -9,7 +9,9 @@ description: > 'array' with length 0 ) ---*/ - var i = Array.prototype.lastIndexOf.call({length: 0}, 1); +var i = Array.prototype.lastIndexOf.call({ + length: 0 +}, 1); assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-5.js index 59512257948839ba30fc34d94c8ee5d3430c0301..7cd825ba8d9ed03ed8911a5786a4b077900ff95d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-5.js @@ -9,7 +9,9 @@ description: > overridden to '0' (type conversion)) ---*/ - var i = Array.prototype.indexOf.call({length: '0'}, 1); +var i = Array.prototype.indexOf.call({ + length: '0' +}, 1); assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-6.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-6.js index 365da0c371d4391da35eda19e65de188535380f9..bdb5f01fa1a622f40df148991b7e0feb9fbdfecd 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-6.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-6.js @@ -9,7 +9,13 @@ description: > Array, length overridden with obj with valueOf) ---*/ - var i = Array.prototype.indexOf.call({length: { valueOf: function () { return 0;}}}, 1); +var i = Array.prototype.indexOf.call({ + length: { + valueOf: function() { + return 0; + } + } +}, 1); assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-7.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-7.js index ed4cf9894714814e8da2cdb55c224b7ac087d2f7..c6c14d7736334812e7d3c38245edeeb2a14734a3 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-7.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-7.js @@ -9,12 +9,18 @@ description: > object overridden with obj w/o valueOf (toString)) ---*/ - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - var i = Array.prototype.indexOf.call({length: { toString: function () { return '0';}}}, 1); +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +var i = Array.prototype.indexOf.call({ + length: { + toString: function() { + return '0'; + } + } +}, 1); assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-8.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-8.js index 04ad4c7fb6ea107edfefb20ef08a95bfec989f62..2c863ea4902c891ec422e286f9bdd4c28d813fea 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-8.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-8.js @@ -9,20 +9,22 @@ description: > empty array) ---*/ - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - // - // The toString( ) method on Array converts the array elements to strings, - // then returns the result of concatenating these strings, with commas in - // between. An array with no elements converts to the empty string, which - // converts to the number 0. If an array has a single element that is a - // number n, the array converts to a string representation of n, which is - // then converted back to n itself. If an array contains more than one element, - // or if its one element is not a number, the array converts to NaN. - var i = Array.prototype.indexOf.call({length: [ ]}, 1); +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +// +// The toString( ) method on Array converts the array elements to strings, +// then returns the result of concatenating these strings, with commas in +// between. An array with no elements converts to the empty string, which +// converts to the number 0. If an array has a single element that is a +// number n, the array converts to a string representation of n, which is +// then converted back to n itself. If an array contains more than one element, +// or if its one element is not a number, the array converts to NaN. +var i = Array.prototype.indexOf.call({ + length: [] +}, 1); assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-9.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-9.js index e90ce2e4c9223b59196d21ffde50c8258dfdc4db..b64c1213aa8fc396322d80318594580557de7e5b 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-9.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-9.js @@ -7,7 +7,11 @@ es5id: 15.4.4.14-4-9 description: Array.prototype.indexOf - 'length' is a number of value 0.1 ---*/ - var targetObj = []; - var obj = { 0: targetObj, 100: targetObj, length: 0.1 }; +var targetObj = []; +var obj = { + 0: targetObj, + 100: targetObj, + length: 0.1 +}; assert.sameValue(Array.prototype.indexOf.call(obj, targetObj), -1, 'Array.prototype.indexOf.call(obj, targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-1.js index 146456dbab5d71f755b6ba080e6f649f065a557b..bfb7c07cdf0f5dbdc4d7b84d4dacbc5cf3c0b42d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-1.js @@ -7,7 +7,7 @@ es5id: 15.4.4.14-5-1 description: Array.prototype.indexOf when fromIndex is string ---*/ - var a = [1,2,1,2,1,2]; +var a = [1, 2, 1, 2, 1, 2]; -assert.sameValue(a.indexOf(2,"2"), 3, '"2" resolves to 2'); -assert.sameValue(a.indexOf(2,"one"), 1, '"one" resolves to 0'); +assert.sameValue(a.indexOf(2, "2"), 3, '"2" resolves to 2'); +assert.sameValue(a.indexOf(2, "one"), 1, '"one" resolves to 0'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-10.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-10.js index 7c006a5d04a60d2408b2b5ed79163cb97dfb9583..4ec2ce2a055b166b03abc1b6810f8e9ddf79a5af 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-10.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-10.js @@ -9,7 +9,7 @@ description: > is positive number) ---*/ - var targetObj = {}; +var targetObj = {}; assert.sameValue([0, targetObj, 2].indexOf(targetObj, 2), -1, '[0, targetObj, 2].indexOf(targetObj, 2)'); assert.sameValue([0, 1, targetObj].indexOf(targetObj, 2), 2, '[0, 1, targetObj].indexOf(targetObj, 2)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-11.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-11.js index e8dccbd1d9fc95f7d5e9d7b6d2e31500403c9ba5..873dcea1901ca90a29c6bf5095d49a9bc8038e11 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-11.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-11.js @@ -9,7 +9,7 @@ description: > is negative number) ---*/ - var targetObj = {}; +var targetObj = {}; assert.sameValue([0, targetObj, 2].indexOf(targetObj, -1), -1, '[0, targetObj, 2].indexOf(targetObj, -1)'); assert.sameValue([0, 1, targetObj].indexOf(targetObj, -1), 2, '[0, 1, targetObj].indexOf(targetObj, -1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-12.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-12.js index dbdc234eb5c4b53bbd7fad42346fc525aa0b8458..ef4baf22eb870fd0ff846c8aee2ea97a7f72aa90 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-12.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-12.js @@ -9,7 +9,7 @@ description: > is Infinity) ---*/ - var arr = []; - arr[Math.pow(2, 32) - 2] = true; //length is the max value of Uint type +var arr = []; +arr[Math.pow(2, 32) - 2] = true; //length is the max value of Uint type assert.sameValue(arr.indexOf(true, Infinity), -1, 'arr.indexOf(true, Infinity)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-16.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-16.js index 68e8cbe5fe43b8b2c55412dca5288fd4b6733ce4..6f9afde36afc4a8748746dd86393ecc546ffb6d5 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-16.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-16.js @@ -9,7 +9,7 @@ description: > containing Infinity ---*/ - var arr = []; - arr[Math.pow(2, 32) - 2] = true; //length is the max value of Uint type +var arr = []; +arr[Math.pow(2, 32) - 2] = true; //length is the max value of Uint type assert.sameValue(arr.indexOf(true, "Infinity"), -1, 'arr.indexOf(true, "Infinity")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-18.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-18.js index 7729f74b5fe3ec3bf062c43bef1ff1be7d8f1247..66bfabd2fa528efe085353ce2444e15dd7f1d402 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-18.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-18.js @@ -9,7 +9,7 @@ description: > containing an exponential number ---*/ - var targetObj = {}; +var targetObj = {}; assert.sameValue([0, 1, targetObj, 3, 4].indexOf(targetObj, "3E0"), -1, '[0, 1, targetObj, 3, 4].indexOf(targetObj, "3E0")'); assert.sameValue([0, 1, 2, targetObj, 4].indexOf(targetObj, "3E0"), 3, '[0, 1, 2, targetObj, 4].indexOf(targetObj, "3E0")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-19.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-19.js index ef2936fb7bbb1ee1d454a359804cfb7b124ec393..123b1304f71321e5cbcb81df7cd8d750bdfb60f6 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-19.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-19.js @@ -9,7 +9,7 @@ description: > containing a hex number ---*/ - var targetObj = {}; +var targetObj = {}; assert.sameValue([0, 1, targetObj, 3, 4].indexOf(targetObj, "0x0003"), -1, '[0, 1, targetObj, 3, 4].indexOf(targetObj, "0x0003")'); assert.sameValue([0, 1, 2, targetObj, 4].indexOf(targetObj, "0x0003"), 3, '[0, 1, 2, targetObj, 4].indexOf(targetObj, "0x0003")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-2.js index 6fbcc5ced6aaeedd78e551ed5d7508d7bb296d1d..092e4127f6ece202a0476230bd167a03c2b6035e 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-2.js @@ -7,8 +7,8 @@ es5id: 15.4.4.14-5-2 description: Array.prototype.indexOf when fromIndex is floating point number ---*/ - var a = new Array(1,2,3); +var a = new Array(1, 2, 3); -assert.sameValue(a.indexOf(3,0.49), 2, '0.49 resolves to 0'); -assert.sameValue(a.indexOf(1,0.51), 0, '0.51 resolves to 0'); -assert.sameValue(a.indexOf(1,1.51), -1, '1.51 resolves to 1'); +assert.sameValue(a.indexOf(3, 0.49), 2, '0.49 resolves to 0'); +assert.sameValue(a.indexOf(1, 0.51), 0, '0.51 resolves to 0'); +assert.sameValue(a.indexOf(1, 1.51), -1, '1.51 resolves to 1'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-20.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-20.js index 0471343e27d2f9ae8c7791f6ab3029c2769bb5f5..106b630ba1e9de3499bfd7d2db973d63fe504d73 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-20.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-20.js @@ -9,7 +9,7 @@ description: > containing a number with leading zeros ---*/ - var targetObj = {}; +var targetObj = {}; assert.sameValue([0, 1, targetObj, 3, 4].indexOf(targetObj, "0003.10"), -1, '[0, 1, targetObj, 3, 4].indexOf(targetObj, "0003.10")'); assert.sameValue([0, 1, 2, targetObj, 4].indexOf(targetObj, "0003.10"), 3, '[0, 1, 2, targetObj, 4].indexOf(targetObj, "0003.10")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-21.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-21.js index 05fbacd4df63d4f80f59ee01dd0f8baeea8ad362..887de235ac838af26654ffb0bbb46de90e725c39 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-21.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-21.js @@ -9,15 +9,15 @@ description: > has an own toString method ---*/ - // objects inherit the default valueOf() method from Object - // that simply returns itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - var fromIndex = { - toString: function () { - return '1'; - } - }; +// objects inherit the default valueOf() method from Object +// that simply returns itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +var fromIndex = { + toString: function() { + return '1'; + } +}; assert.sameValue([0, true].indexOf(true, fromIndex), 1, '[0, true].indexOf(true, fromIndex)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-22.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-22.js index 21bb6b03a73a96e2151364edce8c3cbb4e7adf6e..e1ed1319783d49c0d040d8c6da083a5d6f71ca27 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-22.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-22.js @@ -9,11 +9,11 @@ description: > has an own valueOf method ---*/ - var fromIndex = { - valueOf: function () { - return 1; - } - }; +var fromIndex = { + valueOf: function() { + return 1; + } +}; assert.sameValue([0, true].indexOf(true, fromIndex), 1, '[0, true].indexOf(true, fromIndex)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-23.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-23.js index 64f186fc817f3fae214db5119b97ccd7d7a5521f..8bfad2363fdf65117946dcd97f1bf8baf045086a 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-23.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-23.js @@ -10,20 +10,20 @@ description: > method that returns a string ---*/ - var toStringAccessed = false; - var valueOfAccessed = false; +var toStringAccessed = false; +var valueOfAccessed = false; - var fromIndex = { - toString: function () { - toStringAccessed = true; - return '1'; - }, +var fromIndex = { + toString: function() { + toStringAccessed = true; + return '1'; + }, - valueOf: function () { - valueOfAccessed = true; - return {}; - } - }; + valueOf: function() { + valueOfAccessed = true; + return {}; + } +}; assert.sameValue([0, true].indexOf(true, fromIndex), 1, '[0, true].indexOf(true, fromIndex)'); assert(toStringAccessed, 'toStringAccessed !== true'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-24.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-24.js index 3f83428a20a0eb81ef876152c9fee23722e513c7..881197259db59d11c53d723124fec699ae09b225 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-24.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-24.js @@ -10,22 +10,22 @@ description: > don�t return primitive values ---*/ - var toStringAccessed = false; - var valueOfAccessed = false; - var fromIndex = { - toString: function () { - toStringAccessed = true; - return {}; - }, +var toStringAccessed = false; +var valueOfAccessed = false; +var fromIndex = { + toString: function() { + toStringAccessed = true; + return {}; + }, - valueOf: function () { - valueOfAccessed = true; - return {}; - } - }; + valueOf: function() { + valueOfAccessed = true; + return {}; + } +}; assert.throws(TypeError, function() { - [0, true].indexOf(true, fromIndex); + [0, true].indexOf(true, fromIndex); }); assert(toStringAccessed, 'toStringAccessed'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-25.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-25.js index a8139b75124735529e969f4e0fb481760c240ba8..f3943fc4905c4faace6ecaf3703a40a44189e913 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-25.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-25.js @@ -10,24 +10,24 @@ description: > valueOf methods ---*/ - var toStringAccessed = false; - var valueOfAccessed = false; +var toStringAccessed = false; +var valueOfAccessed = false; - var proto = { - valueOf: function () { - valueOfAccessed = true; - return 1; - } - }; +var proto = { + valueOf: function() { + valueOfAccessed = true; + return 1; + } +}; - var Con = function () {}; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.toString = function () { - toStringAccessed = true; - return 2; - }; +var child = new Con(); +child.toString = function() { + toStringAccessed = true; + return 2; +}; assert.sameValue([0, true].indexOf(true, child), 1, '[0, true].indexOf(true, child)'); assert(valueOfAccessed, 'valueOfAccessed !== true'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-26.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-26.js index 6c66928cee0272c61968c7e1118ff44ba6d505b5..43307ad73465c84d0c0b90fb6ce43c1a3f755eb0 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-26.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-26.js @@ -9,30 +9,30 @@ description: > visible when an exception occurs ---*/ - var stepTwoOccurs = false; - var stepFiveOccurs = false; +var stepTwoOccurs = false; +var stepFiveOccurs = false; - var obj = {}; +var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - stepTwoOccurs = true; - if (stepFiveOccurs) { - throw new Error("Step 5 occurred out of order"); - } - return 20; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + stepTwoOccurs = true; + if (stepFiveOccurs) { + throw new Error("Step 5 occurred out of order"); + } + return 20; + }, + configurable: true +}); - var fromIndex = { - valueOf: function () { - stepFiveOccurs = true; - return 0; - } - }; +var fromIndex = { + valueOf: function() { + stepFiveOccurs = true; + return 0; + } +}; - Array.prototype.indexOf.call(obj, undefined, fromIndex); +Array.prototype.indexOf.call(obj, undefined, fromIndex); assert(stepTwoOccurs, 'stepTwoOccurs !== true'); assert(stepFiveOccurs, 'stepFiveOccurs !== true'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-27.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-27.js index 0207afac1e74e8a3b854adf4c58bf5c991a6bcd3..ec03ca8394e8892f652eafcda00e9ae98d7ce31c 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-27.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-27.js @@ -9,34 +9,34 @@ description: > visible when an exception occurs ---*/ - var stepThreeOccurs = false; - var stepFiveOccurs = false; +var stepThreeOccurs = false; +var stepFiveOccurs = false; - var obj = {}; +var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - return { - valueOf: function () { - stepThreeOccurs = true; - if (stepFiveOccurs) { - throw new Error("Step 5 occurred out of order"); - } - return 20; - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + valueOf: function() { + stepThreeOccurs = true; + if (stepFiveOccurs) { + throw new Error("Step 5 occurred out of order"); + } + return 20; + } + }; + }, + configurable: true +}); - var fromIndex = { - valueOf: function () { - stepFiveOccurs = true; - return 0; - } - }; +var fromIndex = { + valueOf: function() { + stepFiveOccurs = true; + return 0; + } +}; - Array.prototype.indexOf.call(obj, undefined, fromIndex); +Array.prototype.indexOf.call(obj, undefined, fromIndex); assert(stepThreeOccurs, 'stepThreeOccurs !== true'); assert(stepFiveOccurs, 'stepFiveOccurs !== true'); 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 9e838354597ddcaffb5282877b2b165a516a9112..71adbb3478357c155ee880ee2e5b45d6fdb3d5dc 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 @@ -9,14 +9,14 @@ description: > visible when an exception occurs ---*/ - var stepFiveOccurs = false; - var fromIndex = { - valueOf: function () { - stepFiveOccurs = true; - return 0; - } - }; +var stepFiveOccurs = false; +var fromIndex = { + valueOf: function() { + stepFiveOccurs = true; + return 0; + } +}; assert.throws(TypeError, function() { - Array.prototype.indexOf.call(undefined, undefined, fromIndex); + Array.prototype.indexOf.call(undefined, undefined, fromIndex); }); 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 30381433b86c0ef98fec23e094cf1b97df6edba9..373bbc7e50c1372caf52f455290e22c68f67dc77 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 @@ -9,23 +9,23 @@ description: > visible when an exception occurs ---*/ - var stepFiveOccurs = false; +var stepFiveOccurs = false; - var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - throw new RangeError(); - }, - configurable: true - }); +var obj = {}; +Object.defineProperty(obj, "length", { + get: function() { + throw new RangeError(); + }, + configurable: true +}); - var fromIndex = { - valueOf: function () { - stepFiveOccurs = true; - return 0; - } - }; +var fromIndex = { + valueOf: function() { + stepFiveOccurs = true; + return 0; + } +}; assert.throws(RangeError, function() { - Array.prototype.indexOf.call(obj, undefined, fromIndex); + Array.prototype.indexOf.call(obj, undefined, fromIndex); }); assert.sameValue(stepFiveOccurs, false, 'stepFiveOccurs'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-3.js index 9030d5314c9de0ccfa5ffb5b5c9db13022f0d36d..f9ec42cc876f4ef55244aa5068ad13eda69a8e25 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-3.js @@ -7,7 +7,7 @@ es5id: 15.4.4.14-5-3 description: Array.prototype.indexOf when fromIndex is boolean ---*/ - var a = [1,2,3]; +var a = [1, 2, 3]; -assert.sameValue(a.indexOf(1,true), -1, 'true resolves to 1'); -assert.sameValue(a.indexOf(1,false), 0, 'false resolves to 0'); +assert.sameValue(a.indexOf(1, true), -1, 'true resolves to 1'); +assert.sameValue(a.indexOf(1, false), 0, 'false resolves to 0'); 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 9a229e976cf36986938bc0b2783dcb0952530386..d3eac966c0979f6e8dedab9938c08b27f675c7c0 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 @@ -9,27 +9,27 @@ description: > visible when an exception occurs ---*/ - var stepFiveOccurs = false; +var stepFiveOccurs = false; - var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - return { - valueOf: function () { - throw new TypeError(); - } - }; - }, - configurable: true - }); +var obj = {}; +Object.defineProperty(obj, "length", { + get: function() { + return { + valueOf: function() { + throw new TypeError(); + } + }; + }, + configurable: true +}); - var fromIndex = { - valueOf: function () { - stepFiveOccurs = true; - return 0; - } - }; +var fromIndex = { + valueOf: function() { + stepFiveOccurs = true; + return 0; + } +}; assert.throws(TypeError, function() { - Array.prototype.indexOf.call(obj, undefined, fromIndex); + Array.prototype.indexOf.call(obj, undefined, fromIndex); }); assert.sameValue(stepFiveOccurs, false, 'stepFiveOccurs'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-31.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-31.js index 9a7f1d3ff56b1a3fbee8fee91e8d3406c4c2b44a..64442d0db8babc78f5171a9a251c896e6509753f 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-31.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-31.js @@ -9,7 +9,7 @@ description: > verify truncation occurs in the proper direction ---*/ - var targetObj = {}; +var targetObj = {}; assert.sameValue([0, targetObj, 2].indexOf(targetObj, 2.5), -1, '[0, targetObj, 2].indexOf(targetObj, 2.5)'); assert.sameValue([0, 1, targetObj].indexOf(targetObj, 2.5), 2, '[0, 1, targetObj].indexOf(targetObj, 2.5)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-32.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-32.js index df4812b786c8aac5246a33b171ab3df192c39e33..a11186d51e472d98ee67ccbd32126b6b0409016d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-32.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-32.js @@ -9,7 +9,7 @@ description: > verify truncation occurs in the proper direction ---*/ - var targetObj = {}; +var targetObj = {}; assert.sameValue([0, targetObj, 2].indexOf(targetObj, -1.5), -1, '[0, targetObj, 2].indexOf(targetObj, -1.5)'); assert.sameValue([0, 1, targetObj].indexOf(targetObj, -1.5), 2, '[0, 1, targetObj].indexOf(targetObj, -1.5)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-4.js index 3611b179928ef1a98b162309650a5ed293de8cc4..4230ef2bc02e415d2e47e1959de3db9d224b5ae2 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-4.js @@ -7,7 +7,7 @@ es5id: 15.4.4.14-5-4 description: Array.prototype.indexOf returns 0 if fromIndex is 'undefined' ---*/ - var a = [1,2,3]; +var a = [1, 2, 3]; // undefined resolves to 0 -assert.sameValue(a.indexOf(1,undefined), 0, 'a.indexOf(1,undefined)'); +assert.sameValue(a.indexOf(1, undefined), 0, 'a.indexOf(1,undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-5.js index 9056a5fe9448d2db39967e07bcb40707f93931a8..4cd4418d56d020a848129fa30280fc0336101872 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-5.js @@ -7,7 +7,7 @@ es5id: 15.4.4.14-5-5 description: Array.prototype.indexOf returns 0 if fromIndex is null ---*/ - var a = [1,2,3]; +var a = [1, 2, 3]; // null resolves to 0 -assert.sameValue(a.indexOf(1,null), 0, 'a.indexOf(1,null)'); +assert.sameValue(a.indexOf(1, null), 0, 'a.indexOf(1,null)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-6.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-6.js index 69610b347ada8c6870d0a5779573d86819b837b1..2ea05b825eccbee006ca146e208b6be02e530865 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-6.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-6.js @@ -7,8 +7,8 @@ es5id: 15.4.4.14-5-6 description: Array.prototype.indexOf - 'fromIndex' isn't passed ---*/ - var arr = [0, 1, 2, 3, 4]; - //'fromIndex' will be set as 0 if not passed by default +var arr = [0, 1, 2, 3, 4]; +//'fromIndex' will be set as 0 if not passed by default assert.sameValue(arr.indexOf(0), arr.indexOf(0, 0), 'arr.indexOf(0)'); assert.sameValue(arr.indexOf(2), arr.indexOf(2, 0), 'arr.indexOf(2)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-6-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-6-1.js index f2da76943c08e5064b09a4fc860bb73369120fd6..1309ad967ada31f4b9128bba890ecd7525881662 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-6-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-6-1.js @@ -9,8 +9,8 @@ description: > Array length ---*/ - var a = [1,2,3]; +var a = [1, 2, 3]; -assert.sameValue(a.indexOf(1,5), -1, 'a.indexOf(1,5)'); -assert.sameValue(a.indexOf(1,3), -1, 'a.indexOf(1,3)'); -assert.sameValue([ ].indexOf(1,0), -1, '[ ].indexOf(1,0)'); +assert.sameValue(a.indexOf(1, 5), -1, 'a.indexOf(1,5)'); +assert.sameValue(a.indexOf(1, 3), -1, 'a.indexOf(1,3)'); +assert.sameValue([].indexOf(1, 0), -1, '[ ].indexOf(1,0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-1.js index 57d4f191db518812d3655a13b09fc87181b17e64..4531f805196c1cb7a0533eb8273a49264d3ce18e 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-1.js @@ -7,10 +7,10 @@ es5id: 15.4.4.14-8-1 description: Array.prototype.indexOf with negative fromIndex ---*/ - var a = new Array(1,2,3); +var a = new Array(1, 2, 3); -assert.sameValue(a.indexOf(2,-1), -1, 'a.indexOf(2,-1)'); -assert.sameValue(a.indexOf(2,-2), 1, 'a.indexOf(2,-2)'); -assert.sameValue(a.indexOf(1,-3), 0, 'a.indexOf(1,-3)'); -assert.sameValue(a.indexOf(1,-5.3), 0, 'a.indexOf(1,-5.3)'); +assert.sameValue(a.indexOf(2, -1), -1, 'a.indexOf(2,-1)'); +assert.sameValue(a.indexOf(2, -2), 1, 'a.indexOf(2,-2)'); +assert.sameValue(a.indexOf(1, -3), 0, 'a.indexOf(1,-3)'); +assert.sameValue(a.indexOf(1, -5.3), 0, 'a.indexOf(1,-5.3)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-1.js index 94125fa8177c8ac1c545fca2e2859c02cbce8321..91a596078f68c616da9fe092297689f5ad38ab5b 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-1.js @@ -7,9 +7,13 @@ es5id: 15.4.4.14-9-1 description: Array.prototype.indexOf must return correct index (boolean) ---*/ - var obj = {toString:function (){return true}}; - var _false = false; - var a = [obj,"true", undefined,0,_false,null,1,"str",0,1,true,false,true,false]; +var obj = { + toString: function() { + return true + } +}; +var _false = false; +var a = [obj, "true", undefined, 0, _false, null, 1, "str", 0, 1, true, false, true, false]; - assert.sameValue(a.indexOf(true), 10, 'a[10]=true'); - assert.sameValue(a.indexOf(false), 4, 'a[4] =_false'); +assert.sameValue(a.indexOf(true), 10, 'a[10]=true'); +assert.sameValue(a.indexOf(false), 4, 'a[4] =_false'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-10.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-10.js index 4b3ec82c6abcf3912825aea3576326ff9bb52969..92ebaa80aa766f2c1e4fb89996e0fb28bc607213 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-10.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-10.js @@ -10,7 +10,11 @@ es5id: 15.4.4.14-9-10 description: Array.prototype.indexOf must return correct index (NaN) ---*/ - var _NaN = NaN; - var a = new Array("NaN",undefined,0,false,null,{toString:function (){return NaN}},"false",_NaN,NaN); +var _NaN = NaN; +var a = new Array("NaN", undefined, 0, false, null, { + toString: function() { + return NaN + } +}, "false", _NaN, NaN); assert.sameValue(a.indexOf(NaN), -1, 'NaN is equal to nothing, including itself.'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-11.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-11.js index cf1aac54125810e4920a470001cff0e5f5569a6e..77108424d9bd4870eaf9f56306183cb89f577d53 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-11.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-11.js @@ -9,14 +9,14 @@ description: > adding elements to the array during iteration ---*/ - var arr = [20]; +var arr = [20]; - Object.defineProperty(arr, "0", { - get: function () { - arr[1] = 1; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + arr[1] = 1; + return 0; + }, + configurable: true +}); assert.sameValue(arr.indexOf(1), -1, 'arr.indexOf(1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-2.js index fcce013d2c05c93979726c4daf87b368818a255b..410a7c0ef10243a6b2c9a4561678eff56289ea3d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-2.js @@ -7,12 +7,16 @@ es5id: 15.4.4.14-9-2 description: Array.prototype.indexOf must return correct index (Number) ---*/ - var obj = {toString:function (){return 0}}; - var one = 1; - var _float = -(4/3); - var a = new Array(false,undefined,null,"0",obj,-1.3333333333333, "str",-0,true,+0, one, 1,0, false, _float, -(4/3)); +var obj = { + toString: function() { + return 0 + } +}; +var one = 1; +var _float = -(4 / 3); +var a = new Array(false, undefined, null, "0", obj, -1.3333333333333, "str", -0, true, +0, one, 1, 0, false, _float, -(4 / 3)); -assert.sameValue(a.indexOf(-(4/3)), 14, 'a[14]=_float===-(4/3)'); +assert.sameValue(a.indexOf(-(4 / 3)), 14, 'a[14]=_float===-(4/3)'); assert.sameValue(a.indexOf(0), 7, 'a[7] = +0, 0===+0'); assert.sameValue(a.indexOf(-0), 7, 'a[7] = +0, -0===+0'); assert.sameValue(a.indexOf(1), 10, 'a[10] =one=== 1'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-3.js index 3c83a98d95627135ffe0834919092fef4bb5d2e6..8b4ff007cce7b29ece5f5361cc1fbae0479ad80a 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-3.js @@ -7,8 +7,12 @@ es5id: 15.4.4.14-9-3 description: Array.prototype.indexOf must return correct index(string) ---*/ - var obj = {toString:function (){return "false"}}; - var szFalse = "false"; - var a = new Array("false1",undefined,0,false,null,1,obj,0,szFalse, "false"); +var obj = { + toString: function() { + return "false" + } +}; +var szFalse = "false"; +var a = new Array("false1", undefined, 0, false, null, 1, obj, 0, szFalse, "false"); assert.sameValue(a.indexOf("false"), 8, 'a[8]=szFalse'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-4.js index d0b3a3a3efe19574f6f4a168890612ca22e30ff4..697f9196785efae635e3c045971d20c32ee4dc38 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-4.js @@ -7,9 +7,13 @@ es5id: 15.4.4.14-9-4 description: Array.prototype.indexOf must return correct index(undefined) ---*/ - var obj = {toString:function (){return undefined;}}; - var _undefined1 = undefined; - var _undefined2; - var a = new Array(true,0,false,null,1,"undefined",obj,1,_undefined2,_undefined1,undefined); +var obj = { + toString: function() { + return undefined; + } +}; +var _undefined1 = undefined; +var _undefined2; +var a = new Array(true, 0, false, null, 1, "undefined", obj, 1, _undefined2, _undefined1, undefined); assert.sameValue(a.indexOf(undefined), 8, 'a[8]=_undefined2'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-5.js index 3a31b1477a79496b1bf91af882f6a2a444f348d9..8537c3ac30b3b7a4edaecb05ff12c6b2921e3b79 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-5.js @@ -7,9 +7,21 @@ es5id: 15.4.4.14-9-5 description: Array.prototype.indexOf must return correct index (Object) ---*/ - var obj1 = {toString:function (){return "false"}}; - var obj2 = {toString:function (){return "false"}}; - var obj3 = obj1; - var a = new Array(false,undefined,0,false,null,{toString:function (){return "false"}},"false",obj2,obj1,obj3); +var obj1 = { + toString: function() { + return "false" + } +}; +var obj2 = { + toString: function() { + return "false" + } +}; +var obj3 = obj1; +var a = new Array(false, undefined, 0, false, null, { + toString: function() { + return "false" + } +}, "false", obj2, obj1, obj3); assert.sameValue(a.indexOf(obj3), 8, 'a[8] = obj1'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-6.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-6.js index adb3280e8a9c4fcbc5a60d54d69b9073cca9d129..cb657505bbd65a0b11ffd638fb6c391a004377ce 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-6.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-6.js @@ -7,8 +7,12 @@ es5id: 15.4.4.14-9-6 description: Array.prototype.indexOf must return correct index(null) ---*/ - var obj = {toString:function (){return null}}; - var _null = null; - var a = new Array(true,undefined,0,false,_null,1,"str",0,1,obj,true,false,null); +var obj = { + toString: function() { + return null + } +}; +var _null = null; +var a = new Array(true, undefined, 0, false, _null, 1, "str", 0, 1, obj, true, false, null); assert.sameValue(a.indexOf(null), 4, 'a[4]=_null'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-7.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-7.js index 33bf64933bf7ab1e21f80cd1460c94b32b581148..0a8028b4e772ffd5df799662c7584614524f60f5 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-7.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-7.js @@ -7,8 +7,8 @@ es5id: 15.4.4.14-9-7 description: Array.prototype.indexOf must return correct index (self reference) ---*/ - var a = new Array(0,1,2,3); - a[2] = a; +var a = new Array(0, 1, 2, 3); +a[2] = a; assert.sameValue(a.indexOf(a), 2, 'a.indexOf(a)'); assert.sameValue(a.indexOf(3), 3, 'a.indexOf(3)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-8.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-8.js index 86889e43727b55e78cb76c3544c9751824d18963..7e07ce058f78358e51aed526d228ff1a25dfa506 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-8.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-8.js @@ -7,8 +7,8 @@ es5id: 15.4.4.14-9-8 description: Array.prototype.indexOf must return correct index (Array) ---*/ - var b = new Array("0,1"); - var a = new Array(0,b,"0,1",3); +var b = new Array("0,1"); +var a = new Array(0, b, "0,1", 3); assert.sameValue(a.indexOf(b.toString()), 2, 'a.indexOf(b.toString())'); assert.sameValue(a.indexOf("0,1"), 2, 'a.indexOf("0,1")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-9.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-9.js index 82fc8113c12506de1ad4d1b35b71c3510616639f..800f568bf46a89487666238fe53fbec5f7f0eec5 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-9.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-9.js @@ -7,15 +7,15 @@ es5id: 15.4.4.14-9-9 description: Array.prototype.indexOf must return correct index (Sparse Array) ---*/ - var a = new Array(0,1); - a[4294967294] = 2; // 2^32-2 - is max array element - a[4294967295] = 3; // 2^32-1 added as non-array element property - a[4294967296] = 4; // 2^32 added as non-array element property - a[4294967297] = 5; // 2^32+1 added as non-array element property +var a = new Array(0, 1); +a[4294967294] = 2; // 2^32-2 - is max array element +a[4294967295] = 3; // 2^32-1 added as non-array element property +a[4294967296] = 4; // 2^32 added as non-array element property +a[4294967297] = 5; // 2^32+1 added as non-array element property - // start searching near the end so in case implementation actually tries to test all missing elements!! +// start searching near the end so in case implementation actually tries to test all missing elements!! -assert.sameValue(a.indexOf(2,4294967290 ), 4294967294, 'a.indexOf(2,4294967290 )'); -assert.sameValue(a.indexOf(3,4294967290), -1, 'a.indexOf(3,4294967290)'); -assert.sameValue(a.indexOf(4,4294967290), -1, 'a.indexOf(4,4294967290)'); -assert.sameValue(a.indexOf(5,4294967290), -1, 'a.indexOf(5,4294967290)'); +assert.sameValue(a.indexOf(2, 4294967290), 4294967294, 'a.indexOf(2,4294967290 )'); +assert.sameValue(a.indexOf(3, 4294967290), -1, 'a.indexOf(3,4294967290)'); +assert.sameValue(a.indexOf(4, 4294967290), -1, 'a.indexOf(4,4294967290)'); +assert.sameValue(a.indexOf(5, 4294967290), -1, 'a.indexOf(5,4294967290)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-1.js index 0d17a2be4b5f86d652128f16607f7fae7fffecbb..043314c60706d7ebfb3dc8bffb619d16a5f3451b 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-1.js @@ -9,14 +9,14 @@ description: > here ---*/ - var arr = { }; +var arr = {}; - Object.defineProperty(arr, "length", { - get: function () { - arr[2] = "length"; - return 3; - }, - configurable: true - }); +Object.defineProperty(arr, "length", { + get: function() { + arr[2] = "length"; + return 3; + }, + configurable: true +}); assert.sameValue(Array.prototype.indexOf.call(arr, "length"), 2, 'Array.prototype.indexOf.call(arr, "length")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-10.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-10.js index ff6b0a9c8e60fbf2ad588f843e5947b28b2edb59..4a2797e620ebd6b2ff74f3f4e3b9ade56da2c232 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-10.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-10.js @@ -9,19 +9,19 @@ description: > after current position are visited on an Array ---*/ - var arr = [0, , 2]; +var arr = [0, , 2]; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(Array.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(Array.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); assert.sameValue(arr.indexOf(6.99), 1, 'arr.indexOf(6.99)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-11.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-11.js index 6e9587d5a8ecc6e303a15db8968131466e1e30f8..65e50432535a946a5077d72ef325484b443fdc44 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-11.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-11.js @@ -9,21 +9,23 @@ description: > property not to be visited on an Array-like object ---*/ - var arr = { length: 2 }; +var arr = { + length: 2 +}; - Object.defineProperty(arr, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + return 6.99; + }, + configurable: true +}); - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); assert.sameValue(Array.prototype.indexOf.call(arr, 6.99), -1, 'Array.prototype.indexOf.call(arr, 6.99)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-12.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-12.js index 172dd11336cc1e63696ab216ce63706a8726dc63..d07f4a7102ecc9a18e64f266bacebd32c29d602d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-12.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-12.js @@ -9,21 +9,21 @@ description: > property not to be visited on an Array ---*/ - var arr = [1, 2]; +var arr = [1, 2]; - Object.defineProperty(arr, "1", { - get: function () { - return "6.99"; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + return "6.99"; + }, + configurable: true +}); - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); assert.sameValue(arr.indexOf("6.99"), -1, 'arr.indexOf("6.99")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-13.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-13.js index 2390e6e7f5895a97ea4896d6897cc5729b04e17d..f45f555cf6c3325be22536cfec209a2bf5fa46d8 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-13.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-13.js @@ -9,16 +9,19 @@ description: > prototype index property not to be visited on an Array-like Object ---*/ - var arr = { 2: 2, length: 20 }; +var arr = { + 2: 2, + length: 20 +}; - Object.defineProperty(arr, "0", { - get: function () { - delete Object.prototype[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete Object.prototype[1]; + return 0; + }, + configurable: true +}); - Object.prototype[1] = 1; +Object.prototype[1] = 1; assert.sameValue(Array.prototype.indexOf.call(arr, 1), -1, 'Array.prototype.indexOf.call(arr, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-14.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-14.js index 81cbe7b98891525a2086d43161b57f82087bc36a..216e4da0b3226240e4e82cafe39c725f99142dd2 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-14.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-14.js @@ -9,16 +9,16 @@ description: > prototype index property not to be visited on an Array ---*/ - var arr = [0, , 2]; +var arr = [0, , 2]; - Object.defineProperty(arr, "0", { - get: function () { - delete Array.prototype[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete Array.prototype[1]; + return 0; + }, + configurable: true +}); - Array.prototype[1] = 1; +Array.prototype[1] = 1; assert.sameValue(arr.indexOf(1), -1, 'arr.indexOf(1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-15.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-15.js index c7c60d7c43753fbe3bae56ed30905a2d8467011b..5c5be6dc92b1c8c195475f92572eaebc1aeb0acd 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-15.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-15.js @@ -10,16 +10,21 @@ description: > Array-like object ---*/ - var arr = { 0: 0, 1: 111, 2: 2, length: 10 }; +var arr = { + 0: 0, + 1: 111, + 2: 2, + length: 10 +}; - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); - Object.prototype[1] = 1; +Object.prototype[1] = 1; assert.sameValue(Array.prototype.indexOf.call(arr, 1), 1, 'Array.prototype.indexOf.call(arr, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-16.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-16.js index 707207440eb58b320ad076d65cf10da8b11c4682..ed4072719df1bb5acd19da0399232dceefbe6324 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-16.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-16.js @@ -9,16 +9,16 @@ description: > property causes prototype index property to be visited on an Array ---*/ - var arr = [0, 111, 2]; +var arr = [0, 111, 2]; - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); - Array.prototype[1] = 1; +Array.prototype[1] = 1; assert.sameValue(arr.indexOf(1), 1, 'arr.indexOf(1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-17.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-17.js index 74a6eddb42c8620615807414332bab47acb2f0c7..8309a3b86e58852809c33e083e32c73f776711c0 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-17.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-17.js @@ -9,14 +9,14 @@ description: > property not to be visited ---*/ - var arr = [0, 1, 2, "last"]; +var arr = [0, 1, 2, "last"]; - Object.defineProperty(arr, "0", { - get: function () { - arr.length = 3; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + arr.length = 3; + return 0; + }, + configurable: true +}); assert.sameValue(arr.indexOf("last"), -1, 'arr.indexOf("last")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-18.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-18.js index f1e2fa4f4c5bb1c7bcf57c71c55b145eee4b55dd..1d728bce1f8d4fbb4818abb1aad8671a51f691c0 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-18.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-18.js @@ -9,21 +9,21 @@ description: > prototype property causes prototype index property to be visited ---*/ - var arr = [0, 1, 2]; +var arr = [0, 1, 2]; - Object.defineProperty(Array.prototype, "2", { - get: function () { - return "prototype"; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "2", { + get: function() { + return "prototype"; + }, + configurable: true +}); - Object.defineProperty(arr, "1", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); assert.sameValue(arr.indexOf("prototype"), 2, 'arr.indexOf("prototype")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-19.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-19.js index b30be5fdabf10d9e3df99b88264e8c4271c5779f..0fab8d12b720c733193fd942e75bab1e5f1f1452 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-19.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-19.js @@ -10,22 +10,22 @@ description: > flags: [noStrict] ---*/ - var arr = [0, 1, 2]; +var arr = [0, 1, 2]; - Object.defineProperty(arr, "2", { - get: function () { - return "unconfigurable"; - }, - configurable: false - }); +Object.defineProperty(arr, "2", { + get: function() { + return "unconfigurable"; + }, + configurable: false +}); - Object.defineProperty(arr, "1", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); assert.sameValue(arr.indexOf("unconfigurable"), 2, 'arr.indexOf("unconfigurable")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-2.js index a0e8b829569694b4ec27941f7ad8cfac0cd53563..fac0434b988f622a7914d8014a32eede87953c43 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-2.js @@ -9,15 +9,17 @@ description: > here on an Array-like object ---*/ - var arr = { length: 30 }; - var targetObj = function () { }; +var arr = { + length: 30 +}; +var targetObj = function() {}; - var fromIndex = { - valueOf: function () { - arr[4] = targetObj; - return 3; - } - }; +var fromIndex = { + valueOf: function() { + arr[4] = targetObj; + return 3; + } +}; assert.sameValue(Array.prototype.indexOf.call(arr, targetObj, fromIndex), 4, 'Array.prototype.indexOf.call(arr, targetObj, fromIndex)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-3.js index 5ac6827ee62b6a9740fedad1362cfe35f41b26e4..d7954ea908464fc3cc4c90a09ae7b2e5dc95dd55 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-3.js @@ -9,15 +9,15 @@ description: > here on an Array ---*/ - var arr = []; - arr.length = 30; - var targetObj = function () { }; +var arr = []; +arr.length = 30; +var targetObj = function() {}; - var fromIndex = { - valueOf: function () { - arr[4] = targetObj; - return 3; - } - }; +var fromIndex = { + valueOf: function() { + arr[4] = targetObj; + return 3; + } +}; assert.sameValue(arr.indexOf(targetObj, fromIndex), 4, 'arr.indexOf(targetObj, fromIndex)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-4.js index 8a5e756c56fb12f3134fdfc8b461f20fcb78debd..1340a1d67bcba8f267495b4a6d5bb16e576ae11f 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-4.js @@ -9,14 +9,16 @@ description: > here ---*/ - var arr = { 2: 6.99 }; +var arr = { + 2: 6.99 +}; - Object.defineProperty(arr, "length", { - get: function () { - delete arr[2]; - return 3; - }, - configurable: true - }); +Object.defineProperty(arr, "length", { + get: function() { + delete arr[2]; + return 3; + }, + configurable: true +}); assert.sameValue(Array.prototype.indexOf.call(arr, 6.99), -1, 'Array.prototype.indexOf.call(arr, 6.99)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-5.js index 255c327a3f9b56e93838268a872dfca09ab9cf3e..926a37aeb5ded804578de42b078b6c5ab01c6416 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-5.js @@ -9,13 +9,16 @@ description: > here on an Array-like object ---*/ - var arr = { 10: false, length: 30 }; +var arr = { + 10: false, + length: 30 +}; - var fromIndex = { - valueOf: function () { - delete arr[10]; - return 3; - } - }; +var fromIndex = { + valueOf: function() { + delete arr[10]; + return 3; + } +}; assert.sameValue(Array.prototype.indexOf.call(arr, false, fromIndex), -1, 'Array.prototype.indexOf.call(arr, false, fromIndex)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-6.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-6.js index e78f717c3c250511d22dcb6b78e429432e189a88..41e275c6ce0733bbe1f891d35fd83aea782c118f 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-6.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-6.js @@ -9,15 +9,15 @@ description: > here on an Array ---*/ - var arr = []; - arr[10] = "10"; - arr.length = 20; +var arr = []; +arr[10] = "10"; +arr.length = 20; - var fromIndex = { - valueOf: function () { - delete arr[10]; - return 3; - } - }; +var fromIndex = { + valueOf: function() { + delete arr[10]; + return 3; + } +}; assert.sameValue(arr.indexOf("10", fromIndex), -1, 'arr.indexOf("10", fromIndex)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-7.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-7.js index 58e38614c5583afa58cdf78d71cbacaf90c71755..317816ab65e6a3c6ac1ee9faaefa38999d8a21f7 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-7.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-7.js @@ -9,19 +9,21 @@ description: > current position are visited on an Array-like object ---*/ - var arr = { length: 2 }; +var arr = { + length: 2 +}; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(arr, "1", { - get: function () { - return 1; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(arr, "1", { + get: function() { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); assert.sameValue(Array.prototype.indexOf.call(arr, 1), 1, 'Array.prototype.indexOf.call(arr, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-8.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-8.js index aa43ed573b6dfae363bc8c2e72c1243134cdfcef..af3577d7dbdac2305f43a1b790a2c3ad19386c85 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-8.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-8.js @@ -9,19 +9,19 @@ description: > current position are visited on an Array ---*/ - var arr = [0, , 2]; +var arr = [0, , 2]; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(arr, "1", { - get: function () { - return 1; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(arr, "1", { + get: function() { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); assert.sameValue(arr.indexOf(1), 1, 'arr.indexOf(1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-9.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-9.js index e36af343da0845938ee66a8a1071e4b5288affb2..22ea6154ae17911839c627d45c08b82aa9ec905e 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-9.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-9.js @@ -9,19 +9,21 @@ description: > after current position are visited on an Array-like object ---*/ - var arr = { length: 2 }; +var arr = { + length: 2 +}; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(Object.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(Object.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); assert.sameValue(Array.prototype.indexOf.call(arr, 6.99), 1, 'Array.prototype.indexOf.call(arr, 6.99)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-1.js index dc8bba8671c836b22a01fdef2eca06ba59803d28..211c212ccd265254a39840612bbcbebfc6e07ef4 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-1.js @@ -9,7 +9,12 @@ description: > property on an Array-like object ---*/ - var obj = { 0: 0, 1: 1, 2: 2, length: 3 }; +var obj = { + 0: 0, + 1: 1, + 2: 2, + length: 3 +}; assert.sameValue(Array.prototype.indexOf.call(obj, 0), 0, 'Array.prototype.indexOf.call(obj, 0)'); assert.sameValue(Array.prototype.indexOf.call(obj, 1), 1, 'Array.prototype.indexOf.call(obj, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-10.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-10.js index 8cf69e48dd956b55affcf3246f4eb767a8edf877..af735dd41870e0069f376d0af0a34d3cede467f1 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-10.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-10.js @@ -9,27 +9,29 @@ description: > property on an Array-like object ---*/ - var obj = { length: 3 }; - Object.defineProperty(obj, "0", { - get: function () { - return 0; - }, - configurable: true - }); +var obj = { + length: 3 +}; +Object.defineProperty(obj, "0", { + get: function() { + return 0; + }, + configurable: true +}); - Object.defineProperty(obj, "1", { - get: function () { - return 1; - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + return 1; + }, + configurable: true +}); - Object.defineProperty(obj, "2", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(obj, "2", { + get: function() { + return 2; + }, + configurable: true +}); assert.sameValue(Array.prototype.indexOf.call(obj, 0), 0, 'Array.prototype.indexOf.call(obj, 0)'); assert.sameValue(Array.prototype.indexOf.call(obj, 1), 1, 'Array.prototype.indexOf.call(obj, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-11.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-11.js index 0d1ca8e702130fa4f01afde84e73699981d48ac0..d744fec56ca43556bc86eab5cd69d8e9cc8491e7 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-11.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-11.js @@ -9,14 +9,14 @@ description: > property that overrides an inherited data property on an Array ---*/ - var arr = []; +var arr = []; - Array.prototype[0] = false; - Object.defineProperty(arr, "0", { - get: function () { - return true; - }, - configurable: true - }); +Array.prototype[0] = false; +Object.defineProperty(arr, "0", { + get: function() { + return true; + }, + configurable: true +}); assert.sameValue(arr.indexOf(true), 0, 'arr.indexOf(true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-12.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-12.js index de13d9f38a147fc0abb8fe7368e1de1571594c5e..77f337f6b150cd7716eab3f73d9742024270df61 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-12.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-12.js @@ -10,14 +10,16 @@ description: > Array-like object ---*/ - var obj = { length: 1 }; +var obj = { + length: 1 +}; - Object.prototype[0] = false; - Object.defineProperty(obj, "0", { - get: function () { - return true; - }, - configurable: true - }); +Object.prototype[0] = false; +Object.defineProperty(obj, "0", { + get: function() { + return true; + }, + configurable: true +}); assert.sameValue(Array.prototype.indexOf.call(obj, true), 0, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-13.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-13.js index 27be95dc60f4a9182a4afcde4529f67fd1847508..f260b91bfafa3bb86790492450889de4a163887e 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-13.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-13.js @@ -9,20 +9,20 @@ description: > property that overrides an inherited accessor property on an Array ---*/ - var arr = []; +var arr = []; - Object.defineProperty(Array.prototype, "0", { - get: function () { - return false; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return false; + }, + configurable: true +}); - Object.defineProperty(arr, "0", { - get: function () { - return true; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + return true; + }, + configurable: true +}); assert.sameValue(arr.indexOf(true), 0, 'arr.indexOf(true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-14.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-14.js index 265667e71a967feaae75904b01aad37cb323b0ea..b3133a5bcba12f13cf9277d678309636774c0176 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-14.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-14.js @@ -10,20 +10,22 @@ description: > Array-like object ---*/ - var obj = { length: 1 }; +var obj = { + length: 1 +}; - Object.defineProperty(Object.prototype, "0", { - get: function () { - return false; - }, - configurable: true - }); +Object.defineProperty(Object.prototype, "0", { + get: function() { + return false; + }, + configurable: true +}); - Object.defineProperty(obj, "0", { - get: function () { - return true; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + return true; + }, + configurable: true +}); assert.sameValue(Array.prototype.indexOf.call(obj, true), 0, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-15.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-15.js index 44b2da7afd729abc294e3519098455d2cab752cf..e9f5b47b765151938e8af1b62777e764c1e551c6 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-15.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-15.js @@ -9,26 +9,26 @@ description: > accessor property on an Array ---*/ - Object.defineProperty(Array.prototype, "0", { - get: function () { - return 10; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return 10; + }, + configurable: true +}); - Object.defineProperty(Array.prototype, "1", { - get: function () { - return 20; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "1", { + get: function() { + return 20; + }, + configurable: true +}); - Object.defineProperty(Array.prototype, "2", { - get: function () { - return 30; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "2", { + get: function() { + return 30; + }, + configurable: true +}); assert.sameValue([, , , ].indexOf(10), 0, '[, , , ].indexOf(10)'); assert.sameValue([, , , ].indexOf(20), 1, '[, , , ].indexOf(20)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-16.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-16.js index 754db8aad4ab0f547e43567ad0888e41f933988a..8a8057ee9f0daeb7538d6e44127964edb84c7114 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-16.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-16.js @@ -9,27 +9,33 @@ description: > accessor property on an Array-like object ---*/ - Object.defineProperty(Object.prototype, "0", { - get: function () { - return 10; - }, - configurable: true - }); +Object.defineProperty(Object.prototype, "0", { + get: function() { + return 10; + }, + configurable: true +}); - Object.defineProperty(Object.prototype, "1", { - get: function () { - return 20; - }, - configurable: true - }); +Object.defineProperty(Object.prototype, "1", { + get: function() { + return 20; + }, + configurable: true +}); - Object.defineProperty(Object.prototype, "2", { - get: function () { - return 30; - }, - configurable: true - }); +Object.defineProperty(Object.prototype, "2", { + get: function() { + return 30; + }, + configurable: true +}); -assert.sameValue(Array.prototype.indexOf.call({ length: 3 }, 10), 0, 'Array.prototype.indexOf.call({ length: 3 }, 10)'); -assert.sameValue(Array.prototype.indexOf.call({ length: 3 }, 20), 1, 'Array.prototype.indexOf.call({ length: 3 }, 20)'); -assert.sameValue(Array.prototype.indexOf.call({ length: 3 }, 30), 2, 'Array.prototype.indexOf.call({ length: 3 }, 30)'); +assert.sameValue(Array.prototype.indexOf.call({ + length: 3 +}, 10), 0, 'Array.prototype.indexOf.call({ length: 3 }, 10)'); +assert.sameValue(Array.prototype.indexOf.call({ + length: 3 +}, 20), 1, 'Array.prototype.indexOf.call({ length: 3 }, 20)'); +assert.sameValue(Array.prototype.indexOf.call({ + length: 3 +}, 30), 2, 'Array.prototype.indexOf.call({ length: 3 }, 30)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-17.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-17.js index 551e2a30e7b1fc0eb336f87c5fb0084af49176eb..9ffbbe16cabb66fa4bcdd8a3a0af3620f40c7a1d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-17.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-17.js @@ -9,10 +9,10 @@ description: > property without a get function on an Array ---*/ - var arr = []; - Object.defineProperty(arr, "0", { - set: function () { }, - configurable: true - }); +var arr = []; +Object.defineProperty(arr, "0", { + set: function() {}, + configurable: true +}); assert.sameValue(arr.indexOf(undefined), 0, 'arr.indexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-18.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-18.js index 4701e3fd8d94867ec6681b2dc4a1573719d75d75..e79db90e3b4b6668f842649448772f6557ea03a6 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-18.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-18.js @@ -9,10 +9,12 @@ description: > property without a get function on an Array-like object ---*/ - var obj = { length: 1 }; - Object.defineProperty(obj, "0", { - set: function () { }, - configurable: true - }); +var obj = { + length: 1 +}; +Object.defineProperty(obj, "0", { + set: function() {}, + configurable: true +}); assert.sameValue(Array.prototype.indexOf.call(obj, undefined), 0, 'Array.prototype.indexOf.call(obj, undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-19.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-19.js index b640d89655f4343fff97e91d4c1051e2bed6e9fa..2ded8363e79b3fe5c74e2eed65465968ea2a5a49 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-19.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-19.js @@ -10,18 +10,18 @@ description: > accessor property on an Array ---*/ - var arr = []; +var arr = []; - Object.defineProperty(arr, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(arr, "0", { + set: function() {}, + configurable: true +}); - Object.defineProperty(Array.prototype, "0", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return 2; + }, + configurable: true +}); assert.sameValue(arr.indexOf(undefined), 0, 'arr.indexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-20.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-20.js index 56508fe50890804ddfcaa5ab94c9f53f48050f93..793084e9e09ccd9240c7b59b66c377ad7a2f5b0f 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-20.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-20.js @@ -10,23 +10,23 @@ description: > accessor property on an Array-like object ---*/ - var proto = {}; - Object.defineProperty(proto, "0", { - get: function () { - return 2; - }, - configurable: true - }); +var proto = {}; +Object.defineProperty(proto, "0", { + get: function() { + return 2; + }, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 1; +var child = new Con(); +child.length = 1; - Object.defineProperty(child, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(child, "0", { + set: function() {}, + configurable: true +}); assert.sameValue(Array.prototype.indexOf.call(child, undefined), 0, 'Array.prototype.indexOf.call(child, undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-21.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-21.js index 24144df082cd739b80aa740371bf320d7f1cad91..ffc933148910cceb1a029d7b3c56fe5c58275793 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-21.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-21.js @@ -9,9 +9,9 @@ description: > accessor property without a get function on an Array ---*/ - Object.defineProperty(Array.prototype, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + set: function() {}, + configurable: true +}); assert.sameValue([, ].indexOf(undefined), 0, '[, ].indexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-22.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-22.js index 922d2e7ce1204b1420c50174b2c7650a0e258628..f9fa4d41a2cfb7f7663f53d565d071bde4ebba40 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-22.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-22.js @@ -9,9 +9,11 @@ description: > accessor property without a get function on an Array-like object ---*/ - Object.defineProperty(Object.prototype, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(Object.prototype, "0", { + set: function() {}, + configurable: true +}); -assert.sameValue(Array.prototype.indexOf.call({ length: 1 }, undefined), 0, 'Array.prototype.indexOf.call({ length: 1 }, undefined)'); +assert.sameValue(Array.prototype.indexOf.call({ + length: 1 +}, undefined), 0, 'Array.prototype.indexOf.call({ length: 1 }, undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-25.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-25.js index b2f3bc442a43d0ac02033c8bf7f95390a827a169..4e5bb8b13bb9d59f628fef504f94791c2f5376fe 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-25.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-25.js @@ -10,9 +10,9 @@ description: > less than number of parameters) ---*/ - var func = function (a, b) { - return 0 === Array.prototype.indexOf.call(arguments, arguments[0]) && - -1 === Array.prototype.indexOf.call(arguments, arguments[1]); - }; +var func = function(a, b) { + return 0 === Array.prototype.indexOf.call(arguments, arguments[0]) && + -1 === Array.prototype.indexOf.call(arguments, arguments[1]); +}; assert(func(true), 'func(true) !== true'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-26.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-26.js index 330ea1966e45fcab837883b0a400b0c881887171..caa167d9d58888319aae440d9c4ce5fd74b4dad3 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-26.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-26.js @@ -10,10 +10,10 @@ description: > to number of parameters) ---*/ - var func = function (a, b) { - return 0 === Array.prototype.indexOf.call(arguments, arguments[0]) && - 1 === Array.prototype.indexOf.call(arguments, arguments[1]) && - -1 === Array.prototype.indexOf.call(arguments, arguments[2]); - }; +var func = function(a, b) { + return 0 === Array.prototype.indexOf.call(arguments, arguments[0]) && + 1 === Array.prototype.indexOf.call(arguments, arguments[1]) && + -1 === Array.prototype.indexOf.call(arguments, arguments[2]); +}; assert(func(0, true), 'func(0, true) !== true'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-27.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-27.js index 5935f22bae4e4b4fa06bf33cfe1087318bb0ecee..02017a929283b1b14830ee6382fa6e5fa083eeac 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-27.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-27.js @@ -10,10 +10,10 @@ description: > greater than number of parameters) ---*/ - var func = function (a, b) { - return 0 === Array.prototype.indexOf.call(arguments, arguments[0]) && - 3 === Array.prototype.indexOf.call(arguments, arguments[3]) && - -1 === Array.prototype.indexOf.call(arguments, arguments[4]); - }; +var func = function(a, b) { + return 0 === Array.prototype.indexOf.call(arguments, arguments[0]) && + 3 === Array.prototype.indexOf.call(arguments, arguments[3]) && + -1 === Array.prototype.indexOf.call(arguments, arguments[4]); +}; assert(func(0, false, 0, true), 'func(0, false, 0, true) !== true'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-28.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-28.js index dc9119d68e65d5ff21ccd9fc75048e89efc86ff8..2a13283be25a4c0c7400a3f54b81ecf64314c6f5 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-28.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-28.js @@ -9,26 +9,26 @@ description: > iterations on an Array ---*/ - var preIterVisible = false; - var arr = []; +var preIterVisible = false; +var arr = []; - Object.defineProperty(arr, "0", { - get: function () { - preIterVisible = true; - return false; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + preIterVisible = true; + return false; + }, + configurable: true +}); - Object.defineProperty(arr, "1", { - get: function () { - if (preIterVisible) { - return true; - } else { - return false; - } - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + if (preIterVisible) { + return true; + } else { + return false; + } + }, + configurable: true +}); assert.sameValue(arr.indexOf(true), 1, 'arr.indexOf(true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-29.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-29.js index 1c941586ece17b66538ce292e79cb83e2dfa1f82..475817a8e82e708406331dd819f9ccf25185f42c 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-29.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-29.js @@ -9,26 +9,28 @@ description: > iterations on an Array-like object ---*/ - var preIterVisible = false; - var obj = { length: 2 }; +var preIterVisible = false; +var obj = { + length: 2 +}; - Object.defineProperty(obj, "0", { - get: function () { - preIterVisible = true; - return false; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + preIterVisible = true; + return false; + }, + configurable: true +}); - Object.defineProperty(obj, "1", { - get: function () { - if (preIterVisible) { - return true; - } else { - return false; - } - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + if (preIterVisible) { + return true; + } else { + return false; + } + }, + configurable: true +}); assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-3.js index 1df5d9eb968ff6a5e2b40cdd5a7e378011b5d29b..84006e81e46fbdd957cadabb25cc2067076baec0 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-3.js @@ -9,6 +9,6 @@ description: > property that overrides an inherited data property on an Array ---*/ - Array.prototype[0] = false; +Array.prototype[0] = false; assert.sameValue([true].indexOf(true), 0, '[true].indexOf(true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-30.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-30.js index 440a314480bb926cb6faa15991cbbe6d3b599b76..c2c8d13507278e538ff2e2e52857bb5ea435d5f1 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 @@ -9,24 +9,24 @@ description: > exception on an Array ---*/ - var accessed = false; - var arr = []; +var accessed = false; +var arr = []; - Object.defineProperty(arr, "0", { - get: function () { - throw new TypeError(); - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + throw new TypeError(); + }, + configurable: true +}); - Object.defineProperty(arr, "1", { - get: function () { - accessed = true; - return true; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + accessed = true; + return true; + }, + configurable: true +}); assert.throws(TypeError, function() { - arr.indexOf(true); + arr.indexOf(true); }); 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 9cae879bc51667c6fb2293aa5a79aa3c70cff1d5..8977a9893905062447058bfc4a4e803eb66252df 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 @@ -9,24 +9,26 @@ description: > exception on an Array-like object ---*/ - var accessed = false; - var obj = { length: 2 }; +var accessed = false; +var obj = { + length: 2 +}; - Object.defineProperty(obj, "0", { - get: function () { - throw new TypeError(); - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + throw new TypeError(); + }, + configurable: true +}); - Object.defineProperty(obj, "1", { - get: function () { - accessed = true; - return true; - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + accessed = true; + return true; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.indexOf.call(obj, true); + Array.prototype.indexOf.call(obj, true); }); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-4.js index 171ced904f6cfa990b44764260de1d49547aa06e..89206842622b9c82c4054c0f6b409bd586f23199 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-4.js @@ -10,6 +10,10 @@ description: > Array-like object ---*/ - Object.prototype[0] = false; +Object.prototype[0] = false; -assert.sameValue(Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true), 0, 'Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true)'); +assert.sameValue(Array.prototype.indexOf.call({ + 0: true, + 1: 1, + length: 2 +}, true), 0, 'Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-5.js index 24a4076913fe9a55aa4e9125ba8827f6485eac1d..1d4332e749830ff790dac08de3dbab8e54e8325c 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-5.js @@ -9,11 +9,11 @@ description: > property that overrides an inherited accessor property on an Array ---*/ - Object.defineProperty(Array.prototype, "0", { - get: function () { - return false; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return false; + }, + configurable: true +}); assert.sameValue([true].indexOf(true), 0, '[true].indexOf(true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-6.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-6.js index 22e410e7d195c3b4264358a922e10f114b8431da..4661515c4f524bb1a7f40cec112b3056f9448f29 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-6.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-6.js @@ -10,11 +10,15 @@ description: > Array-like object ---*/ - Object.defineProperty(Object.prototype, "0", { - get: function () { - return false; - }, - configurable: true - }); +Object.defineProperty(Object.prototype, "0", { + get: function() { + return false; + }, + configurable: true +}); -assert.sameValue(Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true), 0, 'Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true)'); +assert.sameValue(Array.prototype.indexOf.call({ + 0: true, + 1: 1, + length: 2 +}, true), 0, 'Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-7.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-7.js index 9382abf00ce99748cff5e6fecc20bde7c265b7cf..6344f1784d13d28f46b217c0c03430439890300e 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-7.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-7.js @@ -9,9 +9,9 @@ description: > data property on an Array ---*/ - Array.prototype[0] = true; - Array.prototype[1] = false; - Array.prototype[2] = "true"; +Array.prototype[0] = true; +Array.prototype[1] = false; +Array.prototype[2] = "true"; assert.sameValue([, , , ].indexOf(true), 0, '[, , , ].indexOf(true)'); assert.sameValue([, , , ].indexOf(false), 1, '[, , , ].indexOf(false)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-8.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-8.js index 52e280f1c4249f9af2c10844ac048ae6156d3222..7ac1d98104c41a1fce4717f1fa33f89d38602e1e 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-8.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-8.js @@ -9,10 +9,16 @@ description: > data property on an Array-like object ---*/ - Object.prototype[0] = true; - Object.prototype[1] = false; - Object.prototype[2] = "true"; +Object.prototype[0] = true; +Object.prototype[1] = false; +Object.prototype[2] = "true"; -assert.sameValue(Array.prototype.indexOf.call({ length: 3 }, true), 0, 'Array.prototype.indexOf.call({ length: 3 }, true)'); -assert.sameValue(Array.prototype.indexOf.call({ length: 3 }, false), 1, 'Array.prototype.indexOf.call({ length: 3 }, false)'); -assert.sameValue(Array.prototype.indexOf.call({ length: 3 }, "true"), 2, 'Array.prototype.indexOf.call({ length: 3 }, "true")'); +assert.sameValue(Array.prototype.indexOf.call({ + length: 3 +}, true), 0, 'Array.prototype.indexOf.call({ length: 3 }, true)'); +assert.sameValue(Array.prototype.indexOf.call({ + length: 3 +}, false), 1, 'Array.prototype.indexOf.call({ length: 3 }, false)'); +assert.sameValue(Array.prototype.indexOf.call({ + length: 3 +}, "true"), 2, 'Array.prototype.indexOf.call({ length: 3 }, "true")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-9.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-9.js index ed295d20112acd5892fc80c4d8532e556a8445c1..007bbcc02ca317df68a00306051c6fa917559c26 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-9.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-9.js @@ -9,27 +9,27 @@ description: > property on an Array ---*/ - var arr = [, , , ]; - Object.defineProperty(arr, "0", { - get: function () { - return 0; - }, - configurable: true - }); +var arr = [, , , ]; +Object.defineProperty(arr, "0", { + get: function() { + return 0; + }, + configurable: true +}); - Object.defineProperty(arr, "1", { - get: function () { - return 1; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + return 1; + }, + configurable: true +}); - Object.defineProperty(arr, "2", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(arr, "2", { + get: function() { + return 2; + }, + configurable: true +}); assert.sameValue(arr.indexOf(0), 0, 'arr.indexOf(0)'); assert.sameValue(arr.indexOf(1), 1, 'arr.indexOf(1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-1.js index 8c2c6d709b732badd1c5c2d9bdb9cd8b53524805..9402b5c0347c1f87837a1e82ba0ccfae1007e9a0 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-1.js @@ -14,4 +14,6 @@ assert.sameValue(["0"].indexOf(0), -1, '["0"].indexOf(0)'); assert.sameValue([false].indexOf(0), -1, '[false].indexOf(0)'); assert.sameValue([undefined].indexOf(0), -1, '[undefined].indexOf(0)'); assert.sameValue([null].indexOf(0), -1, '[null].indexOf(0)'); -assert.sameValue([[]].indexOf(0), -1, '[[]].indexOf(0)'); +assert.sameValue([ + [] +].indexOf(0), -1, '[[]].indexOf(0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-11.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-11.js index 8aad97866b78573630d77d2bca51ad35431bddea..dcce4f0170e63fcc21027e79ac0faf51c68da061 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-11.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-11.js @@ -9,8 +9,8 @@ description: > are Object type, and they refer to the same object ---*/ - var obj1 = {}; - var obj2 = {}; - var obj3 = obj2; +var obj1 = {}; +var obj2 = {}; +var obj3 = obj2; assert.sameValue([{}, obj1, obj2].indexOf(obj3), 2, '[{}, obj1, obj2].indexOf(obj3)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-iii-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-iii-2.js index a593c8ce4879dd77f43e59c34bec5a7eb1a97237..94a30fd4a68ec298b001134e060c2720e629e4e5 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-iii-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-iii-2.js @@ -9,26 +9,26 @@ description: > element once search value is found ---*/ - var arr = [1, 2, , 1, 2]; - var elementThirdAccessed = false; - var elementFifthAccessed = false; +var arr = [1, 2, , 1, 2]; +var elementThirdAccessed = false; +var elementFifthAccessed = false; - Object.defineProperty(arr, "2", { - get: function () { - elementThirdAccessed = true; - return 2; - }, - configurable: true - }); - Object.defineProperty(arr, "4", { - get: function () { - elementFifthAccessed = true; - return 2; - }, - configurable: true - }); +Object.defineProperty(arr, "2", { + get: function() { + elementThirdAccessed = true; + return 2; + }, + configurable: true +}); +Object.defineProperty(arr, "4", { + get: function() { + elementFifthAccessed = true; + return 2; + }, + configurable: true +}); - arr.indexOf(2); +arr.indexOf(2); assert.sameValue(elementThirdAccessed, false, 'elementThirdAccessed'); assert.sameValue(elementFifthAccessed, false, 'elementFifthAccessed'); diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A1.2_T1.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A1.2_T1.js index 1953684e56260d19269018245d3f13870f796496..002775eac9b1b58de6bc95afee70f0b35b876979 100644 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A1.2_T1.js +++ b/test/built-ins/Array/prototype/join/S15.4.4.5_A1.2_T1.js @@ -9,7 +9,7 @@ description: Checking this use new Array() and [] ---*/ //CHECK#1 -var x = new Array(0,1,2,3); +var x = new Array(0, 1, 2, 3); if (x.join() !== "0,1,2,3") { $ERROR('#1: x = new Array(0,1,2,3); x.join() === "0,1,2,3". Actual: ' + (x.join())); } diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A1.2_T2.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A1.2_T2.js index abb176f63e1be3bf27b6b09a39c8123e19b65405..9ec63f6c75e17c5b00d81292add022745e30281f 100644 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A1.2_T2.js +++ b/test/built-ins/Array/prototype/join/S15.4.4.5_A1.2_T2.js @@ -9,7 +9,7 @@ description: Checking this use new Array() and [] ---*/ //CHECK#1 -var x = new Array(0,1,2,3); +var x = new Array(0, 1, 2, 3); if (x.join(undefined) !== "0,1,2,3") { $ERROR('#1: x = new Array(0,1,2,3); x.join(undefined) === "0,1,2,3". Actual: ' + (x.join(undefined))); } diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A1.3_T1.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A1.3_T1.js index 8d8a730b0e4d2928f0e78e3dfa6436ed71c53a32..bbe9801e5bed10d394bd5449ade2550bdc458c4d 100644 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A1.3_T1.js +++ b/test/built-ins/Array/prototype/join/S15.4.4.5_A1.3_T1.js @@ -23,7 +23,7 @@ if (x.join() !== "") { } //CHECK#3 -x = Array(undefined,1,null,3); +x = Array(undefined, 1, null, 3); if (x.join() !== ",1,,3") { $ERROR('#3: x = Array(undefined,1,null,3); x.join() === ",1,,3". Actual: ' + (x.join())); } diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A2_T1.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A2_T1.js index 0b9c69bf8de35b3b5d43d93eb9236ce37ea97f75..e9b56c05337ebc436b73c6e71a7fa2032a38becf 100644 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A2_T1.js +++ b/test/built-ins/Array/prototype/join/S15.4.4.5_A2_T1.js @@ -16,14 +16,14 @@ obj.join = Array.prototype.join; if (obj.length !== undefined) { $ERROR('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length)); } else { - //CHECK#1 - if (obj.join() !== "") { - $ERROR('#1: var obj = {}; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join())); - } - //CHECK#2 - if (obj.length !== undefined) { - $ERROR('#2: var obj = {}; obj.join = Array.prototype.join; obj.join(); obj.length === undefined. Actual: ' + (obj.length)); - } + //CHECK#1 + if (obj.join() !== "") { + $ERROR('#1: var obj = {}; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join())); + } + //CHECK#2 + if (obj.length !== undefined) { + $ERROR('#2: var obj = {}; obj.join = Array.prototype.join; obj.join(); obj.length === undefined. Actual: ' + (obj.length)); + } } //CHECK#3 diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A2_T2.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A2_T2.js index 3cd42a8324801131f363eabb4e6b379ef291ec5c..8a6fbb9809c837e55e823dc95d026baa84551ffb 100644 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A2_T2.js +++ b/test/built-ins/Array/prototype/join/S15.4.4.5_A2_T2.js @@ -43,7 +43,7 @@ if (obj.join() !== "") { if (obj.length !== -0) { $ERROR('#8: var obj = {}; obj.length = -0; obj.join = Array.prototype.join; obj.join(); obj.length === 0. Actual: ' + (obj.length)); } else { - if (1/obj.length !== Number.NEGATIVE_INFINITY) { + if (1 / obj.length !== Number.NEGATIVE_INFINITY) { $ERROR('#8: var obj = {}; obj.length = -0; obj.join = Array.prototype.join; obj.join(); obj.length === -0. Actual: ' + (obj.length)); } } diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A2_T4.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A2_T4.js index ac019fb7989db7335ffffa2adcdc82fa19464c87..729580e0422730112977a210d3eb400c6f5ffb86 100644 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A2_T4.js +++ b/test/built-ins/Array/prototype/join/S15.4.4.5_A2_T4.js @@ -16,26 +16,51 @@ var obj = {}; obj.join = Array.prototype.join; //CHECK#1 -obj.length = {valueOf: function() {return 3}}; +obj.length = { + valueOf: function() { + return 3 + } +}; if (obj.join() !== ",,") { $ERROR('#1: obj.length = {valueOf: function() {return 3}} obj.join() === ",,". Actual: ' + (obj.join())); } //CHECK#2 -obj.length = {valueOf: function() {return 3}, toString: function() {return 2}}; +obj.length = { + valueOf: function() { + return 3 + }, + toString: function() { + return 2 + } +}; if (obj.join() !== ",,") { $ERROR('#2: obj.length = {valueOf: function() {return 3}, toString: function() {return 2}} obj.join() === ",,". Actual: ' + (obj.join())); } //CHECK#3 -obj.length = {valueOf: function() {return 3}, toString: function() {return {}}}; +obj.length = { + valueOf: function() { + return 3 + }, + toString: function() { + return {} + } +}; if (obj.join() !== ",,") { $ERROR('#3: obj.length = {valueOf: function() {return 3}, toString: function() {return {}}} obj.join() === ",,". Actual: ' + (obj.join())); } //CHECK#4 try { - obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; + obj.length = { + valueOf: function() { + return 3 + }, + toString: function() { + throw "error" + } + }; if (obj.join() !== ",,") { $ERROR('#4.1: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.join() === ",". Actual: ' + (obj.join())); } @@ -49,20 +74,38 @@ catch (e) { } //CHECK#5 -obj.length = {toString: function() {return 2}}; +obj.length = { + toString: function() { + return 2 + } +}; if (obj.join() !== ",") { $ERROR('#5: obj.length = {toString: function() {return 2}} obj.join() === ",". Actual: ' + (obj.join())); } //CHECK#6 -obj.length = {valueOf: function() {return {}}, toString: function() {return 2}} +obj.length = { + valueOf: function() { + return {} + }, + toString: function() { + return 2 + } +} if (obj.join() !== ",") { $ERROR('#6: obj.length = {valueOf: function() {return {}}, toString: function() {return 2}} obj.join() === ",". Actual: ' + (obj.join())); } //CHECK#7 try { - obj.length = {valueOf: function() {throw "error"}, toString: function() {return 2}}; + obj.length = { + valueOf: function() { + throw "error" + }, + toString: function() { + return 2 + } + }; obj.join(); $ERROR('#7.1: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 2}}; obj.join() throw "error". Actual: ' + (obj.join())); } @@ -74,7 +117,14 @@ catch (e) { //CHECK#8 try { - obj.length = {valueOf: function() {return {}}, toString: function() {return {}}}; + obj.length = { + valueOf: function() { + return {} + }, + toString: function() { + return {} + } + }; obj.join(); $ERROR('#8.1: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.join() throw TypeError. Actual: ' + (obj.join())); } diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A3.1_T1.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A3.1_T1.js index 2bcd9eead5f3e0cfeea5c34c267b270ae4c9ebbb..a76e7ba020e794e34a11a15ee85dc24e09b36ddc 100644 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A3.1_T1.js +++ b/test/built-ins/Array/prototype/join/S15.4.4.5_A3.1_T1.js @@ -11,13 +11,13 @@ description: > ---*/ //CHECK#0 -var x = new Array(0,1,2,3); +var x = new Array(0, 1, 2, 3); if (x.join("") !== "0123") { $ERROR('#0: x = new Array(0,1,2,3); x.join("") === "0123". Actual: ' + (x.join(""))); } //CHECK#1 -x = new Array(0,1,2,3); +x = new Array(0, 1, 2, 3); if (x.join("\\") !== "0\\1\\2\\3") { $ERROR('#1: x = new Array(0,1,2,3); x.join("\\") === "0\\1\\2\\3". Actual: ' + (x.join("\\"))); } diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A3.1_T2.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A3.1_T2.js index 70efad97b826e931ef5bac8d2de10eb159046cb6..28925d93e313bad119cab0470cd969cb976eef2e 100644 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A3.1_T2.js +++ b/test/built-ins/Array/prototype/join/S15.4.4.5_A3.1_T2.js @@ -10,28 +10,53 @@ description: > String) ---*/ -var x = new Array(0,1,2,3); +var x = new Array(0, 1, 2, 3); //CHECK#1 -var object = {valueOf: function() {return "+"}}; +var object = { + valueOf: function() { + return "+" + } +}; if (x.join(object) !== "0[object Object]1[object Object]2[object Object]3") { $ERROR('#1: var object = {valueOf: function() {return "+"}}; x.join(object) === "0[object Object]1[object Object]2[object Object]3". Actual: ' + (x.join(object))); } //CHECK#2 -var object = {valueOf: function() {return "+"}, toString: function() {return "*"}}; +var object = { + valueOf: function() { + return "+" + }, + toString: function() { + return "*" + } +}; if (x.join(object) !== "0*1*2*3") { $ERROR('#2: var object = {valueOf: function() {return "+"}, toString: function() {return "*"}}; x.join(object) === "0*1*2*3". Actual: ' + (x.join(object))); } //CHECK#3 -var object = {valueOf: function() {return "+"}, toString: function() {return {}}}; +var object = { + valueOf: function() { + return "+" + }, + toString: function() { + return {} + } +}; if (x.join(object) !== "0+1+2+3") { $ERROR('#3: var object = {valueOf: function() {return "+"}, toString: function() {return {}}}; x.join(object) === "0+1+2+3". Actual: ' + (x.join(object))); } //CHECK#4 try { - var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}}; + var object = { + valueOf: function() { + throw "error" + }, + toString: function() { + return "*" + } + }; if (x.join(object) !== "0*1*2*3") { $ERROR('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}}; x.join(object) === "0*1*2*3". Actual: ' + (x.join(object))); } @@ -45,20 +70,38 @@ catch (e) { } //CHECK#5 -var object = {toString: function() {return "*"}}; +var object = { + toString: function() { + return "*" + } +}; if (x.join(object) !== "0*1*2*3") { $ERROR('#5: var object = {toString: function() {return "*"}}; x.join(object) === "0*1*2*3". Actual: ' + (x.join(object))); } //CHECK#6 -var object = {valueOf: function() {return {}}, toString: function() {return "*"}} +var object = { + valueOf: function() { + return {} + }, + toString: function() { + return "*" + } +} if (x.join(object) !== "0*1*2*3") { $ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return "*"}}; x.join(object) === "0*1*2*3". Actual: ' + (x.join(object))); } //CHECK#7 try { - var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}}; + var object = { + valueOf: function() { + return "+" + }, + toString: function() { + throw "error" + } + }; x.join(object); $ERROR('#7.1: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}}; x.join(object) throw "error". Actual: ' + (x.join(object))); } @@ -70,7 +113,14 @@ catch (e) { //CHECK#8 try { - var object = {valueOf: function() {return {}}, toString: function() {return {}}}; + var object = { + valueOf: function() { + return {} + }, + toString: function() { + return {} + } + }; x.join(object); $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x.join(object) throw TypeError. Actual: ' + (x.join(object))); } @@ -82,12 +132,16 @@ catch (e) { //CHECK#9 try { - var object = {toString: function() {throw "error"}}; - [].join(object); - $ERROR('#9.1: var object = {toString: function() {throw "error"}}; [].join(object) throw "error". Actual: ' + ([].join(object))); + var object = { + toString: function() { + throw "error" + } + }; + [].join(object); + $ERROR('#9.1: var object = {toString: function() {throw "error"}}; [].join(object) throw "error". Actual: ' + ([].join(object))); } catch (e) { - if (e !== "error") { - $ERROR('#9.2: var object = {toString: function() {throw "error"}}; [].join(object) throw "error". Actual: ' + (e)); - } + if (e !== "error") { + $ERROR('#9.2: var object = {toString: function() {throw "error"}}; [].join(object) throw "error". Actual: ' + (e)); + } } diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A3.2_T1.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A3.2_T1.js index f6a4966557fa0f7ccbb6dc1dee233216bd7bb407..e90ed6ffe7e73f837d18c1b76be95856f296d186 100644 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A3.2_T1.js +++ b/test/built-ins/Array/prototype/join/S15.4.4.5_A3.2_T1.js @@ -11,13 +11,13 @@ description: > ---*/ //CHECK#0 -var x = new Array("","",""); +var x = new Array("", "", ""); if (x.join("") !== "") { $ERROR('#0: var x = new Array("","",""); x.join("") === "". Actual: ' + (x.join(""))); } //CHECK#1 -var x = new Array("\\","\\","\\"); +var x = new Array("\\", "\\", "\\"); if (x.join("\\") !== "\\\\\\\\\\") { $ERROR('#1: var x = new Array("\\","\\","\\"); x.join("\\") === "\\\\\\\\\\". Actual: ' + (x.join("\\"))); } @@ -29,31 +29,31 @@ if (x.join("&") !== "&&&&&") { } //CHECK#3 -var x = new Array(true,true,true); +var x = new Array(true, true, true); if (x.join() !== "true,true,true") { - $ERROR('#3: var x = new Array(true,true,true); x.join(true,true,true) === "true,true,true". Actual: ' + (x.join(true,true,true))); + $ERROR('#3: var x = new Array(true,true,true); x.join(true,true,true) === "true,true,true". Actual: ' + (x.join(true, true, true))); } //CHECK#4 -var x = new Array(null,null,null); +var x = new Array(null, null, null); if (x.join() !== ",,") { - $ERROR('#4: var x = new Array(null,null,null); x.join(null,null,null) === ",,". Actual: ' + (x.join(null,null,null))); + $ERROR('#4: var x = new Array(null,null,null); x.join(null,null,null) === ",,". Actual: ' + (x.join(null, null, null))); } //CHECK#5 -var x = new Array(undefined,undefined,undefined); +var x = new Array(undefined, undefined, undefined); if (x.join() !== ",,") { - $ERROR('#5: var x = new Array(undefined,undefined,undefined); x.join(undefined,undefined,undefined) === ",,". Actual: ' + (x.join(undefined,undefined,undefined))); + $ERROR('#5: var x = new Array(undefined,undefined,undefined); x.join(undefined,undefined,undefined) === ",,". Actual: ' + (x.join(undefined, undefined, undefined))); } //CHECK#6 -var x = new Array(Infinity,Infinity,Infinity); +var x = new Array(Infinity, Infinity, Infinity); if (x.join() !== "Infinity,Infinity,Infinity") { - $ERROR('#6: var x = new Array(Infinity,Infinity,Infinity); x.join(Infinity,Infinity,Infinity) === "Infinity,Infinity,Infinity". Actual: ' + (x.join(Infinity,Infinity,Infinity))); + $ERROR('#6: var x = new Array(Infinity,Infinity,Infinity); x.join(Infinity,Infinity,Infinity) === "Infinity,Infinity,Infinity". Actual: ' + (x.join(Infinity, Infinity, Infinity))); } //CHECK#7 -var x = new Array(NaN,NaN,NaN); +var x = new Array(NaN, NaN, NaN); if (x.join() !== "NaN,NaN,NaN") { - $ERROR('#7: var x = new Array(NaN,NaN,NaN); x.join(NaN,NaN,NaN) === "NaN,NaN,NaN". Actual: ' + (x.join(NaN,NaN,NaN))); + $ERROR('#7: var x = new Array(NaN,NaN,NaN); x.join(NaN,NaN,NaN) === "NaN,NaN,NaN". Actual: ' + (x.join(NaN, NaN, NaN))); } diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A3.2_T2.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A3.2_T2.js index 863cead865714c8124d8de315c35b688153578fa..4dc0ff12a1ee8bc61c7b1ede55d13e71f1ff942f 100644 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A3.2_T2.js +++ b/test/built-ins/Array/prototype/join/S15.4.4.5_A3.2_T2.js @@ -9,21 +9,39 @@ description: If Type(argument) is Object, evaluate ToPrimitive(argument, String) ---*/ //CHECK#1 -var object = {valueOf: function() {return "+"}}; +var object = { + valueOf: function() { + return "+" + } +}; var x = new Array(object); if (x.join() !== "[object Object]") { $ERROR('#1: var object = {valueOf: function() {return "+"}} var x = new Array(object); x.join() === "[object Object]". Actual: ' + (x.join())); } //CHECK#2 -var object = {valueOf: function() {return "+"}, toString: function() {return "*"}}; +var object = { + valueOf: function() { + return "+" + }, + toString: function() { + return "*" + } +}; var x = new Array(object); if (x.join() !== "*") { $ERROR('#2: var object = {valueOf: function() {return "+"}, toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join())); } //CHECK#3 -var object = {valueOf: function() {return "+"}, toString: function() {return {}}}; +var object = { + valueOf: function() { + return "+" + }, + toString: function() { + return {} + } +}; var x = new Array(object); if (x.join() !== "+") { $ERROR('#3: var object = {valueOf: function() {return "+"}, toString: function() {return {}}} var x = new Array(object); x.join() === "+". Actual: ' + (x.join())); @@ -31,7 +49,14 @@ if (x.join() !== "+") { //CHECK#4 try { - var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}}; + var object = { + valueOf: function() { + throw "error" + }, + toString: function() { + return "*" + } + }; var x = new Array(object); if (x.join() !== "*") { $ERROR('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join())); @@ -46,14 +71,25 @@ catch (e) { } //CHECK#5 -var object = {toString: function() {return "*"}}; +var object = { + toString: function() { + return "*" + } +}; var x = new Array(object); if (x.join() !== "*") { $ERROR('#5: var object = {toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join())); } //CHECK#6 -var object = {valueOf: function() {return {}}, toString: function() {return "*"}} +var object = { + valueOf: function() { + return {} + }, + toString: function() { + return "*" + } +} var x = new Array(object); if (x.join() !== "*") { $ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join())); @@ -61,7 +97,14 @@ if (x.join() !== "*") { //CHECK#7 try { - var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}}; + var object = { + valueOf: function() { + return "+" + }, + toString: function() { + throw "error" + } + }; var x = new Array(object); x.join(); $ERROR('#7.1: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}} var x = new Array(object); x.join() throw "error". Actual: ' + (x.join())); @@ -74,7 +117,14 @@ catch (e) { //CHECK#8 try { - var object = {valueOf: function() {return {}}, toString: function() {return {}}}; + var object = { + valueOf: function() { + return {} + }, + toString: function() { + return {} + } + }; var x = new Array(object); x.join(); $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}} var x = new Array(object); x.join() throw TypeError. Actual: ' + (x.join())); diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A5_T1.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A5_T1.js index e8e7817939e7333c655fd7300281afdb09b28b48..90ecc5cffffe55d92f597b1930b34b6174ea4b3b 100644 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A5_T1.js +++ b/test/built-ins/Array/prototype/join/S15.4.4.5_A5_T1.js @@ -22,7 +22,9 @@ if (x.join() !== "0,1") { Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.join = Array.prototype.join; -x = {0:0}; +x = { + 0: 0 +}; if (x.join() !== "0,1") { $ERROR('#2: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.join = Array.prototype.join; x = {0:0}; x.join() === "0,1". Actual: ' + (x.join())); } diff --git a/test/built-ins/Array/prototype/keys/iteration-mutable.js b/test/built-ins/Array/prototype/keys/iteration-mutable.js index c20b26ee956224f3cf0d1daaa810732a71abb07c..d2a2ecdbbb9e03c5fa1ff4d3701d27194acc18ec 100644 --- a/test/built-ins/Array/prototype/keys/iteration-mutable.js +++ b/test/built-ins/Array/prototype/keys/iteration-mutable.js @@ -20,7 +20,7 @@ var result; array.push('a'); result = iterator.next(); -assert.sameValue(result.done, false , 'First result `done` flag'); +assert.sameValue(result.done, false, 'First result `done` flag'); assert.sameValue(result.value, 0, 'First result `value`'); result = iterator.next(); 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 39fc4df94e90d56a360cc3d9d1a15f00732ace67..a1048adc8f9150c288902776eb7483f079d7f81d 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 @@ -9,5 +9,5 @@ description: Array.prototype.lastIndexOf applied to undefined throws a TypeError assert.throws(TypeError, function() { - Array.prototype.lastIndexOf.call(undefined); + Array.prototype.lastIndexOf.call(undefined); }); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-10.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-10.js index f2f1afb8b27c96387195ae404872358f7018f44f..ba6aec098fbf4d82fd816eb6d797235dd2b72d67 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-10.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-10.js @@ -7,7 +7,7 @@ es5id: 15.4.4.15-1-10 description: Array.prototype.lastIndexOf applied to the Math object ---*/ - Math.length = 2; - Math[1] = 100; +Math.length = 2; +Math[1] = 100; assert.sameValue(Array.prototype.lastIndexOf.call(Math, 100), 1, 'Array.prototype.lastIndexOf.call(Math, 100)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-11.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-11.js index acfcd13a2a84fb4e8f4148d1cf6f01f23c17c043..ed42913de946d2f77a260956ee119bfbd55ca839 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-11.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-11.js @@ -7,8 +7,8 @@ es5id: 15.4.4.15-1-11 description: Array.prototype.lastIndexOf applied to Date object ---*/ - var obj = new Date(); - obj.length = 2; - obj[1] = true; +var obj = new Date(); +obj.length = 2; +obj[1] = true; assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 1, 'Array.prototype.lastIndexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-12.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-12.js index 54d128eb5fdc1641290f066d2d8daa836fe65f04..26b2c149209deac1a39fb96420442e5376b3f81d 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-12.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-12.js @@ -7,8 +7,8 @@ es5id: 15.4.4.15-1-12 description: Array.prototype.lastIndexOf applied to RegExp object ---*/ - var obj = new RegExp("afdasf"); - obj.length = 100; - obj[1] = "afdasf"; +var obj = new RegExp("afdasf"); +obj.length = 100; +obj[1] = "afdasf"; assert.sameValue(Array.prototype.lastIndexOf.call(obj, "afdasf"), 1, 'Array.prototype.lastIndexOf.call(obj, "afdasf")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-13.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-13.js index e6a2d816687a6e503023a563ec0c056d588ce42f..8ac92c38520261b5432fc0742d73626fa8707707 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-13.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-13.js @@ -7,9 +7,9 @@ es5id: 15.4.4.15-1-13 description: Array.prototype.lastIndexOf applied to the JSON object ---*/ - var targetObj = {}; +var targetObj = {}; - JSON[3] = targetObj; - JSON.length = 5; +JSON[3] = targetObj; +JSON.length = 5; assert.sameValue(Array.prototype.lastIndexOf.call(JSON, targetObj), 3, 'Array.prototype.lastIndexOf.call(JSON, targetObj)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-14.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-14.js index 258d52b25c970c9bf9c17abcbf16734fd5177f4e..13cd332841e9c472c546424ad29e34c2d048682a 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-14.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-14.js @@ -7,8 +7,8 @@ es5id: 15.4.4.15-1-14 description: Array.prototype.lastIndexOf applied to Error object ---*/ - var obj = new SyntaxError(); - obj.length = 2; - obj[1] = Infinity; +var obj = new SyntaxError(); +obj.length = 2; +obj[1] = Infinity; assert.sameValue(Array.prototype.lastIndexOf.call(obj, Infinity), 1, 'Array.prototype.lastIndexOf.call(obj, Infinity)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-15.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-15.js index 717e839b3640144f51b4564d1273507ce3dd0861..4d0dcb42a69bc2313cab426a08bcf7a52ca93972 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-15.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-15.js @@ -7,8 +7,8 @@ es5id: 15.4.4.15-1-15 description: Array.prototype.lastIndexOf applied to the Arguments object ---*/ - var obj = (function fun() { - return arguments; - }(1, 2, 3)); +var obj = (function fun() { + return arguments; +}(1, 2, 3)); assert.sameValue(Array.prototype.lastIndexOf.call(obj, 2), 1, 'Array.prototype.lastIndexOf.call(obj, 2)'); 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 d09b72ba6378d95e7c309aae8811377fcd6f9cc1..ee2d9c1dc9a4fdd4c5f146c4385302b6f6977152 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 @@ -9,5 +9,5 @@ description: Array.prototype.lastIndexOf applied to null throws a TypeError assert.throws(TypeError, function() { - Array.prototype.lastIndexOf.call(null); + Array.prototype.lastIndexOf.call(null); }); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-3.js index 07823a7430b784983152a63d3154d592802a5b70..80339e81ed56a6711955c84a86a4212ee0096cb4 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-3.js @@ -7,7 +7,7 @@ es5id: 15.4.4.15-1-3 description: Array.prototype.lastIndexOf applied to boolean primitive ---*/ - Boolean.prototype[1] = true; - Boolean.prototype.length = 2; +Boolean.prototype[1] = true; +Boolean.prototype.length = 2; assert.sameValue(Array.prototype.lastIndexOf.call(true, true), 1, 'Array.prototype.lastIndexOf.call(true, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-4.js index d04aef167eda078a9286c145e153fb83ddf4d51e..6a71084ce9342729716f650dbdc84b3ad718fff8 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-4.js @@ -7,8 +7,8 @@ es5id: 15.4.4.15-1-4 description: Array.prototype.lastIndexOf applied to Boolean object ---*/ - var obj = new Boolean(false); - obj.length = 2; - obj[1] = true; +var obj = new Boolean(false); +obj.length = 2; +obj[1] = true; assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 1, 'Array.prototype.lastIndexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-5.js index 1119ac1aaf4d124b40846d56e9aadad1e4310ef8..840ae225c28e46546b6459ccf4341feb465b8bbd 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-5.js @@ -7,7 +7,7 @@ es5id: 15.4.4.15-1-5 description: Array.prototype.lastIndexOf applied to number primitive ---*/ - Number.prototype[1] = isNaN; - Number.prototype.length = 2; +Number.prototype[1] = isNaN; +Number.prototype.length = 2; assert.sameValue(Array.prototype.lastIndexOf.call(5, isNaN), 1, 'Array.prototype.lastIndexOf.call(5, isNaN)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-6.js index 5e96b816e22be47b326b3145257c0b11a3ceec50..e35973cd83895084e3cbab6eb59bcd6d0e43321e 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-6.js @@ -7,8 +7,8 @@ es5id: 15.4.4.15-1-6 description: Array.prototype.lastIndexOf applied to Number object ---*/ - var obj = new Number(-3); - obj.length = 2; - obj[1] = true; +var obj = new Number(-3); +obj.length = 2; +obj[1] = true; assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 1, 'Array.prototype.lastIndexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-8.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-8.js index d623c9beab92b8060ac65ef6b16700c9d1fa3548..9983969957ec0cf967049e89fc3e04d48e85b03e 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-8.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-8.js @@ -7,6 +7,6 @@ es5id: 15.4.4.15-1-8 description: Array.prototype.lastIndexOf applied to String object ---*/ - var obj = new String("undefined"); +var obj = new String("undefined"); assert.sameValue(Array.prototype.lastIndexOf.call(obj, "f"), 4, 'Array.prototype.lastIndexOf.call(obj, "f")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-9.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-9.js index 7372b6b1f7b06582f0d47fcc7a19d49cb05a941d..6d69baa7c3fb82117517234470d72fbedf612674 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-9.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-9.js @@ -7,9 +7,9 @@ es5id: 15.4.4.15-1-9 description: Array.prototype.lastIndexOf applied to Function object ---*/ - var obj = function (a, b) { - return a + b; - }; - obj[1] = true; +var obj = function(a, b) { + return a + b; +}; +obj[1] = true; assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 1, 'Array.prototype.lastIndexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-1.js index 5da3312da3146d098dfdc9f91996ed9816c1893d..09c37e87c75ae291a9694a5ec9a2ace1f1808242 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-1.js @@ -9,7 +9,11 @@ description: > Array-like object ---*/ - var obj = { 1: null, 2: undefined, length: 2 }; +var obj = { + 1: null, + 2: undefined, + length: 2 +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, null), 1, 'Array.prototype.lastIndexOf.call(obj, null)'); assert.sameValue(Array.prototype.lastIndexOf.call(obj, undefined), -1, 'Array.prototype.lastIndexOf.call(obj, undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-10.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-10.js index a77b62b12493b7d881fcf17157d378e7ae20aaa9..8a17af9c010736e6c29f0e95d70ad4cd44fdb79c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-10.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-10.js @@ -9,20 +9,20 @@ description: > property on an Array-like object ---*/ - var proto = {}; - Object.defineProperty(proto, "length", { - get: function () { - return 2; - }, - configurable: true - }); +var proto = {}; +Object.defineProperty(proto, "length", { + get: function() { + return 2; + }, + configurable: true +}); - var Con = function () {}; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[1] = 1; - child[2] = 2; +var child = new Con(); +child[1] = 1; +child[2] = 2; assert.sameValue(Array.prototype.lastIndexOf.call(child, 1), 1, 'Array.prototype.lastIndexOf.call(child, 1)'); assert.sameValue(Array.prototype.lastIndexOf.call(child, 2), -1, 'Array.prototype.lastIndexOf.call(child, 2)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-11.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-11.js index 0ae767b6f09541609f32e82126995cdcb35fae0d..ab2b9fdd70bb35f4fc91ae9feeab503a74bedc42 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-11.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-11.js @@ -9,10 +9,12 @@ description: > without a get function on an Array-like object ---*/ - var obj = { 0: 1 }; - Object.defineProperty(obj, "length", { - set: function () { }, - configurable: true - }); +var obj = { + 0: 1 +}; +Object.defineProperty(obj, "length", { + set: function() {}, + configurable: true +}); assert.sameValue(Array.prototype.lastIndexOf.call(obj, 1), -1, 'Array.prototype.lastIndexOf.call(obj, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-12.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-12.js index 98cf2147a23a6d852ab42e0388c99f49e913cd9a..fcd9b41d156410cad4786dc07d3ec9d1a7d4fe69 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-12.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-12.js @@ -10,17 +10,19 @@ description: > property on an Array-like object ---*/ - Object.defineProperty(Object.prototype, "length", { - get: function () { - return 20; - }, - configurable: true - }); +Object.defineProperty(Object.prototype, "length", { + get: function() { + return 20; + }, + configurable: true +}); - var obj = { 1: 1 }; - Object.defineProperty(obj, "length", { - set: function () { }, - configurable: true - }); +var obj = { + 1: 1 +}; +Object.defineProperty(obj, "length", { + set: function() {}, + configurable: true +}); assert.sameValue(Array.prototype.lastIndexOf.call(obj, 1), -1, 'Array.prototype.lastIndexOf.call(obj, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-13.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-13.js index 59045d59d4c87f77801c11b084cbfb2f8a8f1017..6f379e88618969376fa3533a5f7ee76490eb70dc 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-13.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-13.js @@ -9,16 +9,16 @@ description: > property without a get function on an Array-like object ---*/ - var proto = {}; - Object.defineProperty(proto, "length", { - set: function () { }, - configurable: true - }); +var proto = {}; +Object.defineProperty(proto, "length", { + set: function() {}, + configurable: true +}); - var Con = function () {}; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[0] = true; +var child = new Con(); +child[0] = true; assert.sameValue(Array.prototype.lastIndexOf.call(child, true), -1, 'Array.prototype.lastIndexOf.call(child, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-14.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-14.js index f88b2b3c847acf294842a668adfe6f366bde343c..f47f32dc700872498410682be1deb0a01f5d991c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-14.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-14.js @@ -9,6 +9,9 @@ description: > Array-like object ---*/ - var obj = { 0: null, 1: undefined }; +var obj = { + 0: null, + 1: undefined +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, null), -1, 'Array.prototype.lastIndexOf.call(obj, null)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-17.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-17.js index 02ea04ddd98da6dbf6d626ff6ef6a232cbf02599..62532d79aa383db0e8217c40cc44689ff757880a 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-17.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-17.js @@ -9,11 +9,11 @@ description: > implements its own property get method ---*/ - var targetObj = function () { }; - var func = function (a, b) { - arguments[2] = function () { }; - return Array.prototype.lastIndexOf.call(arguments, targetObj) === 1 && - Array.prototype.lastIndexOf.call(arguments, arguments[2]) === -1; - }; +var targetObj = function() {}; +var func = function(a, b) { + arguments[2] = function() {}; + return Array.prototype.lastIndexOf.call(arguments, targetObj) === 1 && + Array.prototype.lastIndexOf.call(arguments, arguments[2]) === -1; +}; assert(func(0, targetObj), 'func(0, targetObj) !== true'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-18.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-18.js index 6cf87f6445a54b727a8d0ad1e7684ba21756fc8a..f2a6682fe8c6482e793baf8fdf72afd4706f8f3a 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-18.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-18.js @@ -9,9 +9,9 @@ description: > implements its own property get method ---*/ - var str = new String("012"); +var str = new String("012"); - String.prototype[3] = "3"; +String.prototype[3] = "3"; assert.sameValue(Array.prototype.lastIndexOf.call(str, "2"), 2, 'Array.prototype.lastIndexOf.call(str, "2")'); assert.sameValue(Array.prototype.lastIndexOf.call(str, "3"), -1, 'Array.prototype.lastIndexOf.call(str, "3")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-19.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-19.js index 89565918b63e9fba0b7acc285a73f3e5565f8422..e5542f0ed62ec4beeaf19406cc8b8932741d7dd6 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-19.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-19.js @@ -9,11 +9,11 @@ description: > implements its own property get method ---*/ - var obj = function (a, b) { - return a + b; - }; - obj[1] = "b"; - obj[2] = "c"; +var obj = function(a, b) { + return a + b; +}; +obj[1] = "b"; +obj[2] = "c"; assert.sameValue(Array.prototype.lastIndexOf.call(obj, obj[1]), 1, 'Array.prototype.lastIndexOf.call(obj, obj[1])'); assert.sameValue(Array.prototype.lastIndexOf.call(obj, obj[2]), -1, 'Array.prototype.lastIndexOf.call(obj, obj[2])'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-2.js index 651492954107624720aaebd17a831f6c0e02fbcc..134cd566a4846f5195f32a7c1a0fd66205a7d021 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-2.js @@ -9,9 +9,9 @@ description: > Array ---*/ - var targetObj = {}; +var targetObj = {}; - Array.prototype[2] = targetObj; +Array.prototype[2] = targetObj; assert.sameValue([0, targetObj].lastIndexOf(targetObj), 1, '[0, targetObj].lastIndexOf(targetObj)'); assert.sameValue([0, 1].lastIndexOf(targetObj), -1, '[0, 1].lastIndexOf(targetObj)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-3.js index b500b9f10e9b1606ddc82f16560851c5dcaefe1b..5d2a8bbf1f697887e1e52ec0772b796520eb427a 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-3.js @@ -9,13 +9,15 @@ description: > overrides an inherited data property on an Array-like object ---*/ - var proto = {length: 0}; +var proto = { + length: 0 +}; - var Con = function () {}; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 2; - child[1] = child; +var child = new Con(); +child.length = 2; +child[1] = child; assert.sameValue(Array.prototype.lastIndexOf.call(child, child), 1, 'Array.prototype.lastIndexOf.call(child, child)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-4.js index a13cc99a93b7ec9c09b622b6d16c2d85e4be75ed..0a8f124f3a05e8642922e51711868331d12717ff 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-4.js @@ -9,10 +9,10 @@ description: > that overrides an inherited data property on an Array ---*/ - var targetObj = {}; - var arrProtoLen; +var targetObj = {}; +var arrProtoLen; - arrProtoLen = Array.prototype.length; - Array.prototype.length = 0; +arrProtoLen = Array.prototype.length; +Array.prototype.length = 0; assert.sameValue([0, targetObj, 2].lastIndexOf(targetObj), 1, '[0, targetObj, 2].lastIndexOf(targetObj)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-5.js index fa298751004e211929f19d7c7a798f5e1f6df308..33e9075e608bc34604f94b8cc8519bce5f1eba8f 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-5.js @@ -9,23 +9,23 @@ description: > overrides an inherited accessor property on an Array-like object ---*/ - var proto = {}; - Object.defineProperty(proto, "length", { - get: function () { - return 0; - }, - configurable: true - }); +var proto = {}; +Object.defineProperty(proto, "length", { + get: function() { + return 0; + }, + configurable: true +}); - var Con = function () {}; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); +var child = new Con(); - Object.defineProperty(child, "length", { - value: 2, - configurable: true - }); - child[1] = null; +Object.defineProperty(child, "length", { + value: 2, + configurable: true +}); +child[1] = null; assert.sameValue(Array.prototype.lastIndexOf.call(child, null), 1, 'Array.prototype.lastIndexOf.call(child, null)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-6.js index bfe82a3ac78c48c2312dff55ebe74e016c5a09e2..05900f832f485c163e8c8618687a9b388bf357ef 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-6.js @@ -9,14 +9,16 @@ description: > property on an Array-like object ---*/ - var proto = { length: 2 }; +var proto = { + length: 2 +}; - var Con = function () {}; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[1] = "x"; - child[2] = "y"; +var child = new Con(); +child[1] = "x"; +child[2] = "y"; assert.sameValue(Array.prototype.lastIndexOf.call(child, "x"), 1, 'Array.prototype.lastIndexOf.call(child, "x")'); assert.sameValue(Array.prototype.lastIndexOf.call(child, "y"), -1, 'Array.prototype.lastIndexOf.call(child, "y")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-7.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-7.js index d5b44311572d8652d56f0545f7571f091ed97b47..4c38da5be212623253ada12a68ba39313c9dcd86 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-7.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-7.js @@ -9,14 +9,17 @@ description: > an Array-like object ---*/ - var obj = { 1: true, 2: false }; +var obj = { + 1: true, + 2: false +}; - Object.defineProperty(obj, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return 2; + }, + configurable: true +}); assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 1, 'Array.prototype.lastIndexOf.call(obj, true)'); assert.sameValue(Array.prototype.lastIndexOf.call(obj, false), -1, 'Array.prototype.lastIndexOf.call(obj, false)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-8.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-8.js index 61f659a699b6636e844a534d8d25e13e4e754124..ef7ea0a5192eb7731b87b907174ffcf22c1b3075 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-8.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-8.js @@ -9,19 +9,21 @@ description: > that overrides an inherited data property on an Array-like object ---*/ - var proto = { length: 0 }; +var proto = { + length: 0 +}; - var Con = function () {}; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[1] = eval; +var child = new Con(); +child[1] = eval; - Object.defineProperty(child, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(child, "length", { + get: function() { + return 2; + }, + configurable: true +}); assert.sameValue(Array.prototype.lastIndexOf.call(child, eval), 1, 'Array.prototype.lastIndexOf.call(child, eval)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-9.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-9.js index 3e0695eb830d053c51b10ed124f2730686737ef0..9bc7a8b5bd7e33f3cb88674e57a257383672c6c5 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-9.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-9.js @@ -10,25 +10,25 @@ description: > object ---*/ - var proto = {}; - Object.defineProperty(proto, "length", { - get: function () { - return 0; - }, - configurable: true - }); +var proto = {}; +Object.defineProperty(proto, "length", { + get: function() { + return 0; + }, + configurable: true +}); - var Con = function () {}; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[1] = true; +var child = new Con(); +child[1] = true; - Object.defineProperty(child, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(child, "length", { + get: function() { + return 2; + }, + configurable: true +}); assert.sameValue(Array.prototype.lastIndexOf.call(child, true), 1, 'Array.prototype.lastIndexOf.call(child, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-1.js index 374141ad0b61ff38887c04a6f0ef21d760623636..1141fd90a14a7502a86cd382a2166af62bc2cc38 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-1.js @@ -7,6 +7,10 @@ es5id: 15.4.4.15-3-1 description: Array.prototype.lastIndexOf - value of 'length' is undefined ---*/ - var obj = { 0: 1, 1: 1, length: undefined }; +var obj = { + 0: 1, + 1: 1, + length: undefined +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, 1), -1, 'Array.prototype.lastIndexOf.call(obj, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-10.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-10.js index c6da7633955440520e2bc6e1e642ee253e86c3a7..761fd85c13f209ce59f01e4004a87e7903d47f68 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-10.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-10.js @@ -9,6 +9,9 @@ description: > is NaN) ---*/ - var obj = { 0: 0, length: NaN }; +var obj = { + 0: 0, + length: NaN +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, 0), -1, 'Array.prototype.lastIndexOf.call(obj, 0)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-11.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-11.js index f0838068e5b2f599b7a16d766abf22e7c436179d..dae527da98fe7ee4e669c32b6edee42ec1c27659 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-11.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-11.js @@ -9,7 +9,11 @@ description: > containing positive number ---*/ - var obj = {1: true, 2: false, length: "2"}; +var obj = { + 1: true, + 2: false, + length: "2" +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 1, 'Array.prototype.lastIndexOf.call(obj, true)'); assert.sameValue(Array.prototype.lastIndexOf.call(obj, false), -1, 'Array.prototype.lastIndexOf.call(obj, false)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-12.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-12.js index 6811ff35d8196d01641d192daae68adf4dbacd75..99df97b76d22ec3db8a79816f29c7a372c86b500 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-12.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-12.js @@ -9,7 +9,11 @@ description: > containing negative number ---*/ - var obj = {1: null, 2: undefined, length: "-4294967294"}; +var obj = { + 1: null, + 2: undefined, + length: "-4294967294" +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, null), -1, 'Array.prototype.lastIndexOf.call(obj, null)'); assert.sameValue(Array.prototype.lastIndexOf.call(obj, undefined), -1, 'Array.prototype.lastIndexOf.call(obj, undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-13.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-13.js index afdcf21df2c7abd695e697050ea27d7ff8e4d421..394744d69384ef2cfd4644c07bf9ca7be9c8baf7 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-13.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-13.js @@ -9,7 +9,11 @@ description: > containing a decimal number ---*/ - var obj = { 4: 4, 5: 5, length: "5.512345" }; +var obj = { + 4: 4, + 5: 5, + length: "5.512345" +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, 4), 4, 'Array.prototype.lastIndexOf.call(obj, 4)'); assert.sameValue(Array.prototype.lastIndexOf.call(obj, 5), -1, 'Array.prototype.lastIndexOf.call(obj, 5)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-14.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-14.js index a49316794db4c6c5a959a128d044456d725ee202..3751aeb805d095ecd3a7cdedb744ea3994eeec44 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-14.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-14.js @@ -9,6 +9,10 @@ description: > containing -Infinity ---*/ - var objThree = { 0: true, 1: true, length: "-Infinity" }; +var objThree = { + 0: true, + 1: true, + length: "-Infinity" +}; assert.sameValue(Array.prototype.lastIndexOf.call(objThree, true), -1, 'Array.prototype.lastIndexOf.call(objThree, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-15.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-15.js index 281305e13f2f69c771265eeb38eb0e1c5fe0285f..cb669fc0167cabd149eaf7276ac056c955c3fd99 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-15.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-15.js @@ -9,7 +9,11 @@ description: > containing an exponential number ---*/ - var obj = {229: 229, 230: 2.3E2, length: "2.3E2"}; +var obj = { + 229: 229, + 230: 2.3E2, + length: "2.3E2" +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, 229), 229, 'Array.prototype.lastIndexOf.call(obj, 229)'); assert.sameValue(Array.prototype.lastIndexOf.call(obj, 2.3E2), -1, 'Array.prototype.lastIndexOf.call(obj, 2.3E2)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-16.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-16.js index 6c0e5e388d761a97fb376f9b0c5bfc5f9a302205..653a8ea366d5fa1d3890729969741525d1af4dbe 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-16.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-16.js @@ -9,7 +9,11 @@ description: > is able to be converted into hex number ---*/ - var obj = { 2573: 2573, 2574: 0x000A0E, length: "0x000A0E" }; +var obj = { + 2573: 2573, + 2574: 0x000A0E, + length: "0x000A0E" +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, 2573), 2573, 'Array.prototype.lastIndexOf.call(obj, 2573)'); assert.sameValue(Array.prototype.lastIndexOf.call(obj, 0x000A0E), -1, 'Array.prototype.lastIndexOf.call(obj, 0x000A0E)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-17.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-17.js index c603231587b2f76f01f1a60903eed05adac6e2d7..345e54e1461a27ae12c383ac4cc5afb7d159c254 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-17.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-17.js @@ -9,7 +9,11 @@ description: > containing a number with leading zeros ---*/ - var obj = { 1: 1, 2: 2, length: "0002.0" }; +var obj = { + 1: 1, + 2: 2, + length: "0002.0" +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, 1), 1, 'Array.prototype.lastIndexOf.call(obj, 1)'); assert.sameValue(Array.prototype.lastIndexOf.call(obj, 2), -1, 'Array.prototype.lastIndexOf.call(obj, 2)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-18.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-18.js index a56ab67a71c72243564e9701ea57ecc8431d1a2c..76161d8da053de90e229fea45fd7cf1fbbd9ae5d 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-18.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-18.js @@ -9,7 +9,10 @@ description: > can't convert to a number ---*/ - var targetObj = new String("123abc123"); - var obj = { 0: targetObj, length: "123abc123" }; +var targetObj = new String("123abc123"); +var obj = { + 0: targetObj, + length: "123abc123" +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, targetObj), -1, 'Array.prototype.lastIndexOf.call(obj, targetObj)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-19.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-19.js index 419be48569e3919f17a8611f3f2cac1b9f352a7c..bbbf635c8b0224feac6548f9717602faccda886f 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-19.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-19.js @@ -9,23 +9,23 @@ description: > has an own toString method ---*/ - // objects inherit the default valueOf() method from Object - // that simply returns itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. +// objects inherit the default valueOf() method from Object +// that simply returns itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. - var targetObj = this; - var obj = { - 1: targetObj, - 2: 2, +var targetObj = this; +var obj = { + 1: targetObj, + 2: 2, - length: { - toString: function () { - return '2'; - } - } - }; + length: { + toString: function() { + return '2'; + } + } +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, targetObj), 1, 'Array.prototype.lastIndexOf.call(obj, targetObj)'); assert.sameValue(Array.prototype.lastIndexOf.call(obj, 2), -1, 'Array.prototype.lastIndexOf.call(obj, 2)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-2.js index 16314cad2ccd3958766c279366b6e4612fc810af..1f603c3804f1c747038d4d8655372588110d8236 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-2.js @@ -9,7 +9,11 @@ description: > boolean (value is true) ---*/ - var obj = { 0: 0, 1: 1, length: true }; +var obj = { + 0: 0, + 1: 1, + length: true +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, 0), 0, 'Array.prototype.lastIndexOf.call(obj, 0)'); assert.sameValue(Array.prototype.lastIndexOf.call(obj, 1), -1, 'Array.prototype.lastIndexOf.call(obj, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-20.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-20.js index 56d05e1a125e4951638109ee68cf8922164d11b9..51df32323913e014ae871c1055090ba05a81dc25 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-20.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-20.js @@ -9,17 +9,17 @@ description: > has an own valueOf method ---*/ - //valueOf method will be invoked first, since hint is Number - var obj = { - 1: true, - 2: 2, +//valueOf method will be invoked first, since hint is Number +var obj = { + 1: true, + 2: 2, - length: { - valueOf: function () { - return 2; - } - } - }; + length: { + valueOf: function() { + return 2; + } + } +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 1, 'Array.prototype.lastIndexOf.call(obj, true)'); assert.sameValue(Array.prototype.lastIndexOf.call(obj, 2), -1, 'Array.prototype.lastIndexOf.call(obj, 2)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-21.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-21.js index d568434fa9e8c076691890e4108d274305945e82..4ffe9d3bfd4807eff8730897e24175a765e03eda 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-21.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-21.js @@ -10,24 +10,24 @@ description: > returns a string ---*/ - var toStringAccessed = false; - var valueOfAccessed = false; +var toStringAccessed = false; +var valueOfAccessed = false; - var targetObj = this; - var obj = { - 1: targetObj, - length: { - toString: function () { - toStringAccessed = true; - return '3'; - }, +var targetObj = this; +var obj = { + 1: targetObj, + length: { + toString: function() { + toStringAccessed = true; + return '3'; + }, - valueOf: function () { - valueOfAccessed = true; - return {}; - } - } - }; + valueOf: function() { + valueOfAccessed = true; + return {}; + } + } +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, targetObj), 1, 'Array.prototype.lastIndexOf.call(obj, targetObj)'); assert(toStringAccessed, 'toStringAccessed !== true'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-22.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-22.js index 9624defeb898e4a9ee09f6a5e7412c0e3432d11b..69aa3c8f9e1457f78aaa0f2174e92d53bf12155d 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-22.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-22.js @@ -10,26 +10,26 @@ description: > return primitive values ---*/ - var toStringAccessed = false; - var valueOfAccessed = false; +var toStringAccessed = false; +var valueOfAccessed = false; - var obj = { - 1: true, - length: { - toString: function () { - toStringAccessed = true; - return {}; - }, +var obj = { + 1: true, + length: { + toString: function() { + toStringAccessed = true; + return {}; + }, - valueOf: function () { - valueOfAccessed = true; - return {}; - } - } - }; + valueOf: function() { + valueOfAccessed = true; + return {}; + } + } +}; assert.throws(TypeError, function() { - Array.prototype.lastIndexOf.call(obj, true); + Array.prototype.lastIndexOf.call(obj, true); }); assert(toStringAccessed, 'toStringAccessed'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-23.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-23.js index a69b33edfc53467f5096d2cdfaa61706eb58d4c3..178517a413682c02f4dbcf8fe28f4fa9a5c5075d 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-23.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-23.js @@ -10,29 +10,29 @@ description: > valueOf methods ---*/ - var toStringAccessed = false; - var valueOfAccessed = false; +var toStringAccessed = false; +var valueOfAccessed = false; - var proto = { - valueOf: function () { - valueOfAccessed = true; - return 2; - } - }; +var proto = { + valueOf: function() { + valueOfAccessed = true; + return 2; + } +}; - var Con = function () {}; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.toString = function () { - toStringAccessed = true; - return 2; - }; +var child = new Con(); +child.toString = function() { + toStringAccessed = true; + return 2; +}; - var obj = { - 1: child, - length: child - }; +var obj = { + 1: child, + length: child +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, child), 1, 'Array.prototype.lastIndexOf.call(obj, child)'); assert(valueOfAccessed, 'valueOfAccessed !== true'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-24.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-24.js index 31ffe0ed733b393c56bf0f3dffd9ad25b0695210..08763b59058678af6d58182b4a52627a44b6d59c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-24.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-24.js @@ -9,7 +9,11 @@ description: > non-integer, ensure truncation occurs in the proper direction ---*/ - var obj = { 122: true, 123: false, length: 123.5 }; +var obj = { + 122: true, + 123: false, + length: 123.5 +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 122, 'Array.prototype.lastIndexOf.call(obj, true)'); assert.sameValue(Array.prototype.lastIndexOf.call(obj, false), -1, 'Array.prototype.lastIndexOf.call(obj, false)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-25.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-25.js index 12e37f63be4aa1bafedb34bb5a220c38570a1ed0..fe78a4e2dba2c12b94cd00ccb71e3f9321735536 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-25.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-25.js @@ -9,7 +9,11 @@ description: > non-integer ---*/ - var obj = { 1: true, 2: false, length: -4294967294.5 }; +var obj = { + 1: true, + 2: false, + length: -4294967294.5 +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), -1, 'Array.prototype.lastIndexOf.call(obj, true)'); assert.sameValue(Array.prototype.lastIndexOf.call(obj, false), -1, 'Array.prototype.lastIndexOf.call(obj, false)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-28.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-28.js index a28fbc7465221365c9c123251f243bed830cc05f..4768053245a969dac9df98898f10c566f16d428d 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-28.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-28.js @@ -9,12 +9,12 @@ description: > (2^32) ---*/ - var targetObj = {}; - var obj = { - 0: targetObj, - 4294967294: targetObj, - 4294967295: targetObj, - length: 4294967296 - }; +var targetObj = {}; +var obj = { + 0: targetObj, + 4294967294: targetObj, + 4294967295: targetObj, + length: 4294967296 +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, targetObj), 4294967295, 'verify length is 4294967296 finally'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-3.js index 069585fb210b711e5eb9c6a0f700c80d3b53ea9f..98bb896dffa1382b997fd8be88cf992a59d28bf9 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-3.js @@ -9,6 +9,9 @@ description: > is 0) ---*/ - var obj = { 0: "undefined", length: 0 }; +var obj = { + 0: "undefined", + length: 0 +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, "undefined"), -1, 'Array.prototype.lastIndexOf.call(obj, "undefined")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-4.js index 1c8a99b9cf0e13c1a51dbc76a9a5e29b0abb7c9e..5e6cedae92a99a1a821563aec28dcf9cbfc87cdc 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-4.js @@ -9,6 +9,9 @@ description: > is -0) ---*/ - var obj = { 0: true, length: -0 }; +var obj = { + 0: true, + length: -0 +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), -1, 'Array.prototype.lastIndexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-5.js index 927ee3daa2a1cc4634ab67e2994d87dff1cded14..60a1721895159c4e57ff5f6a8ad250a0363f4618 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-5.js @@ -9,6 +9,9 @@ description: > is +0) ---*/ - var obj = { 0: +0, length: +0 }; +var obj = { + 0: +0, + length: +0 +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, +0), -1, 'Array.prototype.lastIndexOf.call(obj, +0)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-6.js index 8aec6c2c1dc0ca619c6fb8d37fef87aaff621121..5f097dbb01a20085729a3b7133f9780b40bd22e2 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-6.js @@ -9,7 +9,11 @@ description: > is a positive number) ---*/ - var obj = { 99: true, 100: 100, length: 100 }; +var obj = { + 99: true, + 100: 100, + length: 100 +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 99, 'Array.prototype.lastIndexOf.call(obj, true)'); assert.sameValue(Array.prototype.lastIndexOf.call(obj, 100), -1, 'Array.prototype.lastIndexOf.call(obj, 100)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-7.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-7.js index ff7fbc0d2835f06b1702ca4c8ae382fdca4c927b..8f912984973fed598351338f4dc7501e3f37d070 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-7.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-7.js @@ -9,7 +9,11 @@ description: > is a negative number) ---*/ - var obj = { 4: -Infinity, 5: Infinity, length: 5 - Math.pow(2, 32) }; +var obj = { + 4: -Infinity, + 5: Infinity, + length: 5 - Math.pow(2, 32) +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, -Infinity), -1, 'Array.prototype.lastIndexOf.call(obj, -Infinity)'); assert.sameValue(Array.prototype.lastIndexOf.call(obj, Infinity), -1, 'Array.prototype.lastIndexOf.call(obj, Infinity)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-9.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-9.js index 39856e71324eb01a7617d91e08ce8c2f11786b2b..b9387834165f75d82872c47ce10a9e8ef4995a5b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-9.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-9.js @@ -9,6 +9,9 @@ description: > is -Infinity) ---*/ - var obj = { 0: 0, length: -Infinity }; +var obj = { + 0: 0, + length: -Infinity +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, 0), -1, 'Array.prototype.lastIndexOf.call(obj, 0)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-1.js index f073190b94b8e9fe6e5cc1be324cd66c427c931e..f6fc912532fd6f66cff0f9f7651b75088995fa5c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-1.js @@ -9,6 +9,6 @@ description: > array) ---*/ - var i = [].lastIndexOf(42); +var i = [].lastIndexOf(42); assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-10.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-10.js index 72514438f6a9382779814c427450f42fccd3601c..1899442e7a92a622192cb2346019f2a9245b2348 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-10.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-10.js @@ -7,7 +7,11 @@ es5id: 15.4.4.15-4-10 description: Array.prototype.lastIndexOf - 'length' is a number of value -6e-1 ---*/ - var targetObj = []; - var obj = { 0: targetObj, 100: targetObj, length: -6e-1 }; +var targetObj = []; +var obj = { + 0: targetObj, + 100: targetObj, + length: -6e-1 +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, targetObj), -1, 'Array.prototype.lastIndexOf.call(obj, targetObj)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-11.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-11.js index fdf1b598e2110301aa39e073cded450a6f68768f..cec59b134a02c4080c01e0c2a9950be7f119bfb2 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-11.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-11.js @@ -7,7 +7,11 @@ es5id: 15.4.4.15-4-11 description: Array.prototype.lastIndexOf - 'length' is an empty string ---*/ - var targetObj = []; - var obj = { 0: targetObj, 100: targetObj, length: "" }; +var targetObj = []; +var obj = { + 0: targetObj, + 100: targetObj, + length: "" +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, targetObj), -1, 'Array.prototype.lastIndexOf.call(obj, targetObj)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-2.js index ced61de4cc87366c4f94e3ca489d88d36e0a9129..5ed7ad2496523e6a60bb0b2ab2bb3eda6a8fbc45 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-2.js @@ -9,7 +9,9 @@ description: > overridden to null (type conversion)) ---*/ - var i = Array.prototype.lastIndexOf.call({length: null}, 1); +var i = Array.prototype.lastIndexOf.call({ + length: null +}, 1); assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-3.js index 52e2fa68c1e0b962e63be99ed13dc754d6e0c2ed..2004e36780bc62ad0ae114cbef27504b35a79493 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-3.js @@ -9,7 +9,9 @@ description: > overridden to false (type conversion)) ---*/ - var i = Array.prototype.lastIndexOf.call({length: false}, 1); +var i = Array.prototype.lastIndexOf.call({ + length: false +}, 1); assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-4.js index 592a69274d7dbd6b73935b5508397b5646ab3c84..b2babee1dd0ed3a3a1d36191dfff9a97ef1056d6 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-4.js @@ -9,12 +9,15 @@ description: > 'array' with length 0 ) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = 0; +foo.prototype = new Array(1, 2, 3); - var i = Array.prototype.lastIndexOf.call({length: 0}, 1); +function foo() {} +var f = new foo(); +f.length = 0; + +var i = Array.prototype.lastIndexOf.call({ + length: 0 +}, 1); assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-5.js index f664184bc1680c61051da0f1b20b59515302b8aa..9e72015657a1746283b72e6aa47644ebb2046f66 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-5.js @@ -9,7 +9,9 @@ description: > overridden to '0' (type conversion)) ---*/ - var i = Array.prototype.lastIndexOf.call({length: '0'}, 1); +var i = Array.prototype.lastIndexOf.call({ + length: '0' +}, 1); assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-6.js index 2a81100b76b1d97977d3727749c2bd83098130dc..1362e14aed0d630e6d38d8da63bd2045d988c153 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-6.js @@ -9,7 +9,13 @@ description: > (subclassed Array, length overridden with obj with valueOf) ---*/ - var i = Array.prototype.lastIndexOf.call({length: { valueOf: function () { return 0;}}}, 1); +var i = Array.prototype.lastIndexOf.call({ + length: { + valueOf: function() { + return 0; + } + } +}, 1); assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-7.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-7.js index cf238e3e2a590e760dfed5fa72bd471b8fde1d43..57850a0270d27e20acf089ef4f3a13055da7b26c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-7.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-7.js @@ -9,19 +9,30 @@ description: > is object overridden with obj w/o valueOf (toString)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - var o = { toString: function () { return '0';}}; - f.length = o; +function foo() {} +var f = new foo(); - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - var i = Array.prototype.lastIndexOf.call({length: { toString: function () { return '0';}}}, 1); +var o = { + toString: function() { + return '0'; + } +}; +f.length = o; + +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +var i = Array.prototype.lastIndexOf.call({ + length: { + toString: function() { + return '0'; + } + } +}, 1); assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-8.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-8.js index 90fdbad630c4e72bacd91e02feca8a8a0aa4a69d..ae98ed9f0f84f6affad502995ea209250eee317c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-8.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-8.js @@ -9,20 +9,22 @@ description: > an empty array) ---*/ - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - // - // The toString( ) method on Array converts the array elements to strings, - // then returns the result of concatenating these strings, with commas in - // between. An array with no elements converts to the empty string, which - // converts to the number 0. If an array has a single element that is a - // number n, the array converts to a string representation of n, which is - // then converted back to n itself. If an array contains more than one element, - // or if its one element is not a number, the array converts to NaN. - var i = Array.prototype.lastIndexOf.call({length: [ ]}, 1); +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +// +// The toString( ) method on Array converts the array elements to strings, +// then returns the result of concatenating these strings, with commas in +// between. An array with no elements converts to the empty string, which +// converts to the number 0. If an array has a single element that is a +// number n, the array converts to a string representation of n, which is +// then converted back to n itself. If an array contains more than one element, +// or if its one element is not a number, the array converts to NaN. +var i = Array.prototype.lastIndexOf.call({ + length: [] +}, 1); assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-9.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-9.js index 6ebf6b4eb2392d1343edeb899f981f5c3f7ad38b..7f758adeccb697f2edbf30b3060ebeb82f152067 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-9.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-9.js @@ -7,7 +7,11 @@ es5id: 15.4.4.15-4-9 description: Array.prototype.lastIndexOf - 'length' is a number of value 0.1 ---*/ - var targetObj = []; - var obj = { 0: targetObj, 100: targetObj, length: 0.1 }; +var targetObj = []; +var obj = { + 0: targetObj, + 100: targetObj, + length: 0.1 +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, targetObj), -1, 'Array.prototype.lastIndexOf.call(obj, targetObj)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-1.js index 44f940354908f9b3db76ee9bdb032207411b2428..f632c5bf9b15377373014580546afe3314d30572 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-1.js @@ -7,7 +7,7 @@ es5id: 15.4.4.15-5-1 description: Array.prototype.lastIndexOf when fromIndex is string ---*/ - var a = new Array(0,1,1); +var a = new Array(0, 1, 1); -assert.sameValue(a.lastIndexOf(1,"1"), 1, '"1" resolves to 1'); -assert.sameValue(a.lastIndexOf(1,"one"), -1, 'NaN string resolves to 01'); +assert.sameValue(a.lastIndexOf(1, "1"), 1, '"1" resolves to 1'); +assert.sameValue(a.lastIndexOf(1, "one"), -1, 'NaN string resolves to 01'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-10.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-10.js index 6a9a11c1972be3aead56c75efe7e1d07d3b74c29..3e6778af6665b100e52c5299a4defdc539aeefc9 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-10.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-10.js @@ -9,7 +9,7 @@ description: > (value is positive number) ---*/ - var targetObj = {}; +var targetObj = {}; assert.sameValue([0, targetObj, true].lastIndexOf(targetObj, 1.5), 1, '[0, targetObj, true].lastIndexOf(targetObj, 1.5)'); assert.sameValue([0, true, targetObj].lastIndexOf(targetObj, 1.5), -1, '[0, true, targetObj].lastIndexOf(targetObj, 1.5)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-11.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-11.js index 5ed43bf0e667b06eb2af4a31593be879ace722c2..839e611a8fa4217c131b5abd706850a1ae73a5dc 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-11.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-11.js @@ -9,7 +9,7 @@ description: > (value is negative number) ---*/ - var targetObj = {}; +var targetObj = {}; assert.sameValue([0, targetObj, true].lastIndexOf(targetObj, -2.5), 1, '[0, targetObj, true].lastIndexOf(targetObj, -2.5)'); assert.sameValue([0, true, targetObj].lastIndexOf(targetObj, -2.5), -1, '[0, true, targetObj].lastIndexOf(targetObj, -2.5)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-12.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-12.js index 4e7c34dd90a160d1057100e3253a599fd1a3604e..03d5bc0da888bc7e582c012e19f1f96ec6472af5 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-12.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-12.js @@ -9,7 +9,7 @@ description: > (value is Infinity) ---*/ - var arr = []; - arr[Math.pow(2, 32) - 2] = null; // length is the max value of Uint type +var arr = []; +arr[Math.pow(2, 32) - 2] = null; // length is the max value of Uint type assert.sameValue(arr.lastIndexOf(null, Infinity), Math.pow(2, 32) - 2, 'arr.lastIndexOf(null, Infinity)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-16.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-16.js index a219b6b67d008e1c5ece44802eb68790a12d594b..ab3089950ce0451a2c3f6733d791fbaca6e3e7c4 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-16.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-16.js @@ -9,7 +9,7 @@ description: > containing Infinity ---*/ - var arr = []; - arr[Math.pow(2, 32) - 2] = true; // length is the max value of Uint type +var arr = []; +arr[Math.pow(2, 32) - 2] = true; // length is the max value of Uint type assert.sameValue(arr.lastIndexOf(true, "Infinity"), Math.pow(2, 32) - 2, 'arr.lastIndexOf(true, "Infinity")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-18.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-18.js index 973d33cd354af94b1c3b8da957195387d51cad10..d5bf6c0fa078b81b6988e87e30c3cb67209c8e77 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-18.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-18.js @@ -9,7 +9,7 @@ description: > containing an exponential number ---*/ - var targetObj = {}; +var targetObj = {}; assert.sameValue([0, NaN, targetObj, 3, false].lastIndexOf(targetObj, "2E0"), 2, '[0, NaN, targetObj, 3, false].lastIndexOf(targetObj, "2E0")'); assert.sameValue([0, NaN, 3, targetObj, false].lastIndexOf(targetObj, "2E0"), -1, '[0, NaN, 3, targetObj, false].lastIndexOf(targetObj, "2E0")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-19.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-19.js index 90b87161fe6344fbba0d6b76b362560be5d6fa96..acb1c0140c54a3b8ceccd947fdd2261372aa3e89 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-19.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-19.js @@ -9,7 +9,7 @@ description: > containing a hex number ---*/ - var targetObj = {}; +var targetObj = {}; assert.sameValue([0, true, targetObj, 3, false].lastIndexOf(targetObj, "0x0002"), 2, '[0, true, targetObj, 3, false].lastIndexOf(targetObj, "0x0002")'); assert.sameValue([0, true, 3, targetObj, false].lastIndexOf(targetObj, "0x0002"), -1, '[0, true, 3, targetObj, false].lastIndexOf(targetObj, "0x0002")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-2.js index 8dc61ceae1c88d88b03beab519dc2ac619b94acb..95b4db82b048e8be18ed5e3c40f420d5daafc5ba 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-2.js @@ -7,8 +7,8 @@ es5id: 15.4.4.15-5-2 description: Array.prototype.lastIndexOf when fromIndex is floating point number ---*/ - var a = new Array(1,2,1); +var a = new Array(1, 2, 1); -assert.sameValue(a.lastIndexOf(2,1.49), 1, '1.49 resolves to 1'); -assert.sameValue(a.lastIndexOf(2,0.51), -1, '0.51 resolves to 0'); -assert.sameValue(a.lastIndexOf(1,0.51), 0, '0.51 resolves to 0'); +assert.sameValue(a.lastIndexOf(2, 1.49), 1, '1.49 resolves to 1'); +assert.sameValue(a.lastIndexOf(2, 0.51), -1, '0.51 resolves to 0'); +assert.sameValue(a.lastIndexOf(1, 0.51), 0, '0.51 resolves to 0'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-20.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-20.js index de7d8cdea7e47c68686e219c34b33c9751b26259..72a6f16fa01db3e36efdb80a53bb51080e217d33 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-20.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-20.js @@ -9,7 +9,7 @@ description: > string containing a number with leading zeros ---*/ - var targetObj = {}; +var targetObj = {}; assert.sameValue([0, true, targetObj, 3, false].lastIndexOf(targetObj, "0002.10"), 2, '[0, true, targetObj, 3, false].lastIndexOf(targetObj, "0002.10")'); assert.sameValue([0, true, 3, targetObj, false].lastIndexOf(targetObj, "0002.10"), -1, '[0, true, 3, targetObj, false].lastIndexOf(targetObj, "0002.10")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-21.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-21.js index 21e3ef508d74b006a16e01a90741b893d2352e24..d5ec47052d3eb955ed4a7d619588b3a9bad79eb0 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-21.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-21.js @@ -9,17 +9,17 @@ description: > Object, and has an own toString method ---*/ - // objects inherit the default valueOf() method from Object - // that simply returns itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - var fromIndex = { - toString: function () { - return '2'; - } - }; - var targetObj = new RegExp(); +// objects inherit the default valueOf() method from Object +// that simply returns itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +var fromIndex = { + toString: function() { + return '2'; + } +}; +var targetObj = new RegExp(); assert.sameValue([0, true, targetObj, 3, false].lastIndexOf(targetObj, fromIndex), 2, '[0, true, targetObj, 3, false].lastIndexOf(targetObj, fromIndex)'); assert.sameValue([0, true, 3, targetObj, false].lastIndexOf(targetObj, fromIndex), -1, '[0, true, 3, targetObj, false].lastIndexOf(targetObj, fromIndex)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-22.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-22.js index edd857c534c70779a4c96198ef6f76eb38ba1969..b3bcfbc461b8ba1cad0a1a74b27c86fb3644dc6e 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-22.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-22.js @@ -9,13 +9,13 @@ description: > object, and has an own valueOf method ---*/ - var fromIndex = { - valueOf: function () { - return 2; - } - }; +var fromIndex = { + valueOf: function() { + return 2; + } +}; - var targetObj = function () {}; +var targetObj = function() {}; assert.sameValue([0, true, targetObj, 3, false].lastIndexOf(targetObj, fromIndex), 2, '[0, true, targetObj, 3, false].lastIndexOf(targetObj, fromIndex)'); assert.sameValue([0, true, 3, targetObj, false].lastIndexOf(targetObj, fromIndex), -1, '[0, true, 3, targetObj, false].lastIndexOf(targetObj, fromIndex)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-23.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-23.js index 2387ba6579c999d8ef69229b22fb578949cce1c1..e371687ad890427676b022483440dc4cf09dffc8 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-23.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-23.js @@ -10,20 +10,20 @@ description: > method that returns a string ---*/ - var toStringAccessed = false; - var valueOfAccessed = false; +var toStringAccessed = false; +var valueOfAccessed = false; - var fromIndex = { - toString: function () { - toStringAccessed = true; - return '1'; - }, +var fromIndex = { + toString: function() { + toStringAccessed = true; + return '1'; + }, - valueOf: function () { - valueOfAccessed = true; - return {}; - } - }; + valueOf: function() { + valueOfAccessed = true; + return {}; + } +}; assert.sameValue([0, true].lastIndexOf(true, fromIndex), 1, '[0, true].lastIndexOf(true, fromIndex)'); assert(toStringAccessed, 'toStringAccessed !== true'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-24.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-24.js index 52bcc45648180866c94b1e5ba4219db1e33963ee..949b07c4ab0141a20c56932fafbc39ccc7891cb9 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-24.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-24.js @@ -10,23 +10,23 @@ description: > than don't return primitive value ---*/ - var toStringAccessed = false; - var valueOfAccessed = false; +var toStringAccessed = false; +var valueOfAccessed = false; - var fromIndex = { - toString: function () { - toStringAccessed = true; - return {}; - }, +var fromIndex = { + toString: function() { + toStringAccessed = true; + return {}; + }, - valueOf: function () { - valueOfAccessed = true; - return {}; - } - }; + valueOf: function() { + valueOfAccessed = true; + return {}; + } +}; assert.throws(TypeError, function() { - [0, null].lastIndexOf(null, fromIndex); + [0, null].lastIndexOf(null, fromIndex); }); assert(toStringAccessed, 'toStringAccessed'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-25.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-25.js index c8860be07656198e9ab45933a8c5b1e4c6cbd301..8de12b1843a6297f267c6c832d392e28ea20d10e 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-25.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-25.js @@ -10,24 +10,24 @@ description: > inherited valueOf methods ---*/ - var toStringAccessed = false; - var valueOfAccessed = false; +var toStringAccessed = false; +var valueOfAccessed = false; - var proto = { - valueOf: function () { - valueOfAccessed = true; - return 1; - } - }; +var proto = { + valueOf: function() { + valueOfAccessed = true; + return 1; + } +}; - var Con = function () {}; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.toString = function () { - toStringAccessed = true; - return 1; - }; +var child = new Con(); +child.toString = function() { + toStringAccessed = true; + return 1; +}; assert.sameValue([0, true].lastIndexOf(true, child), 1, '[0, true].lastIndexOf(true, child)'); assert(valueOfAccessed, 'valueOfAccessed !== true'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-26.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-26.js index 0ec967938c976c3c424c2f3ad33d95fffdd1e6e0..6b977c909b668e7c949627aabd3af1c56a7c9622 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-26.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-26.js @@ -9,29 +9,29 @@ description: > visible when an exception occurs ---*/ - var stepTwoOccurs = false; - var stepFiveOccurs = false; - var obj = {}; +var stepTwoOccurs = false; +var stepFiveOccurs = false; +var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - stepTwoOccurs = true; - if (stepFiveOccurs) { - throw new Error("Step 5 occurred out of order"); - } - return 20; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + stepTwoOccurs = true; + if (stepFiveOccurs) { + throw new Error("Step 5 occurred out of order"); + } + return 20; + }, + configurable: true +}); - var fromIndex = { - valueOf: function () { - stepFiveOccurs = true; - return 0; - } - }; +var fromIndex = { + valueOf: function() { + stepFiveOccurs = true; + return 0; + } +}; - Array.prototype.lastIndexOf.call(obj, undefined, fromIndex); +Array.prototype.lastIndexOf.call(obj, undefined, fromIndex); assert(stepTwoOccurs, 'stepTwoOccurs !== true'); assert(stepFiveOccurs, 'stepFiveOccurs !== true'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-27.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-27.js index 491866633a68218cfa19f7ebd0b17fe0c3cb717b..dc56d995c4106fbc86354ee2231b322fac4e4d13 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-27.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-27.js @@ -9,34 +9,34 @@ description: > visible when an exception occurs ---*/ - var stepThreeOccurs = false; - var stepFiveOccurs = false; +var stepThreeOccurs = false; +var stepFiveOccurs = false; - var obj = {}; +var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - return { - valueOf: function () { - stepThreeOccurs = true; - if (stepFiveOccurs) { - throw new Error("Step 5 occurred out of order"); - } - return 20; - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + valueOf: function() { + stepThreeOccurs = true; + if (stepFiveOccurs) { + throw new Error("Step 5 occurred out of order"); + } + return 20; + } + }; + }, + configurable: true +}); - var fromIndex = { - valueOf: function () { - stepFiveOccurs = true; - return 0; - } - }; +var fromIndex = { + valueOf: function() { + stepFiveOccurs = true; + return 0; + } +}; - Array.prototype.lastIndexOf.call(obj, undefined, fromIndex); +Array.prototype.lastIndexOf.call(obj, undefined, fromIndex); assert(stepThreeOccurs, 'stepThreeOccurs !== true'); assert(stepFiveOccurs, 'stepFiveOccurs !== true'); 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 f3538884d7946c7fe19d750fa940170d76050a2a..b2a3da5977a8973215d26be4f336b8b1d69bb57b 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 @@ -9,14 +9,14 @@ description: > visible when an exception occurs ---*/ - var stepFiveOccurs = false; - var fromIndex = { - valueOf: function () { - stepFiveOccurs = true; - return 0; - } - }; +var stepFiveOccurs = false; +var fromIndex = { + valueOf: function() { + stepFiveOccurs = true; + return 0; + } +}; assert.throws(TypeError, function() { - Array.prototype.lastIndexOf.call(undefined, undefined, fromIndex); + Array.prototype.lastIndexOf.call(undefined, undefined, fromIndex); }); 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 9d4e8f52265bbf18d64b0c93fc6825573ea5de3b..f1fd8f73a53f0512a9491c0cd055d7f2473f371f 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 @@ -9,23 +9,23 @@ description: > visible when an exception occurs ---*/ - var stepFiveOccurs = false; +var stepFiveOccurs = false; - var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - throw new RangeError(); - }, - configurable: true - }); +var obj = {}; +Object.defineProperty(obj, "length", { + get: function() { + throw new RangeError(); + }, + configurable: true +}); - var fromIndex = { - valueOf: function () { - stepFiveOccurs = true; - return 0; - } - }; +var fromIndex = { + valueOf: function() { + stepFiveOccurs = true; + return 0; + } +}; assert.throws(RangeError, function() { - Array.prototype.lastIndexOf.call(obj, undefined, fromIndex); + Array.prototype.lastIndexOf.call(obj, undefined, fromIndex); }); assert.sameValue(stepFiveOccurs, false, 'stepFiveOccurs'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-3.js index 5fccb2a9ce3df0372c2373a2fc8d18eee79edece..57bf7dfd4f0e99d3bad4a5cfa0f6f1751fd057c4 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-3.js @@ -7,7 +7,7 @@ es5id: 15.4.4.15-5-3 description: Array.prototype.lastIndexOf when fromIndex is boolean ---*/ - var a = new Array(1,2,1); +var a = new Array(1, 2, 1); -assert.sameValue(a.lastIndexOf(2,true), 1, 'true resolves to 1'); -assert.sameValue(a.lastIndexOf(2,false), -1, 'false resolves to 0'); +assert.sameValue(a.lastIndexOf(2, true), 1, 'true resolves to 1'); +assert.sameValue(a.lastIndexOf(2, false), -1, 'false resolves to 0'); 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 92fef085dd5062c672cc5a2c35d83271fdb0fe46..4d0ad283f404f03878f961fdeade674b3c50e715 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 @@ -9,27 +9,27 @@ description: > visible when an exception occurs ---*/ - var stepFiveOccurs = false; +var stepFiveOccurs = false; - var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - return { - valueOf: function () { - throw new TypeError(); - } - }; - }, - configurable: true - }); +var obj = {}; +Object.defineProperty(obj, "length", { + get: function() { + return { + valueOf: function() { + throw new TypeError(); + } + }; + }, + configurable: true +}); - var fromIndex = { - valueOf: function () { - stepFiveOccurs = true; - return 0; - } - }; +var fromIndex = { + valueOf: function() { + stepFiveOccurs = true; + return 0; + } +}; assert.throws(TypeError, function() { - Array.prototype.lastIndexOf.call(obj, undefined, fromIndex); + Array.prototype.lastIndexOf.call(obj, undefined, fromIndex); }); assert.sameValue(stepFiveOccurs, false, 'stepFiveOccurs'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-31.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-31.js index 11152525fdb09749fb67b548b437fcd86cc9382e..66c4b8c012b4f7c8333bf9e330d09ffe350102a9 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-31.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-31.js @@ -9,7 +9,7 @@ description: > non-integer, verify truncation occurs in the proper direction ---*/ - var targetObj = {}; +var targetObj = {}; assert.sameValue([0, targetObj, true].lastIndexOf(targetObj, 1.5), 1, '[0, targetObj, true].lastIndexOf(targetObj, 1.5)'); assert.sameValue([0, true, targetObj].lastIndexOf(targetObj, 1.5), -1, '[0, true, targetObj].lastIndexOf(targetObj, 1.5)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-32.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-32.js index db105484b3b127e9c706a62033ecd1470a3324ab..75aed0966d0a04c7c691d5408de7f2c3412eb0c7 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-32.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-32.js @@ -9,7 +9,7 @@ description: > non-integer, verify truncation occurs in the proper direction ---*/ - var targetObj = {}; +var targetObj = {}; assert.sameValue([0, targetObj, true].lastIndexOf(targetObj, -2.5), 1, '[0, targetObj, true].lastIndexOf(targetObj, -2.5)'); assert.sameValue([0, true, targetObj].lastIndexOf(targetObj, -2.5), -1, '[0, true, targetObj].lastIndexOf(targetObj, -2.5)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-4.js index 120641ec7c5afb8fc27b41c9b224a86780c554be..f581274c2779c948ab2ebf8ac820e5d36efd8cd1 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-4.js @@ -7,9 +7,9 @@ es5id: 15.4.4.15-5-4 description: Array.prototype.lastIndexOf when fromIndex is undefined ---*/ - var a = new Array(1,2,1); +var a = new Array(1, 2, 1); // undefined resolves to 0, no second argument resolves to len -assert.sameValue(a.lastIndexOf(2,undefined), -1, 'a.lastIndexOf(2,undefined)'); -assert.sameValue(a.lastIndexOf(1,undefined), 0, 'a.lastIndexOf(1,undefined)'); +assert.sameValue(a.lastIndexOf(2, undefined), -1, 'a.lastIndexOf(2,undefined)'); +assert.sameValue(a.lastIndexOf(1, undefined), 0, 'a.lastIndexOf(1,undefined)'); assert.sameValue(a.lastIndexOf(1), 2, 'a.lastIndexOf(1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-5.js index 38614daf9eaf809301586fdb26bdf8b4e6acc466..72efdc3075b1647a5a48394c64c226d6d7fc9fbd 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-5.js @@ -7,8 +7,8 @@ es5id: 15.4.4.15-5-5 description: Array.prototype.lastIndexOf when fromIndex is null ---*/ - var a = new Array(1,2,1); +var a = new Array(1, 2, 1); // null resolves to 0 -assert.sameValue(a.lastIndexOf(2,null), -1, 'a.lastIndexOf(2,null)'); -assert.sameValue(a.lastIndexOf(1,null), 0, 'a.lastIndexOf(1,null)'); +assert.sameValue(a.lastIndexOf(2, null), -1, 'a.lastIndexOf(2,null)'); +assert.sameValue(a.lastIndexOf(1, null), 0, 'a.lastIndexOf(1,null)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-6.js index e66f4a75eff92e5b88605aa6bbd6fa90efc32c41..033e078b3940e54a2a1009112c29bc48a96985d8 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-6.js @@ -7,8 +7,8 @@ es5id: 15.4.4.15-5-6 description: Array.prototype.lastIndexOf when 'fromIndex' isn't passed ---*/ - var arr = [0, 1, 2, 3, 4]; - //'fromIndex' will be set as 4 if not passed by default +var arr = [0, 1, 2, 3, 4]; +//'fromIndex' will be set as 4 if not passed by default assert.sameValue(arr.lastIndexOf(0), arr.lastIndexOf(0, 4), 'arr.lastIndexOf(0)'); assert.sameValue(arr.lastIndexOf(2), arr.lastIndexOf(2, 4), 'arr.lastIndexOf(2)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-1.js index efe30ad08f2f62b80baa65cc86d4b4c4564bed4f..87cf25f0c6edcc5f1c26c5749ed16582d249b245 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-1.js @@ -9,7 +9,7 @@ description: > Array.length ---*/ - var a = new Array(1,2,3); +var a = new Array(1, 2, 3); -assert.sameValue(a.lastIndexOf(3,5.4), 2, 'a.lastIndexOf(3,5.4)'); -assert.sameValue(a.lastIndexOf(3,3.1), 2, 'a.lastIndexOf(3,3.1)'); +assert.sameValue(a.lastIndexOf(3, 5.4), 2, 'a.lastIndexOf(3,5.4)'); +assert.sameValue(a.lastIndexOf(3, 3.1), 2, 'a.lastIndexOf(3,3.1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-1.js index f0d4f45ef56ab9df1cdf1d737b62e5fb1b3ea69c..50f0225fab6e0d247032539f8da702ddedfdbff9 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-1.js @@ -7,9 +7,9 @@ es5id: 15.4.4.15-7-1 description: Array.prototype.lastIndexOf with negative fromIndex ---*/ - var a = new Array(1,2,3); +var a = new Array(1, 2, 3); -assert.sameValue(a.lastIndexOf(2,-2), 1, 'a.lastIndexOf(2,-2)'); -assert.sameValue(a.lastIndexOf(2,-3), -1, 'a.lastIndexOf(2,-3)'); -assert.sameValue(a.lastIndexOf(1,-5.3), -1, 'a.lastIndexOf(1,-5.3)'); +assert.sameValue(a.lastIndexOf(2, -2), 1, 'a.lastIndexOf(2,-2)'); +assert.sameValue(a.lastIndexOf(2, -3), -1, 'a.lastIndexOf(2,-3)'); +assert.sameValue(a.lastIndexOf(1, -5.3), -1, 'a.lastIndexOf(1,-5.3)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-1.js index 90b73979e9b99fc9aa38fb384e7d9eea1bfe0700..ba9f6f41dbe60b4a931b246f7a3df503edef2b97 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-1.js @@ -7,9 +7,13 @@ es5id: 15.4.4.15-8-1 description: Array.prototype.lastIndexOf must return correct index(boolean) ---*/ - var obj = {toString:function (){return true}}; - var _false = false; - var a = new Array(false,true,false,obj,_false,true,"true", undefined,0,null,1,"str",0,1); +var obj = { + toString: function() { + return true + } +}; +var _false = false; +var a = new Array(false, true, false, obj, _false, true, "true", undefined, 0, null, 1, "str", 0, 1); assert.sameValue(a.lastIndexOf(true), 5, 'a[5]=true'); assert.sameValue(a.lastIndexOf(false), 4, 'a[4] =_false'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-10.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-10.js index c225526866b0f5c61de4ed46ecc074b052b59144..91f6f3c01adbd3fb03e43a6644e136e6bddfcfca 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-10.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-10.js @@ -10,7 +10,11 @@ es5id: 15.4.4.15-8-10 description: Array.prototype.lastIndexOf must return correct index (NaN) ---*/ - var _NaN = NaN; - var a = new Array("NaN",_NaN,NaN, undefined,0,false,null,{toString:function (){return NaN}},"false"); +var _NaN = NaN; +var a = new Array("NaN", _NaN, NaN, undefined, 0, false, null, { + toString: function() { + return NaN + } +}, "false"); assert.sameValue(a.lastIndexOf(NaN), -1, 'NaN matches nothing, not even itself'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-11.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-11.js index 9e2f6d79afcaa7d7e07c78ce0a225c2d11949094..0fd222276f315d8d81ba33e29269b06682a05df5 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-11.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-11.js @@ -9,14 +9,14 @@ description: > changed by adding elements to the array during iteration ---*/ - var arr = [20]; +var arr = [20]; - Object.defineProperty(arr, "0", { - get: function () { - arr[1] = 1; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + arr[1] = 1; + return 0; + }, + configurable: true +}); assert.sameValue(arr.lastIndexOf(1), -1, 'arr.lastIndexOf(1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-2.js index 8dcc8e602a272c0cef3a267c5c269ae516838ca9..51273ec3b4b3b104ce7695786bf247a175c0dd9b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-2.js @@ -7,12 +7,16 @@ es5id: 15.4.4.15-8-2 description: Array.prototype.lastIndexOf must return correct index(Number) ---*/ - var obj = {toString:function (){return 0}}; - var one = 1; - var _float = -(4/3); - var a = new Array(+0,true,0,-0, false,undefined,null,"0",obj, _float,-(4/3),-1.3333333333333,"str",one, 1, false); +var obj = { + toString: function() { + return 0 + } +}; +var one = 1; +var _float = -(4 / 3); +var a = new Array(+0, true, 0, -0, false, undefined, null, "0", obj, _float, -(4 / 3), -1.3333333333333, "str", one, 1, false); -assert.sameValue(a.lastIndexOf(-(4/3)), 10, 'a[10]=-(4/3)'); +assert.sameValue(a.lastIndexOf(-(4 / 3)), 10, 'a[10]=-(4/3)'); assert.sameValue(a.lastIndexOf(0), 3, 'a[3] = -0, but using === -0 and 0 are equal'); assert.sameValue(a.lastIndexOf(-0), 3, 'a[3] = -0'); assert.sameValue(a.lastIndexOf(1), 14, 'a[14] = 1'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-3.js index ba6b3e8261474add011c9812de92759bcce91491..a1f22e7de86a76a9d25ef282b5a6c013e694bd2c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-3.js @@ -7,8 +7,12 @@ es5id: 15.4.4.15-8-3 description: Array.prototype.lastIndexOf must return correct index(string) ---*/ - var obj = {toString:function (){return "false"}}; - var szFalse = "false"; - var a = new Array(szFalse, "false","false1",undefined,0,false,null,1,obj,0); +var obj = { + toString: function() { + return "false" + } +}; +var szFalse = "false"; +var a = new Array(szFalse, "false", "false1", undefined, 0, false, null, 1, obj, 0); assert.sameValue(a.lastIndexOf("false"), 1, 'a.lastIndexOf("false")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-4.js index 1c4050783c842993c727e6d784896cb2a1c6d264..e77e8d780be1853a35d2c7b87a9444a246dd0ccf 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-4.js @@ -7,9 +7,13 @@ es5id: 15.4.4.15-8-4 description: Array.prototype.lastIndexOf must return correct index(undefined) ---*/ - var obj = {toString:function (){return undefined;}}; - var _undefined1 = undefined; - var _undefined2; - var a = new Array(_undefined1,_undefined2,undefined,true,0,false,null,1,"undefined",obj,1); +var obj = { + toString: function() { + return undefined; + } +}; +var _undefined1 = undefined; +var _undefined2; +var a = new Array(_undefined1, _undefined2, undefined, true, 0, false, null, 1, "undefined", obj, 1); assert.sameValue(a.lastIndexOf(undefined), 2, 'a.lastIndexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-5.js index afd59f8ac78e237497b8c60e7ec953c20f19d078..2aea2f8ee1bc34ae8b61c47d07264721f007b855 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-5.js @@ -7,9 +7,21 @@ es5id: 15.4.4.15-8-5 description: Array.prototype.lastIndexOf must return correct index(Object) ---*/ - var obj1 = {toString:function (){return "false"}}; - var obj2 = {toString:function (){return "false"}}; - var obj3 = obj1; - var a = new Array(obj2,obj1,obj3,false,undefined,0,false,null,{toString:function (){return "false"}},"false"); +var obj1 = { + toString: function() { + return "false" + } +}; +var obj2 = { + toString: function() { + return "false" + } +}; +var obj3 = obj1; +var a = new Array(obj2, obj1, obj3, false, undefined, 0, false, null, { + toString: function() { + return "false" + } +}, "false"); assert.sameValue(a.lastIndexOf(obj3), 2, 'a.lastIndexOf(obj3)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-6.js index c3e542c7c976a5fb5cb970b61bd05ee2be627955..18b8888ee76107a133ed4f8ceb2f20cc727f212c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-6.js @@ -7,8 +7,12 @@ es5id: 15.4.4.15-8-6 description: Array.prototype.lastIndexOf must return correct index(null) ---*/ - var obj = {toString:function (){return null}}; - var _null = null; - var a = new Array(true,undefined,0,false,null,1,"str",0,1,null,true,false,undefined,_null,"null",undefined,"str",obj); +var obj = { + toString: function() { + return null + } +}; +var _null = null; +var a = new Array(true, undefined, 0, false, null, 1, "str", 0, 1, null, true, false, undefined, _null, "null", undefined, "str", obj); assert.sameValue(a.lastIndexOf(null), 13, 'a.lastIndexOf(null)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-7.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-7.js index 763dbfe402e00f6b8fed8a337f433e311577e29b..543564a91ca7e49dbba00543c7990792f94112e4 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-7.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-7.js @@ -9,8 +9,8 @@ description: > reference) ---*/ - var a = new Array(0,1,2,3); - a[2] = a; +var a = new Array(0, 1, 2, 3); +a[2] = a; assert.sameValue(a.lastIndexOf(a), 2, 'a.lastIndexOf(a)'); assert.sameValue(a.lastIndexOf(3), 3, 'a.lastIndexOf(3)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-8.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-8.js index 1cb37a62df128457ebc9a75200fc57ec9e59a7b6..b5676e56d22ea9467acd4fd58444f320a02fc729 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-8.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-8.js @@ -7,8 +7,8 @@ es5id: 15.4.4.15-8-8 description: Array.prototype.lastIndexOf must return correct index (Array) ---*/ - var b = new Array("0,1"); - var a = new Array(0,b,"0,1",3); +var b = new Array("0,1"); +var a = new Array(0, b, "0,1", 3); assert.sameValue(a.lastIndexOf(b.toString()), 2, 'a.lastIndexOf(b.toString())'); assert.sameValue(a.lastIndexOf("0,1"), 2, 'a.lastIndexOf("0,1")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-9.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-9.js index 7c7026a1dea4b6ccb467e8c07465a24f5cd7782a..c70075216bb6cc17ed17e804e73dde7685d2738f 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-9.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-9.js @@ -9,15 +9,15 @@ description: > Array) ---*/ - var a = new Array(0,1); - a[4294967294] = 2; // 2^32-2 - is max array element index - a[4294967295] = 3; // 2^32-1 added as non-array element property - a[4294967296] = 4; // 2^32 added as non-array element property - a[4294967297] = 5; // 2^32+1 added as non-array element property - // stop searching near the end in case implementation actually tries to test all missing elements!! - a[4294967200] = 3; - a[4294967201] = 4; - a[4294967202] = 5; +var a = new Array(0, 1); +a[4294967294] = 2; // 2^32-2 - is max array element index +a[4294967295] = 3; // 2^32-1 added as non-array element property +a[4294967296] = 4; // 2^32 added as non-array element property +a[4294967297] = 5; // 2^32+1 added as non-array element property +// stop searching near the end in case implementation actually tries to test all missing elements!! +a[4294967200] = 3; +a[4294967201] = 4; +a[4294967202] = 5; assert.sameValue(a.lastIndexOf(2), 4294967294, 'a.lastIndexOf(2)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-1.js index 71fb4d1b5cd07e1061454cd454fec100b7a85f97..8da0ba48d084dc4c8d93a30f28bc0b3ecaf9a39f 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-1.js @@ -9,14 +9,14 @@ description: > visible here ---*/ - var arr = { }; +var arr = {}; - Object.defineProperty(arr, "length", { - get: function () { - arr[2] = "length"; - return 3; - }, - configurable: true - }); +Object.defineProperty(arr, "length", { + get: function() { + arr[2] = "length"; + return 3; + }, + configurable: true +}); assert.sameValue(Array.prototype.lastIndexOf.call(arr, "length"), 2, 'Array.prototype.lastIndexOf.call(arr, "length")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-10.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-10.js index 5dd88469ddebc5699e3f782714177110c974cb6d..aa82dc85b359deab04acf0864f2ea1e65a666506 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-10.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-10.js @@ -9,19 +9,19 @@ description: > after current position are visited on an Array ---*/ - var arr = [0, , 2]; +var arr = [0, , 2]; - Object.defineProperty(arr, "2", { - get: function () { - Object.defineProperty(Array.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "2", { + get: function() { + Object.defineProperty(Array.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); assert.sameValue(arr.lastIndexOf(6.99), 1, 'arr.lastIndexOf(6.99)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-11.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-11.js index 83d4ac5ce5738c9eb81653b21dcb488452fe75e9..c7bd8ed99e7bbb0c61134363b36b8f337963aa8b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-11.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-11.js @@ -9,21 +9,23 @@ description: > property not to be visited on an Array-like object ---*/ - var arr = { length: 200 }; +var arr = { + length: 200 +}; - Object.defineProperty(arr, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + return 6.99; + }, + configurable: true +}); - Object.defineProperty(arr, "100", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "100", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); assert.sameValue(Array.prototype.lastIndexOf.call(arr, 6.99), -1, 'Array.prototype.lastIndexOf.call(arr, 6.99)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-12.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-12.js index 00f8a44fed1a70d2483195871775a6ac29dcebac..e1b6e93dedbe2067fd8e4bd7f55e09c5b4175dd8 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-12.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-12.js @@ -9,21 +9,21 @@ description: > property not to be visited on an Array ---*/ - var arr = [1, 2, 3, 4]; +var arr = [1, 2, 3, 4]; - Object.defineProperty(arr, "1", { - get: function () { - return "6.99"; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + return "6.99"; + }, + configurable: true +}); - Object.defineProperty(arr, "3", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "3", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); assert.sameValue(arr.lastIndexOf("6.99"), -1, 'arr.lastIndexOf("6.99")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-13.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-13.js index df702ae2175161ac0ab5556d8865ee42bea1ee00..052114d92627d6a9ef6662d9fe0684d1d3ae3999 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-13.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-13.js @@ -10,16 +10,19 @@ description: > Object ---*/ - var arr = { 2: 2, length: 20 }; +var arr = { + 2: 2, + length: 20 +}; - Object.defineProperty(arr, "3", { - get: function () { - delete Object.prototype[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "3", { + get: function() { + delete Object.prototype[1]; + return 0; + }, + configurable: true +}); - Object.prototype[1] = 1; +Object.prototype[1] = 1; assert.sameValue(Array.prototype.lastIndexOf.call(arr, 1), -1, 'Array.prototype.lastIndexOf.call(arr, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-14.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-14.js index d86e21b9e2ce6e3d0d50e11701e2709838d40c3a..864c9a8fa439079a8f23c726ec1aacf3217b3217 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-14.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-14.js @@ -9,16 +9,16 @@ description: > causes prototype index property not to be visited on an Array ---*/ - var arr = [0, , 2]; +var arr = [0, , 2]; - Object.defineProperty(arr, "20", { - get: function () { - delete Array.prototype[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "20", { + get: function() { + delete Array.prototype[1]; + return 0; + }, + configurable: true +}); - Array.prototype[1] = 1; +Array.prototype[1] = 1; assert.sameValue(arr.lastIndexOf(1), -1, 'arr.lastIndexOf(1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-15.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-15.js index a5ae27fef0df30fb3f8c9268dc637c5ff39f9199..c9ed09f3a7ee78892364349d242e6b5972b75b6b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-15.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-15.js @@ -10,16 +10,21 @@ description: > on an Array-like object ---*/ - var arr = { 0: 0, 1: 111, 2: 2, length: 10 }; +var arr = { + 0: 0, + 1: 111, + 2: 2, + length: 10 +}; - Object.defineProperty(arr, "6", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "6", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); - Object.prototype[1] = 1; +Object.prototype[1] = 1; assert.sameValue(Array.prototype.lastIndexOf.call(arr, 1), 1, 'Array.prototype.lastIndexOf.call(arr, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-16.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-16.js index fce1f7c2c3572a82ebc8143e2b876daad1193a2c..49b6f786a387ee82f8409b9140065f7765e75e0c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-16.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-16.js @@ -10,16 +10,16 @@ description: > on an Array ---*/ - var arr = [0, 111, 2]; +var arr = [0, 111, 2]; - Object.defineProperty(arr, "2", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "2", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); - Array.prototype[1] = 1; +Array.prototype[1] = 1; assert.sameValue(arr.lastIndexOf(1), 1, 'arr.lastIndexOf(1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-17.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-17.js index f2bd2ff1fa5667be8df50a7c6ddf4014f3e512fc..5056ac8a2742e6ee3f3991a1c108570354fa5b0d 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-17.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-17.js @@ -9,14 +9,14 @@ description: > index property not to be visited ---*/ - var arr = [0, 1, 2, "last", 4]; +var arr = [0, 1, 2, "last", 4]; - Object.defineProperty(arr, "4", { - get: function () { - arr.length = 3; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "4", { + get: function() { + arr.length = 3; + return 0; + }, + configurable: true +}); assert.sameValue(arr.lastIndexOf("last"), -1, 'arr.lastIndexOf("last")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-18.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-18.js index 9202ce28e314d742bfd98382598141a4d8899ba8..a34d8b58e767ed3def55451631f69424f3d0b401 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-18.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-18.js @@ -9,21 +9,21 @@ description: > prototype property causes prototype index property to be visited ---*/ - var arr = [0, 1, 2, 3, 4]; +var arr = [0, 1, 2, 3, 4]; - Object.defineProperty(Array.prototype, "2", { - get: function () { - return "prototype"; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "2", { + get: function() { + return "prototype"; + }, + configurable: true +}); - Object.defineProperty(arr, "3", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); +Object.defineProperty(arr, "3", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); assert.sameValue(arr.lastIndexOf("prototype"), 2, 'arr.lastIndexOf("prototype")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-19.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-19.js index b5c018d0cfa1a745d2133e1f86466a382155546a..ca788c2bc0d7d2bc3f309fe2b3280dbecb64b74f 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-19.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-19.js @@ -10,21 +10,21 @@ description: > flags: [noStrict] ---*/ - var arr = [0, 1, 2, 3]; +var arr = [0, 1, 2, 3]; - Object.defineProperty(arr, "2", { - get: function () { - return "unconfigurable"; - }, - configurable: false - }); +Object.defineProperty(arr, "2", { + get: function() { + return "unconfigurable"; + }, + configurable: false +}); - Object.defineProperty(arr, "3", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); +Object.defineProperty(arr, "3", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); assert.sameValue(arr.lastIndexOf("unconfigurable"), 2, 'arr.lastIndexOf("unconfigurable")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-2.js index 416d33fc8912e4d3847fb7d52eda6e414508482c..01d4e44dbf3f7dbfdb71b26319851a7f1ed94d44 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-2.js @@ -9,15 +9,17 @@ description: > visible here on an Array-like object ---*/ - var arr = { length: 30 }; - var targetObj = function () { }; +var arr = { + length: 30 +}; +var targetObj = function() {}; - var fromIndex = { - valueOf: function () { - arr[4] = targetObj; - return 10; - } - }; +var fromIndex = { + valueOf: function() { + arr[4] = targetObj; + return 10; + } +}; assert.sameValue(Array.prototype.lastIndexOf.call(arr, targetObj, fromIndex), 4, 'Array.prototype.lastIndexOf.call(arr, targetObj, fromIndex)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-3.js index e02d240e52ad90001dba38a1490497863458ec75..7ceda1ccdd2c96562320841480b02cd54f28929b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-3.js @@ -9,15 +9,15 @@ description: > visible here on an Array ---*/ - var arr = []; - arr.length = 30; - var targetObj = function () { }; +var arr = []; +arr.length = 30; +var targetObj = function() {}; - var fromIndex = { - valueOf: function () { - arr[4] = targetObj; - return 11; - } - }; +var fromIndex = { + valueOf: function() { + arr[4] = targetObj; + return 11; + } +}; assert.sameValue(arr.lastIndexOf(targetObj, fromIndex), 4, 'arr.lastIndexOf(targetObj, fromIndex)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-4.js index 2846cf6e9e420e8d73a20dafe249aa5db34dd6b7..010ffb36d752dc3280d3e8ed0b0883b4e668d5c9 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-4.js @@ -9,14 +9,16 @@ description: > visible here ---*/ - var arr = { 2: 6.99 }; +var arr = { + 2: 6.99 +}; - Object.defineProperty(arr, "length", { - get: function () { - delete arr[2]; - return 3; - }, - configurable: true - }); +Object.defineProperty(arr, "length", { + get: function() { + delete arr[2]; + return 3; + }, + configurable: true +}); assert.sameValue(Array.prototype.lastIndexOf.call(arr, 6.99), -1, 'Array.prototype.lastIndexOf.call(arr, 6.99)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-5.js index 4d1c2f8db6693684d0d9ec0f9a8b026f897dae3e..cd592d237caf077fadca25d9cb3d636fbfea6558 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-5.js @@ -9,13 +9,16 @@ description: > visible here on an Array-like object ---*/ - var arr = { 10: false, length: 30 }; +var arr = { + 10: false, + length: 30 +}; - var fromIndex = { - valueOf: function () { - delete arr[10]; - return 15; - } - }; +var fromIndex = { + valueOf: function() { + delete arr[10]; + return 15; + } +}; assert.sameValue(Array.prototype.lastIndexOf.call(arr, false, fromIndex), -1, 'Array.prototype.lastIndexOf.call(arr, false, fromIndex)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-6.js index 0ad3830b3dcd650143672adbde5c14c50db4a1b4..6b23e07f8d1290f7767ff66cc4767a339ea521fc 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-6.js @@ -9,15 +9,15 @@ description: > visible here on an Array ---*/ - var arr = []; - arr[10] = "10"; - arr.length = 20; +var arr = []; +arr[10] = "10"; +arr.length = 20; - var fromIndex = { - valueOf: function () { - delete arr[10]; - return 11; - } - }; +var fromIndex = { + valueOf: function() { + delete arr[10]; + return 11; + } +}; assert.sameValue(arr.lastIndexOf("10", fromIndex), -1, 'arr.lastIndexOf("10", fromIndex)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-7.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-7.js index af7fc70e584400684fcf5c47e0dee16223d3fafb..e64cc5bab423d5ad44df270b398746a0ce0a7317 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-7.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-7.js @@ -9,19 +9,21 @@ description: > after current position are visited on an Array-like object ---*/ - var arr = { length: 8 }; +var arr = { + length: 8 +}; - Object.defineProperty(arr, "4", { - get: function () { - Object.defineProperty(arr, "1", { - get: function () { - return 1; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "4", { + get: function() { + Object.defineProperty(arr, "1", { + get: function() { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); assert.sameValue(Array.prototype.lastIndexOf.call(arr, 1), 1, 'Array.prototype.lastIndexOf.call(arr, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-8.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-8.js index c368ef5706472593fdfed3d3da3924de8fed99d1..ef7d6b67425b5e8374ee9948a4a7c9277dd200b6 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-8.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-8.js @@ -9,19 +9,19 @@ description: > after current position are visited on an Array ---*/ - var arr = [0, , 2]; +var arr = [0, , 2]; - Object.defineProperty(arr, "2", { - get: function () { - Object.defineProperty(arr, "1", { - get: function () { - return 1; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "2", { + get: function() { + Object.defineProperty(arr, "1", { + get: function() { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); assert.sameValue(arr.lastIndexOf(1), 1, 'arr.lastIndexOf(1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-9.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-9.js index 412604d03d3c22cbb27c5ffd9450ffa41d634f92..d0d856f61791ae63ca68075427dd2caa635f0b53 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-9.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-9.js @@ -10,19 +10,21 @@ description: > object ---*/ - var arr = { length: 9 }; +var arr = { + length: 9 +}; - Object.defineProperty(arr, "4", { - get: function () { - Object.defineProperty(Object.prototype, "1", { - get: function () { - return Infinity; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "4", { + get: function() { + Object.defineProperty(Object.prototype, "1", { + get: function() { + return Infinity; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); assert.sameValue(Array.prototype.lastIndexOf.call(arr, Infinity), 1, 'Array.prototype.lastIndexOf.call(arr, Infinity)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-1.js index 7a4e136a62ca2f7f470bd2d4a063178029f6f246..3dfe2ffa104d80acaaf7203c4f4e955099231b50 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-1.js @@ -9,7 +9,12 @@ description: > property on an Array-like object ---*/ - var obj = { 0: 0, 1: 1, 2: 2, length: 3 }; +var obj = { + 0: 0, + 1: 1, + 2: 2, + length: 3 +}; assert.sameValue(Array.prototype.lastIndexOf.call(obj, 0), 0, 'Array.prototype.lastIndexOf.call(obj, 0)'); assert.sameValue(Array.prototype.lastIndexOf.call(obj, 1), 1, 'Array.prototype.lastIndexOf.call(obj, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-10.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-10.js index 38b41bddf69ff149ac4877a6d23d67b5d80e44e6..b60f3beb3b7c5d1e1db8140fea7744d648c3430a 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-10.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-10.js @@ -9,27 +9,29 @@ description: > accessor property on an Array-like object ---*/ - var obj = { length: 3 }; - Object.defineProperty(obj, "0", { - get: function () { - return 0; - }, - configurable: true - }); +var obj = { + length: 3 +}; +Object.defineProperty(obj, "0", { + get: function() { + return 0; + }, + configurable: true +}); - Object.defineProperty(obj, "1", { - get: function () { - return 1; - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + return 1; + }, + configurable: true +}); - Object.defineProperty(obj, "2", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(obj, "2", { + get: function() { + return 2; + }, + configurable: true +}); assert.sameValue(Array.prototype.lastIndexOf.call(obj, 0), 0, 'Array.prototype.lastIndexOf.call(obj, 0)'); assert.sameValue(Array.prototype.lastIndexOf.call(obj, 1), 1, 'Array.prototype.lastIndexOf.call(obj, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-11.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-11.js index 72eb049479c21566fcb0bf7c1a85a6954d194ad4..6dfa28831c1ae2e3f55e2fd5504311f0dc56e64c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-11.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-11.js @@ -10,14 +10,14 @@ description: > Array ---*/ - var arr = []; +var arr = []; - Array.prototype[0] = false; - Object.defineProperty(arr, "0", { - get: function () { - return true; - }, - configurable: true - }); +Array.prototype[0] = false; +Object.defineProperty(arr, "0", { + get: function() { + return true; + }, + configurable: true +}); assert.sameValue(arr.lastIndexOf(true), 0, 'arr.lastIndexOf(true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-12.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-12.js index 94fef7d4cf948fafa0594530db71b94772db10b1..739d80bb32d418bd991fcda15c9ce9708649949b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-12.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-12.js @@ -10,14 +10,16 @@ description: > Array-like object ---*/ - var obj = { length: 1 }; +var obj = { + length: 1 +}; - Object.prototype[0] = false; - Object.defineProperty(obj, "0", { - get: function () { - return true; - }, - configurable: true - }); +Object.prototype[0] = false; +Object.defineProperty(obj, "0", { + get: function() { + return true; + }, + configurable: true +}); assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 0, 'Array.prototype.lastIndexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-13.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-13.js index bd077110e06aecac431cb5c7246f10498edcf1fb..70462919d3b71ec3720c49a07ad8187bfc70d54b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-13.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-13.js @@ -10,20 +10,20 @@ description: > an Array ---*/ - var arr = []; +var arr = []; - Object.defineProperty(Array.prototype, "0", { - get: function () { - return false; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return false; + }, + configurable: true +}); - Object.defineProperty(arr, "0", { - get: function () { - return true; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + return true; + }, + configurable: true +}); assert.sameValue(arr.lastIndexOf(true), 0, 'arr.lastIndexOf(true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-14.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-14.js index 9a326f9d47823c986964076d2ee9b9c9387fcec7..9662f75bd5cdf9b003082fe0da5077aa0d895b43 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-14.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-14.js @@ -10,20 +10,22 @@ description: > an Array-like object ---*/ - var obj = { length: 1 }; +var obj = { + length: 1 +}; - Object.defineProperty(Object.prototype, "0", { - get: function () { - return false; - }, - configurable: true - }); +Object.defineProperty(Object.prototype, "0", { + get: function() { + return false; + }, + configurable: true +}); - Object.defineProperty(obj, "0", { - get: function () { - return true; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + return true; + }, + configurable: true +}); assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 0, 'Array.prototype.lastIndexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-15.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-15.js index e91eaf66b5fbe08c08a5fb9f16f2ca06fdb48d42..32c4149d882463ecc47c26fc89782b8c59892689 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-15.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-15.js @@ -9,26 +9,26 @@ description: > accessor property on an Array ---*/ - Object.defineProperty(Array.prototype, "0", { - get: function () { - return 10; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return 10; + }, + configurable: true +}); - Object.defineProperty(Array.prototype, "1", { - get: function () { - return 20; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "1", { + get: function() { + return 20; + }, + configurable: true +}); - Object.defineProperty(Array.prototype, "2", { - get: function () { - return 30; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "2", { + get: function() { + return 30; + }, + configurable: true +}); assert.sameValue([, , , ].lastIndexOf(10), 0, '[, , , ].lastIndexOf(10)'); assert.sameValue([, , , ].lastIndexOf(20), 1, '[, , , ].lastIndexOf(20)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-16.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-16.js index 89205ee26e8bd7226feb03baf20706cf7fddb6fd..e8cb635fd92086261c38201a2ac95651b8fa0294 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-16.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-16.js @@ -9,27 +9,33 @@ description: > accessor property on an Array-like object ---*/ - Object.defineProperty(Object.prototype, "0", { - get: function () { - return 10; - }, - configurable: true - }); +Object.defineProperty(Object.prototype, "0", { + get: function() { + return 10; + }, + configurable: true +}); - Object.defineProperty(Object.prototype, "1", { - get: function () { - return 20; - }, - configurable: true - }); +Object.defineProperty(Object.prototype, "1", { + get: function() { + return 20; + }, + configurable: true +}); - Object.defineProperty(Object.prototype, "2", { - get: function () { - return 30; - }, - configurable: true - }); +Object.defineProperty(Object.prototype, "2", { + get: function() { + return 30; + }, + configurable: true +}); -assert.sameValue(Array.prototype.lastIndexOf.call({ length: 3 }, 10), 0, 'Array.prototype.lastIndexOf.call({ length: 3 }, 10)'); -assert.sameValue(Array.prototype.lastIndexOf.call({ length: 3 }, 20), 1, 'Array.prototype.lastIndexOf.call({ length: 3 }, 20)'); -assert.sameValue(Array.prototype.lastIndexOf.call({ length: 3 }, 30), 2, 'Array.prototype.lastIndexOf.call({ length: 3 }, 30)'); +assert.sameValue(Array.prototype.lastIndexOf.call({ + length: 3 +}, 10), 0, 'Array.prototype.lastIndexOf.call({ length: 3 }, 10)'); +assert.sameValue(Array.prototype.lastIndexOf.call({ + length: 3 +}, 20), 1, 'Array.prototype.lastIndexOf.call({ length: 3 }, 20)'); +assert.sameValue(Array.prototype.lastIndexOf.call({ + length: 3 +}, 30), 2, 'Array.prototype.lastIndexOf.call({ length: 3 }, 30)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-17.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-17.js index 796abed7bd09bb0040ac6a653242103772894070..dc14b777b568e27b76fb9e9219322d422011365c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-17.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-17.js @@ -9,10 +9,10 @@ description: > accessor property without a get function on an Array ---*/ - var arr = []; - Object.defineProperty(arr, "0", { - set: function () { }, - configurable: true - }); +var arr = []; +Object.defineProperty(arr, "0", { + set: function() {}, + configurable: true +}); assert.sameValue(arr.lastIndexOf(undefined), 0, 'arr.lastIndexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-18.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-18.js index 65fc004c55818530acf09eeae3155423dd4cc857..0a9e3a693656314a2752a62dcf8933f758400b14 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-18.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-18.js @@ -9,10 +9,12 @@ description: > accessor property without a get function on an Array-like object ---*/ - var obj = { length: 1 }; - Object.defineProperty(obj, "0", { - set: function () { }, - configurable: true - }); +var obj = { + length: 1 +}; +Object.defineProperty(obj, "0", { + set: function() {}, + configurable: true +}); assert.sameValue(Array.prototype.lastIndexOf.call(obj, undefined), 0, 'Array.prototype.lastIndexOf.call(obj, undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-19.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-19.js index 3c9baf0af23088f5ceead0ca2dafe9ffa201b475..d5ca0b3ee1f4cde2472aa8a88e75b45a4ed75fad 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-19.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-19.js @@ -10,18 +10,20 @@ description: > inherited accessor property on an Array-like object ---*/ - var obj = { length: 1 }; +var obj = { + length: 1 +}; - Object.defineProperty(Object.prototype, "0", { - get: function () { - return 20; - }, - configurable: true - }); - Object.defineProperty(obj, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(Object.prototype, "0", { + get: function() { + return 20; + }, + configurable: true +}); +Object.defineProperty(obj, "0", { + set: function() {}, + configurable: true +}); assert(obj.hasOwnProperty(0), 'obj.hasOwnProperty(0) !== true'); assert.sameValue(Array.prototype.lastIndexOf.call(obj, undefined), 0, 'Array.prototype.lastIndexOf.call(obj, undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-20.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-20.js index d0c826fd283f1a1ad78591ae6fbf395886ac8465..1f0b708390e6178b9f66371971ea2b2155e9f953 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-20.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-20.js @@ -10,18 +10,18 @@ description: > inherited accessor property on an Array ---*/ - var arr = [, 1]; +var arr = [, 1]; - Object.defineProperty(Array.prototype, "0", { - get: function () { - return 100; - }, - configurable: true - }); - Object.defineProperty(arr, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return 100; + }, + configurable: true +}); +Object.defineProperty(arr, "0", { + set: function() {}, + configurable: true +}); assert(arr.hasOwnProperty(0), 'arr.hasOwnProperty(0) !== true'); assert.sameValue(arr.lastIndexOf(undefined), 0, 'arr.lastIndexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-21.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-21.js index 71304e77763688833b9898bc7760a6598bc1b111..ee64326c12dd9e4405b298ae36d00e7453b96da2 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-21.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-21.js @@ -9,9 +9,9 @@ description: > accessor property without a get function on an Array ---*/ - Object.defineProperty(Array.prototype, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + set: function() {}, + configurable: true +}); assert.sameValue([, ].lastIndexOf(undefined), 0, '[, ].lastIndexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-22.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-22.js index 735c9cc7aad09e04e3d777342a3c13675c6b91a3..8dbf01f642621772049d13c6087fa2710edf51d3 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-22.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-22.js @@ -9,9 +9,11 @@ description: > accessor property without a get function on an Array-like object ---*/ - Object.defineProperty(Object.prototype, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(Object.prototype, "0", { + set: function() {}, + configurable: true +}); -assert.sameValue(Array.prototype.lastIndexOf.call({ length: 1 }, undefined), 0, 'Array.prototype.lastIndexOf.call({ length: 1 }, undefined)'); +assert.sameValue(Array.prototype.lastIndexOf.call({ + length: 1 +}, undefined), 0, 'Array.prototype.lastIndexOf.call({ length: 1 }, undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-25.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-25.js index eeb3f4653513e3c89189935eb74763977d7fa931..d6806a98edb7b2888d375ce0749eee52b95a15c1 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-25.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-25.js @@ -10,9 +10,9 @@ description: > less than number of parameters) ---*/ - var func = function (a, b) { - return 0 === Array.prototype.lastIndexOf.call(arguments, arguments[0]) && - -1 === Array.prototype.lastIndexOf.call(arguments, arguments[1]); - }; +var func = function(a, b) { + return 0 === Array.prototype.lastIndexOf.call(arguments, arguments[0]) && + -1 === Array.prototype.lastIndexOf.call(arguments, arguments[1]); +}; assert(func(true), 'func(true) !== true'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-26.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-26.js index b568be548398862adb25795e204c727f742b39fd..b4066d73348dce64907270dac6badca94d0274fb 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-26.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-26.js @@ -10,10 +10,10 @@ description: > to number of parameters) ---*/ - var func = function (a, b) { - return 0 === Array.prototype.lastIndexOf.call(arguments, arguments[0]) && - 1 === Array.prototype.lastIndexOf.call(arguments, arguments[1]) && - -1 === Array.prototype.lastIndexOf.call(arguments, arguments[2]); - }; +var func = function(a, b) { + return 0 === Array.prototype.lastIndexOf.call(arguments, arguments[0]) && + 1 === Array.prototype.lastIndexOf.call(arguments, arguments[1]) && + -1 === Array.prototype.lastIndexOf.call(arguments, arguments[2]); +}; assert(func(0, true), 'func(0, true) !== true'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-27.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-27.js index 7936ac8fb17cbcdee04f288045ac636a9ba0b6b4..1d9f678632d8ad0185e31c940048b3fc496926d1 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-27.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-27.js @@ -10,7 +10,7 @@ description: > greater than number of parameters) ---*/ -var func = function (a, b) { +var func = function(a, b) { assert.sameValue(Array.prototype.lastIndexOf.call(arguments, arguments[0]), 2); assert.sameValue(Array.prototype.lastIndexOf.call(arguments, arguments[3]), 3); assert.sameValue(Array.prototype.lastIndexOf.call(arguments, arguments[4]), -1); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-28.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-28.js index aa3fa78183689f1312b91dd40a92f2ebc4280788..d599c9fa4505a7acf13f307fd28e9a86a12bf838 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-28.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-28.js @@ -9,26 +9,26 @@ description: > subsequent iterations on an Array ---*/ - var preIterVisible = false; - var arr = []; +var preIterVisible = false; +var arr = []; - Object.defineProperty(arr, "2", { - get: function () { - preIterVisible = true; - return false; - }, - configurable: true - }); +Object.defineProperty(arr, "2", { + get: function() { + preIterVisible = true; + return false; + }, + configurable: true +}); - Object.defineProperty(arr, "1", { - get: function () { - if (preIterVisible) { - return true; - } else { - return false; - } - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + if (preIterVisible) { + return true; + } else { + return false; + } + }, + configurable: true +}); assert.sameValue(arr.lastIndexOf(true), 1, 'arr.lastIndexOf(true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-29.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-29.js index e73976d9384b02ed0c1018919ab60064bf13dd3a..59ada2f1dbe9ef43ca721618de7c6bc69b163da0 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-29.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-29.js @@ -9,26 +9,28 @@ description: > subsequent iterations on an Array-like object ---*/ - var preIterVisible = false; - var obj = { length: 3 }; +var preIterVisible = false; +var obj = { + length: 3 +}; - Object.defineProperty(obj, "2", { - get: function () { - preIterVisible = true; - return false; - }, - configurable: true - }); +Object.defineProperty(obj, "2", { + get: function() { + preIterVisible = true; + return false; + }, + configurable: true +}); - Object.defineProperty(obj, "1", { - get: function () { - if (preIterVisible) { - return true; - } else { - return false; - } - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + if (preIterVisible) { + return true; + } else { + return false; + } + }, + configurable: true +}); assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 1, 'Array.prototype.lastIndexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-3.js index b292c0f5cd4a6c51c9e666be073963c9d2e9cf55..5b82efe114b2a3616c8aee8213be432c75de31f7 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-3.js @@ -9,6 +9,6 @@ description: > property that overrides an inherited data property on an Array ---*/ - Array.prototype[0] = Object; +Array.prototype[0] = Object; assert.sameValue([Object.prototype].lastIndexOf(Object.prototype), 0, '[Object.prototype].lastIndexOf(Object.prototype)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-30.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-30.js index 251c5d42850f065bee64061370dfeec1296ed76d..15b600383ecb82af6e6b7fb8a135863fdd831b2d 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 @@ -9,24 +9,24 @@ description: > exception on an Array ---*/ - var accessed = false; - var arr = []; +var accessed = false; +var arr = []; - Object.defineProperty(arr, "2", { - get: function () { - throw new TypeError(); - }, - configurable: true - }); +Object.defineProperty(arr, "2", { + get: function() { + throw new TypeError(); + }, + configurable: true +}); - Object.defineProperty(arr, "1", { - get: function () { - accessed = true; - return true; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + accessed = true; + return true; + }, + configurable: true +}); assert.throws(TypeError, function() { - arr.lastIndexOf(true); + arr.lastIndexOf(true); }); 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 933d72d123a02ddfff117e0f91fa92996fa0a7dd..0d46b3d56cd6726a0f015df0f9513086b770ccac 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 @@ -9,24 +9,26 @@ description: > exception on an Array-like object ---*/ - var accessed = false; - var obj = { length: 3 }; +var accessed = false; +var obj = { + length: 3 +}; - Object.defineProperty(obj, "2", { - get: function () { - throw new TypeError(); - }, - configurable: true - }); +Object.defineProperty(obj, "2", { + get: function() { + throw new TypeError(); + }, + configurable: true +}); - Object.defineProperty(obj, "1", { - get: function () { - accessed = true; - return true; - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + accessed = true; + return true; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.lastIndexOf.call(obj, true); + Array.prototype.lastIndexOf.call(obj, true); }); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-4.js index 8f6e11da43f0db8d8fcd6532518d08cd8739416f..2204423702a8d30fc9861916b8700398bd3c3b03 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-4.js @@ -10,6 +10,10 @@ description: > Array-like object ---*/ - Object.prototype[0] = false; +Object.prototype[0] = false; -assert.sameValue(Array.prototype.lastIndexOf.call({ 0: true, 1: 1, length: 2 }, true), 0, 'Array.prototype.lastIndexOf.call({ 0: true, 1: 1, length: 2 }, true)'); +assert.sameValue(Array.prototype.lastIndexOf.call({ + 0: true, + 1: 1, + length: 2 +}, true), 0, 'Array.prototype.lastIndexOf.call({ 0: true, 1: 1, length: 2 }, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-5.js index 771fde968ee093fe11ffb20f286c3ff221c68669..aa6921e41a905b86fe4cca5c88bfc7c88ad82041 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-5.js @@ -9,11 +9,11 @@ description: > property that overrides an inherited accessor property on an Array ---*/ - Object.defineProperty(Array.prototype, "0", { - get: function () { - return false; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return false; + }, + configurable: true +}); assert.sameValue([Number].lastIndexOf(Number), 0, '[Number].lastIndexOf(Number)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-6.js index 8c2ec33795fb81353030ef91608ab432e900da49..70e3914190bb01a2ea99654f62925fea50d4de21 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-6.js @@ -10,11 +10,15 @@ description: > Array-like object ---*/ - Object.defineProperty(Object.prototype, "0", { - get: function () { - return false; - }, - configurable: true - }); +Object.defineProperty(Object.prototype, "0", { + get: function() { + return false; + }, + configurable: true +}); -assert.sameValue(Array.prototype.lastIndexOf.call({ 0: true, 1: 1, length: 2 }, true), 0, 'Array.prototype.lastIndexOf.call({ 0: true, 1: 1, length: 2 }, true)'); +assert.sameValue(Array.prototype.lastIndexOf.call({ + 0: true, + 1: 1, + length: 2 +}, true), 0, 'Array.prototype.lastIndexOf.call({ 0: true, 1: 1, length: 2 }, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-7.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-7.js index d38620b9886b3538b20e1fa64701a480c4b3468b..a3c2f490260984daa3e7dd2ff9c9ef2c924da352 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-7.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-7.js @@ -9,9 +9,9 @@ description: > data property on an Array ---*/ - Array.prototype[0] = true; - Array.prototype[1] = false; - Array.prototype[2] = "true"; +Array.prototype[0] = true; +Array.prototype[1] = false; +Array.prototype[2] = "true"; assert.sameValue([, , , ].lastIndexOf(true), 0, '[, , , ].lastIndexOf(true)'); assert.sameValue([, , , ].lastIndexOf(false), 1, '[, , , ].lastIndexOf(false)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-8.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-8.js index fbb0ea0bd0687d67f5ce6deaf39d03738d4df66a..f06b7bfefc511da2a008d67b84cd1d69c28d54ea 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-8.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-8.js @@ -9,10 +9,16 @@ description: > data property on an Array-like object ---*/ - Object.prototype[0] = true; - Object.prototype[1] = false; - Object.prototype[2] = "true"; +Object.prototype[0] = true; +Object.prototype[1] = false; +Object.prototype[2] = "true"; -assert.sameValue(Array.prototype.lastIndexOf.call({ length: 3 }, true), 0, 'Array.prototype.lastIndexOf.call({ length: 3 }, true)'); -assert.sameValue(Array.prototype.lastIndexOf.call({ length: 3 }, false), 1, 'Array.prototype.lastIndexOf.call({ length: 3 }, false)'); -assert.sameValue(Array.prototype.lastIndexOf.call({ length: 3 }, "true"), 2, 'Array.prototype.lastIndexOf.call({ length: 3 }, "true")'); +assert.sameValue(Array.prototype.lastIndexOf.call({ + length: 3 +}, true), 0, 'Array.prototype.lastIndexOf.call({ length: 3 }, true)'); +assert.sameValue(Array.prototype.lastIndexOf.call({ + length: 3 +}, false), 1, 'Array.prototype.lastIndexOf.call({ length: 3 }, false)'); +assert.sameValue(Array.prototype.lastIndexOf.call({ + length: 3 +}, "true"), 2, 'Array.prototype.lastIndexOf.call({ length: 3 }, "true")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-9.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-9.js index a20c0fa5d4ce5fe1afca225f61153831fdd6ba52..d5ff8a47a30c5cbd85d2fab70476502bb80e47e0 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-9.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-9.js @@ -9,27 +9,27 @@ description: > accessor property on an Array ---*/ - var arr = [, , , ]; - Object.defineProperty(arr, "0", { - get: function () { - return 0; - }, - configurable: true - }); +var arr = [, , , ]; +Object.defineProperty(arr, "0", { + get: function() { + return 0; + }, + configurable: true +}); - Object.defineProperty(arr, "1", { - get: function () { - return 1; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + return 1; + }, + configurable: true +}); - Object.defineProperty(arr, "2", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(arr, "2", { + get: function() { + return 2; + }, + configurable: true +}); assert.sameValue(arr.lastIndexOf(0), 0, 'arr.lastIndexOf(0)'); assert.sameValue(arr.lastIndexOf(1), 1, 'arr.lastIndexOf(1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-1.js index c88bf06b2627f3886e53a43e9aba332fff3e54db..953212528eef91bc2e40277ab6e0bb4ae82e3adb 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-1.js @@ -14,4 +14,6 @@ assert.sameValue(["0"].lastIndexOf(0), -1, '["0"].lastIndexOf(0)'); assert.sameValue([false].lastIndexOf(0), -1, '[false].lastIndexOf(0)'); assert.sameValue([undefined].lastIndexOf(0), -1, '[undefined].lastIndexOf(0)'); assert.sameValue([null].lastIndexOf(0), -1, '[null].lastIndexOf(0)'); -assert.sameValue([[]].lastIndexOf(0), -1, '[[]].lastIndexOf(0)'); +assert.sameValue([ + [] +].lastIndexOf(0), -1, '[[]].lastIndexOf(0)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-11.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-11.js index 97cbb1fd48d875ea5c755906adf632bf9e5d2139..bbe793889095a83f22f3c241962baf740322cdce 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-11.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-11.js @@ -9,8 +9,8 @@ description: > element are Objects, and they refer to the same object ---*/ - var obj1 = {}; - var obj2 = {}; - var obj3 = obj2; +var obj1 = {}; +var obj2 = {}; +var obj3 = obj2; assert.sameValue([obj2, obj1].lastIndexOf(obj3), 0, '[obj2, obj1].lastIndexOf(obj3)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-iii-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-iii-2.js index 5c1d0c670e3cf6409e9b7e53c1e04a94d2f313dd..ae16fd014dfdb4a832a8abcd8ed6e562d116c5b7 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-iii-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-iii-2.js @@ -9,26 +9,26 @@ description: > element once search value is found ---*/ - var arr = [2, 1, , 1, 2]; - var elementFirstAccessed = false; - var elementThirdAccessed = false; +var arr = [2, 1, , 1, 2]; +var elementFirstAccessed = false; +var elementThirdAccessed = false; - Object.defineProperty(arr, "2", { - get: function () { - elementThirdAccessed = true; - return 2; - }, - configurable: true - }); - Object.defineProperty(arr, "0", { - get: function () { - elementFirstAccessed = true; - return 2; - }, - configurable: true - }); +Object.defineProperty(arr, "2", { + get: function() { + elementThirdAccessed = true; + return 2; + }, + configurable: true +}); +Object.defineProperty(arr, "0", { + get: function() { + elementFirstAccessed = true; + return 2; + }, + configurable: true +}); - arr.lastIndexOf(2); +arr.lastIndexOf(2); assert.sameValue(elementThirdAccessed, false, 'elementThirdAccessed'); assert.sameValue(elementFirstAccessed, false, 'elementFirstAccessed'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-9-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-9-1.js index 8f70daaf5c2f4d3a79d3cd5f5e5ad6f8ba6b3a21..2c4b6a094da68a18e596bf5e64479361ffe6299f 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-9-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-9-1.js @@ -7,13 +7,13 @@ es5id: 15.4.4.15-9-1 description: Array.prototype.lastIndexOf returns -1 for elements not present ---*/ - var a = new Array(); - a[100] = 1; - a[99999] = ""; - a[10] = new Object(); - a[5555] = 5.5; - a[123456] = "str"; - a[5] = 1E+309; +var a = new Array(); +a[100] = 1; +a[99999] = ""; +a[10] = new Object(); +a[5555] = 5.5; +a[123456] = "str"; +a[5] = 1E+309; assert.sameValue(a.lastIndexOf(1), 100, 'a.lastIndexOf(1)'); assert.sameValue(a.lastIndexOf(""), 99999, 'a.lastIndexOf("")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-9-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-9-2.js index 2c47880f4823dd085f38f35bb75aad3ed4c39592..e756e32f0502a1ba87ab483a6b11641412534abc 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-9-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-9-2.js @@ -9,11 +9,18 @@ description: > not access any other properties ---*/ - var accessed = false; - var f = {length: 0}; - Object.defineProperty(f,"0",{get: function () {accessed = true; return 1;}}); +var accessed = false; +var f = { + length: 0 +}; +Object.defineProperty(f, "0", { + get: function() { + accessed = true; + return 1; + } +}); - var i = Array.prototype.lastIndexOf.call(f,1); +var i = Array.prototype.lastIndexOf.call(f, 1); assert.sameValue(i, -1, 'i'); 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 84d3f60dea34b3812a8945d41711e4e8fc18c435..15edce5b1e6dfb759e91ebdffcadbdecda4019bd 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 @@ -9,5 +9,5 @@ description: Array.prototype.map - applied to undefined assert.throws(TypeError, function() { - Array.prototype.map.call(undefined); // TypeError is thrown if value is undefined + Array.prototype.map.call(undefined); // TypeError is thrown if value is undefined }); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-10.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-10.js index abe5006666d412631c5f28c5878b61f9a4e40e43..52eb839eba8d05a80d273953a900e460d0afa2e6 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-10.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-10.js @@ -7,12 +7,12 @@ es5id: 15.4.4.19-1-10 description: Array.prototype.map - applied to the Math object ---*/ - function callbackfn(val, idx, obj) { - return ('[object Math]' === Object.prototype.toString.call(obj)); - } +function callbackfn(val, idx, obj) { + return ('[object Math]' === Object.prototype.toString.call(obj)); +} - Math.length = 1; - Math[0] = 1; - var testResult = Array.prototype.map.call(Math, callbackfn); +Math.length = 1; +Math[0] = 1; +var testResult = Array.prototype.map.call(Math, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-11.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-11.js index bf14fa9a5eb302d6e1297757dbfb2b6a2ea9bf66..48585111966682c7c1f0bae46c5acc200914b7d8 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-11.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-11.js @@ -7,14 +7,14 @@ es5id: 15.4.4.19-1-11 description: Array.prototype.map - applied to Date object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Date; - } +function callbackfn(val, idx, obj) { + return obj instanceof Date; +} - var obj = new Date(); - obj.length = 1; - obj[0] = 1; +var obj = new Date(); +obj.length = 1; +obj[0] = 1; - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-12.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-12.js index ff7c0430cba209c040c55b1f87280243ab6abdac..ed40782e89a53b47a20d1456bd55c0bfeddbb105 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-12.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-12.js @@ -7,14 +7,14 @@ es5id: 15.4.4.19-1-12 description: Array.prototype.map - applied to RegExp object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof RegExp; - } +function callbackfn(val, idx, obj) { + return obj instanceof RegExp; +} - var obj = new RegExp(); - obj.length = 1; - obj[0] = 1; +var obj = new RegExp(); +obj.length = 1; +obj[0] = 1; - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-13.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-13.js index 72f36faed5de43ce0ed420081afb112657598a08..a17d877bd7ce1d19a44cf6fb235c065da8671f74 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-13.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-13.js @@ -7,12 +7,12 @@ es5id: 15.4.4.19-1-13 description: Array.prototype.map - applied to the JSON object ---*/ - function callbackfn(val, idx, obj) { - return ('[object JSON]' === Object.prototype.toString.call(obj)); - } +function callbackfn(val, idx, obj) { + return ('[object JSON]' === Object.prototype.toString.call(obj)); +} - JSON.length = 1; - JSON[0] = 1; - var testResult = Array.prototype.map.call(JSON, callbackfn); +JSON.length = 1; +JSON[0] = 1; +var testResult = Array.prototype.map.call(JSON, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-14.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-14.js index 0beb4afa90d285592277dc21cb6f64799585d844..2fc430d6d407e132d46bc69f07de2d231931439b 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-14.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-14.js @@ -7,14 +7,14 @@ es5id: 15.4.4.19-1-14 description: Array.prototype.map - applied to Error object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Error; - } +function callbackfn(val, idx, obj) { + return obj instanceof Error; +} - var obj = new Error(); - obj.length = 1; - obj[0] = 1; +var obj = new Error(); +obj.length = 1; +obj[0] = 1; - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-15.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-15.js index 2dd146e2aa4612d1b426bdfc46d7eb5c807b10d4..a8774bf2fc3e881a037f3bc99476bc4016525795 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-15.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-15.js @@ -7,14 +7,14 @@ es5id: 15.4.4.19-1-15 description: Array.prototype.map - applied to the Arguments object ---*/ - function callbackfn(val, idx, obj) { - return ('[object Arguments]' === Object.prototype.toString.call(obj)); - } +function callbackfn(val, idx, obj) { + return ('[object Arguments]' === Object.prototype.toString.call(obj)); +} - var obj = (function () { - return arguments; - }("a", "b")); +var obj = (function() { + return arguments; +}("a", "b")); - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult[1], true, 'testResult[1]'); 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 45316ee3e2bfbb83db1f8df3b4224e51a5797b08..864d017a075787b48fbf446a02172448487a6b0f 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 @@ -9,5 +9,5 @@ description: Array.prototype.map - applied to null assert.throws(TypeError, function() { - Array.prototype.map.call(null); // TypeError is thrown if value is null + Array.prototype.map.call(null); // TypeError is thrown if value is null }); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-3.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-3.js index 94d84f8f9cc17b12c3cb897273e232be897debb6..3566c0ee49d6aa53fd9d877dab4ad260737486a7 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-3.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-3.js @@ -7,13 +7,13 @@ es5id: 15.4.4.19-1-3 description: Array.prototype.map - applied to boolean primitive ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Boolean; - } +function callbackfn(val, idx, obj) { + return obj instanceof Boolean; +} - Boolean.prototype[0] = true; - Boolean.prototype.length = 1; +Boolean.prototype[0] = true; +Boolean.prototype.length = 1; - var testResult = Array.prototype.map.call(false, callbackfn); +var testResult = Array.prototype.map.call(false, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-4.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-4.js index 0fd3c3f0004450bc9da5cb469e06434d162d1da5..82e9e614e57595df4680eab7b48113ccb6119d81 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-4.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-4.js @@ -7,16 +7,16 @@ es5id: 15.4.4.19-1-4 description: Array.prototype.map - applied to Boolean object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Boolean; - } +function callbackfn(val, idx, obj) { + return obj instanceof Boolean; +} - var obj = new Boolean(true); - obj.length = 2; - obj[0] = 11; - obj[1] = 12; +var obj = new Boolean(true); +obj.length = 2; +obj[0] = 11; +obj[1] = 12; - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); assert.sameValue(testResult[1], true, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-5.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-5.js index 15ef1ec6d141afff5628a698648916bc1a8f5252..6a04e9177d24197913a3a5ac643a6ffb7036cde8 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-5.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-5.js @@ -7,13 +7,13 @@ es5id: 15.4.4.19-1-5 description: Array.prototype.map - applied to number primitive ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Number; - } +function callbackfn(val, idx, obj) { + return obj instanceof Number; +} - Number.prototype[0] = 1; - Number.prototype.length = 1; +Number.prototype[0] = 1; +Number.prototype.length = 1; - var testResult = Array.prototype.map.call(2.5, callbackfn); +var testResult = Array.prototype.map.call(2.5, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-6.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-6.js index e27b6cabbea795ec61bf84ca79bfd6e8a9ed0570..ac9c03bca2ad1fbb97f42167fe726c8b5ab484ed 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-6.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-6.js @@ -7,16 +7,16 @@ es5id: 15.4.4.19-1-6 description: Array.prototype.map - applied to Number object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Number; - } +function callbackfn(val, idx, obj) { + return obj instanceof Number; +} - var obj = new Number(-128); - obj.length = 2; - obj[0] = 11; - obj[1] = 12; +var obj = new Number(-128); +obj.length = 2; +obj[0] = 11; +obj[1] = 12; - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); assert.sameValue(testResult[1], true, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-7.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-7.js index ca3f320496b1fdfbfcb602ea6ea595119da57464..402368ebd851787f2bf6bf93d3ff167fdd941e78 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-7.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-7.js @@ -7,11 +7,11 @@ es5id: 15.4.4.19-1-7 description: Array.prototype.map - applied to string primitive ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof String; - } +function callbackfn(val, idx, obj) { + return obj instanceof String; +} - var testResult = Array.prototype.map.call("abc", callbackfn); +var testResult = Array.prototype.map.call("abc", callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); assert.sameValue(testResult[1], true, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-8.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-8.js index aef3b6dcccd2d4d720cb35455f49c9774d29b76a..93ca61e4fcc93dfc015da1f6bef3f1077a90bb85 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-8.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-8.js @@ -7,12 +7,12 @@ es5id: 15.4.4.19-1-8 description: Array.prototype.map - applied to String object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof String; - } +function callbackfn(val, idx, obj) { + return obj instanceof String; +} - var obj = new String("abc"); - var testResult = Array.prototype.map.call(obj, callbackfn); +var obj = new String("abc"); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); assert.sameValue(testResult[1], true, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-9.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-9.js index 73438cef48738f856189245b5364ce4f8621870a..82f5918aa3c84055a17ecfda061d2da48a567e11 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-9.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-9.js @@ -7,17 +7,17 @@ es5id: 15.4.4.19-1-9 description: Array.prototype.map - applied to Function object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Function; - } +function callbackfn(val, idx, obj) { + return obj instanceof Function; +} - var obj = function (a, b) { - return a + b; - }; - obj[0] = 11; - obj[1] = 9; +var obj = function(a, b) { + return a + b; +}; +obj[0] = 11; +obj[1] = 9; - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); assert.sameValue(testResult[1], true, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-1.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-1.js index 19e77252c445449ad2516759c8b05bb2df19fedb..9e89b6d856fe297198c7a1d5087c2cf9018c9f9c 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-1.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-1.js @@ -9,17 +9,17 @@ description: > is an own data property ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var obj = { - 0: 12, - 1: 11, - 2: 9, - length: 2 - }; +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: 2 +}; - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult.length, 2, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-10.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-10.js index 431968e00c27089e3a7ad7059cbac010b1e068d3..9a74b1e09ad85dbd4bddc4d9d5e335f11778ff5e 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-10.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-10.js @@ -9,27 +9,27 @@ description: > inherited accessor property ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var proto = {}; +var proto = {}; - Object.defineProperty(proto, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(proto, "length", { + get: function() { + return 2; + }, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[0] = 12; - child[1] = 11; - child[2] = 9; +var child = new Con(); +child[0] = 12; +child[1] = 11; +child[2] = 9; - var testResult = Array.prototype.map.call(child, callbackfn); +var testResult = Array.prototype.map.call(child, callbackfn); assert.sameValue(testResult.length, 2, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-11.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-11.js index c0766d9bce1a60e4aafbad1b72848950f413eece..c026c69712ff7d66c2578944db838581e96e35fd 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-11.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-11.js @@ -9,19 +9,19 @@ description: > is an own accessor property without a get function ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var obj = { - 0: 11, - 1: 12 - }; - Object.defineProperty(obj, "length", { - set: function () { }, - configurable: true - }); +var obj = { + 0: 11, + 1: 12 +}; +Object.defineProperty(obj, "length", { + set: function() {}, + configurable: true +}); - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult.length, 0, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-12.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-12.js index 2aebd50d9b4c7631c31142113cd37382a5059b90..93d0ceada020768b730d82a39588402de3b61bd8 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-12.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-12.js @@ -10,23 +10,26 @@ description: > overrides an inherited accessor property ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - Object.defineProperty(Object.prototype, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(Object.prototype, "length", { + get: function() { + return 2; + }, + configurable: true +}); - var obj = { 0: 12, 1: 11 }; - Object.defineProperty(obj, "length", { - set: function () { }, - configurable: true - }); +var obj = { + 0: 12, + 1: 11 +}; +Object.defineProperty(obj, "length", { + set: function() {}, + configurable: true +}); - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult.length, 0, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-13.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-13.js index 6c59cd21a96fd71789439de25780b6c6dbd0e8dc..756b3754febf227958304050fdff2237adc013b2 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-13.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-13.js @@ -9,23 +9,23 @@ description: > 'length' is inherited accessor property without a get function ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var proto = {}; - Object.defineProperty(proto, "length", { - set: function () { }, - configurable: true - }); +var proto = {}; +Object.defineProperty(proto, "length", { + set: function() {}, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[0] = 11; - child[1] = 12; +var child = new Con(); +child[0] = 11; +child[1] = 12; - var testResult = Array.prototype.map.call(child, callbackfn); +var testResult = Array.prototype.map.call(child, callbackfn); assert.sameValue(testResult.length, 0, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-14.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-14.js index 430de152502ce2d4d65d34ffc1003d758bed6384..6b3f226099d280bad3ea11573a5a1d2b54517cff 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-14.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-14.js @@ -9,12 +9,15 @@ description: > 'length' property doesn't exist ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult.length, 0, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-17.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-17.js index 04fd19b43e48cd41c7bd0e63588f890efb2b7b7f..28607e1b68fc79561fc624bb552506f73d0217c3 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-17.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-17.js @@ -9,14 +9,14 @@ description: > implements its own property get method ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var func = function (a, b) { - return Array.prototype.map.call(arguments, callbackfn); - }; +var func = function(a, b) { + return Array.prototype.map.call(arguments, callbackfn); +}; - var testResult = func(12, 11); +var testResult = func(12, 11); assert.sameValue(testResult.length, 2, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-18.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-18.js index 524012db22a59fcb3659803fd6956f9c8a3cf141..16f307c0fcfdb0a806763d4f85d4068f2e01ff85 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-18.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-18.js @@ -9,13 +9,13 @@ description: > its own property get method ---*/ - function callbackfn(val, idx, obj) { - return parseInt(val, 10) > 1; - } +function callbackfn(val, idx, obj) { + return parseInt(val, 10) > 1; +} - var str = new String("432"); +var str = new String("432"); - String.prototype[3] = "1"; - var testResult = Array.prototype.map.call(str, callbackfn); +String.prototype[3] = "1"; +var testResult = Array.prototype.map.call(str, callbackfn); assert.sameValue(testResult.length, 3, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-19.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-19.js index 60be78877fdde59f934004e56ffa19e1bded30fa..c2dbc89e3a542cea951cdf7681747546c78bf482 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-19.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-19.js @@ -9,17 +9,17 @@ description: > its own property get method ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var fun = function (a, b) { - return a + b; - }; - fun[0] = 12; - fun[1] = 11; - fun[2] = 9; +var fun = function(a, b) { + return a + b; +}; +fun[0] = 12; +fun[1] = 11; +fun[2] = 9; - var testResult = Array.prototype.map.call(fun, callbackfn); +var testResult = Array.prototype.map.call(fun, callbackfn); assert.sameValue(testResult.length, 2, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-2.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-2.js index 028b0c6e0534bdab2b36f9cc598bbba140d937a0..46aa6c4fbb135afdae8584c6c6687d536209e877 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-2.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-2.js @@ -9,10 +9,10 @@ description: > Array ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var testResult = [12, 11].map(callbackfn); +var testResult = [12, 11].map(callbackfn); assert.sameValue(testResult.length, 2, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-3.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-3.js index c6170291e6f0efa61b275c718bb3ddc1b04a0c5d..4c6c6b18df6532a30e742a1e1381a138cfeae223 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-3.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-3.js @@ -9,21 +9,23 @@ description: > own data property that overrides an inherited data property ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var proto = { length: 3 }; +var proto = { + length: 3 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 2; - child[0] = 12; - child[1] = 11; - child[2] = 9; +var child = new Con(); +child.length = 2; +child[0] = 12; +child[1] = 11; +child[2] = 9; - var testResult = Array.prototype.map.call(child, callbackfn); +var testResult = Array.prototype.map.call(child, callbackfn); assert.sameValue(testResult.length, 2, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-4.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-4.js index 3eff1cd3b49860b58dd63f286eb69b920f7d6706..eab5b1cb3be1a40a96e492b4ffdb3eb26f87d0db 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-4.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-4.js @@ -9,13 +9,13 @@ description: > overrides an inherited data property on an Array ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } - var arrProtoLen; +function callbackfn(val, idx, obj) { + return val > 10; +} +var arrProtoLen; - arrProtoLen = Array.prototype.length; - Array.prototype.length = 0; - var testResult = [12, 11].map(callbackfn); +arrProtoLen = Array.prototype.length; +Array.prototype.length = 0; +var testResult = [12, 11].map(callbackfn); assert.sameValue(testResult.length, 2, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-5.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-5.js index 144505d75fb70e4a09871d2741b1770292ccdf52..a636e0655fb018bb0a66bea7273bbefbf09e7be9 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-5.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-5.js @@ -9,31 +9,31 @@ description: > own data property that overrides an inherited accessor property ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } - - var proto = {}; - - Object.defineProperty(proto, "length", { - get: function () { - return 3; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - Object.defineProperty(child, "length", { - value: 2, - configurable: true - }); - child[0] = 12; - child[1] = 11; - child[2] = 9; - - var testResult = Array.prototype.map.call(child, callbackfn); +function callbackfn(val, idx, obj) { + return val > 10; +} + +var proto = {}; + +Object.defineProperty(proto, "length", { + get: function() { + return 3; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +Object.defineProperty(child, "length", { + value: 2, + configurable: true +}); +child[0] = 12; +child[1] = 11; +child[2] = 9; + +var testResult = Array.prototype.map.call(child, callbackfn); assert.sameValue(testResult.length, 2, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-6.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-6.js index a08231572e9331b6f69d9cbaa7716c4c1a4244aa..1cd5e51a2c0ce0188affe463714699a6e82cc603 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-6.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-6.js @@ -9,20 +9,22 @@ description: > inherited data property ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var proto = { length: 2 }; +var proto = { + length: 2 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[0] = 12; - child[1] = 11; - child[2] = 9; +var child = new Con(); +child[0] = 12; +child[1] = 11; +child[2] = 9; - var testResult = Array.prototype.map.call(child, callbackfn); +var testResult = Array.prototype.map.call(child, callbackfn); assert.sameValue(testResult.length, 2, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-7.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-7.js index da80f49cb7581b4ade53c57d512b9fb31ca4e48b..6853ad8d3055f4db2f2f69ac60c69a3820459caa 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-7.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-7.js @@ -9,23 +9,23 @@ description: > own accessor property ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var obj = {}; +var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return 2; + }, + configurable: true +}); - obj[0] = 12; - obj[1] = 11; - obj[2] = 9; +obj[0] = 12; +obj[1] = 11; +obj[2] = 9; - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult.length, 2, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-8.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-8.js index 45029cd3921a7ee67d9d732164b23696078142cd..abbf6ab285e542db0d30ff33dc074b3db259ef7a 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-8.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-8.js @@ -9,28 +9,30 @@ description: > own accessor property that overrides an inherited data property ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var proto = { length: 3 }; +var proto = { + length: 3 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); +var child = new Con(); - Object.defineProperty(child, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(child, "length", { + get: function() { + return 2; + }, + configurable: true +}); - child[0] = 12; - child[1] = 11; - child[2] = 9; +child[0] = 12; +child[1] = 11; +child[2] = 9; - var testResult = Array.prototype.map.call(child, callbackfn); +var testResult = Array.prototype.map.call(child, callbackfn); assert.sameValue(testResult.length, 2, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-9.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-9.js index f587d696f64ecf603e2dc14cbdf6545a007bef25..043d20e1b4824fbb78a0b8fe87acb6abcc7b7037 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-9.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-9.js @@ -10,35 +10,35 @@ description: > property ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var proto = {}; +var proto = {}; - Object.defineProperty(proto, "length", { - get: function () { - return 3; - }, - configurable: true - }); +Object.defineProperty(proto, "length", { + get: function() { + return 3; + }, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); +var child = new Con(); - Object.defineProperty(child, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(child, "length", { + get: function() { + return 2; + }, + configurable: true +}); - child[0] = 12; - child[1] = 11; - child[2] = 9; +child[0] = 12; +child[1] = 11; +child[2] = 9; - var testResult = Array.prototype.map.call(child, callbackfn); +var testResult = Array.prototype.map.call(child, callbackfn); assert.sameValue(testResult.length, 2, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-1.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-1.js index 4318f25adf97fd8ac315bef8c34ba6e65f2c05c0..364277255ed5fc7cd8554af02c6b6f9247481780 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-1.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-1.js @@ -7,12 +7,14 @@ es5id: 15.4.4.19-3-1 description: Array.prototype.map - value of 'length' is undefined ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var obj = { length: undefined }; +var obj = { + length: undefined +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-10.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-10.js index 513b39734dc41a827f44b0e1fe54364499339acb..ec607589a8b4652bf44417062dba1173c9f98059 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-10.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-10.js @@ -7,12 +7,15 @@ es5id: 15.4.4.19-3-10 description: Array.prototype.map - value of 'length' is a number (value is NaN) ---*/ - function callbackfn(val, idx, obj) { - return val < 10; - } +function callbackfn(val, idx, obj) { + return val < 10; +} - var obj = { 0: 9, length: NaN }; +var obj = { + 0: 9, + length: NaN +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-11.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-11.js index aaa1244064ab646fae2b46502b641d0d46e98a78..78210aa745614d243b39a55261d4c6dc28e68f21 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-11.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-11.js @@ -9,12 +9,17 @@ description: > number ---*/ - function callbackfn(val, idx, obj) { - return val < 10; - } +function callbackfn(val, idx, obj) { + return val < 10; +} - var obj = { 0: 11, 1: 9, 2: 12, length: "2" }; +var obj = { + 0: 11, + 1: 9, + 2: 12, + length: "2" +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-12.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-12.js index ca5eb14e6202887ce2c53b1b9570c7e49800d460..a355dc5b2b5884b61496ec5cc8ca3cfa2e49ae99 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-12.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-12.js @@ -9,12 +9,17 @@ description: > number ---*/ - function callbackfn(val, idx, obj) { - return val < 10; - } +function callbackfn(val, idx, obj) { + return val < 10; +} - var obj = { 0: 11, 1: 9, 2: 12, length: "-4294967294" }; +var obj = { + 0: 11, + 1: 9, + 2: 12, + length: "-4294967294" +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-13.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-13.js index 5c0236679e7307f03fc248904e7eded5256bc584..704ea0f16dce22b2a2a27edd642a7146504c2d59 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-13.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-13.js @@ -9,12 +9,17 @@ description: > convert to number primitive (value is a decimal number) ---*/ - function callbackfn(val, idx, obj) { - return val < 10; - } +function callbackfn(val, idx, obj) { + return val < 10; +} - var obj = { 0: 11, 1: 9, 2: 12, length: "2.5" }; +var obj = { + 0: 11, + 1: 9, + 2: 12, + length: "2.5" +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); 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 7d77ddf00db0a9e27544bd65072fdfceeeee12f4..1b57ec367933f54a70f6f0cbc892e72075c6cb27 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 @@ -7,11 +7,14 @@ es5id: 15.4.4.19-3-14 description: Array.prototype.map - 'length' is a string containing Infinity ---*/ - function callbackfn(val, idx, obj) { - return val < 10; - } +function callbackfn(val, idx, obj) { + return val < 10; +} - var obj = { 0: 9, length: "Infinity" }; +var obj = { + 0: 9, + length: "Infinity" +}; assert.throws(RangeError, function() { - Array.prototype.map.call(obj, callbackfn); + Array.prototype.map.call(obj, callbackfn); }); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-15.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-15.js index 180be9ffbb377ec5b7efd796000b645a178b1be7..100952bcdee6ffb35cc08c0c37046cc6d0b4c35d 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-15.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-15.js @@ -9,12 +9,17 @@ description: > exponential number ---*/ - function callbackfn(val, idx, obj) { - return val < 10; - } +function callbackfn(val, idx, obj) { + return val < 10; +} - var obj = { 0: 11, 1: 9, 2: 12, length: "2E0" }; +var obj = { + 0: 11, + 1: 9, + 2: 12, + length: "2E0" +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-16.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-16.js index 4190366affcbef7889a55028a27f24170ee26baa..d227a73ec0d5fffce5e7a6d46cf45813a2de2ba9 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-16.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-16.js @@ -7,12 +7,17 @@ es5id: 15.4.4.19-3-16 description: Array.prototype.map - 'length' is a string containing a hex number ---*/ - function callbackfn(val, idx, obj) { - return val < 10; - } +function callbackfn(val, idx, obj) { + return val < 10; +} - var obj = { 0: 11, 1: 9, 2: 12, length: "0x0002" }; +var obj = { + 0: 11, + 1: 9, + 2: 12, + length: "0x0002" +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-17.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-17.js index bf76228350da6df5f6c300c4669d1283c99c6f3e..5c7446c41edcb2f2bd1af1b3ca8689dc019d009c 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-17.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-17.js @@ -9,12 +9,17 @@ description: > number with leading zeros ---*/ - function callbackfn(val, idx, obj) { - return val < 10; - } +function callbackfn(val, idx, obj) { + return val < 10; +} - var obj = { 0: 11, 1: 9, 2: 12, length: "0002.00" }; +var obj = { + 0: 11, + 1: 9, + 2: 12, + length: "0002.00" +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-18.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-18.js index 887e7999259786809bf5512acfb62aad9a47d3a0..bbd1b8b5a0336c39040f2d440209f26f7e9d665b 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-18.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-18.js @@ -9,12 +9,14 @@ description: > convert to a number ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var obj = { length: "asdf!_" }; +var obj = { + length: "asdf!_" +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-19.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-19.js index 4a181897f93fae215efcb25c7f001b68d5e29ce4..2f5e2b414f6d818e40299a5afe7b4dddaf2bc483 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-19.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-19.js @@ -9,21 +9,21 @@ description: > own toString method ---*/ - function callbackfn(val, idx, obj) { - return val < 10; - } +function callbackfn(val, idx, obj) { + return val < 10; +} - var obj = { - 0: 11, - 1: 9, +var obj = { + 0: 11, + 1: 9, - length: { - toString: function () { - return '2'; - } - } - }; + length: { + toString: function() { + return '2'; + } + } +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-2.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-2.js index dc6edd021905c1a976b9cbc8a563898509caf3bf..0dae4ae48583c8418863421fee40be42b0d17660 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-2.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-2.js @@ -9,12 +9,15 @@ description: > (length overridden to true(type conversion)) ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var obj = { 0: 11, length: true }; +var obj = { + 0: 11, + length: true +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-20.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-20.js index e980403850a6202d56b0e1346fe5e645354d91c9..bc431d8a7259a7a96c960bb0bce6b6f8544dd450 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-20.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-20.js @@ -9,21 +9,21 @@ description: > own valueOf method ---*/ - function callbackfn(val, idx, obj) { - return val < 10; - } +function callbackfn(val, idx, obj) { + return val < 10; +} - var obj = { - 0: 11, - 1: 9, +var obj = { + 0: 11, + 1: 9, - length: { - valueOf: function () { - return 2; - } - } - }; + length: { + valueOf: function() { + return 2; + } + } +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-21.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-21.js index d1df6df8ec44f3a8ed96426a7deab8e93edf6b43..fb22c735517b98aa50cfee632b8fe325e90aee31 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-21.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-21.js @@ -10,29 +10,29 @@ description: > returns a string ---*/ - function callbackfn(val, idx, obj) { - return val < 10; - } +function callbackfn(val, idx, obj) { + return val < 10; +} - var firstStepOccured = false; - var secondStepOccured = false; - var obj = { - 0: 11, - 1: 9, +var firstStepOccured = false; +var secondStepOccured = false; +var obj = { + 0: 11, + 1: 9, - length: { - valueOf: function () { - firstStepOccured = true; - return {}; - }, - toString: function () { - secondStepOccured = true; - return '2'; - } - } - }; + length: { + valueOf: function() { + firstStepOccured = true; + return {}; + }, + toString: function() { + secondStepOccured = true; + return '2'; + } + } +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); assert(firstStepOccured, 'firstStepOccured !== true'); 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 3365cf226add59ae8a6afba236f1c7bb21d5d9b2..a7825b1c132c62a35bf9d70dd25eeba05af9a8bd 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 @@ -10,23 +10,23 @@ description: > primitive values ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var obj = { - 1: 11, - 2: 12, +var obj = { + 1: 11, + 2: 12, - length: { - valueOf: function () { - return {}; - }, - toString: function () { - return {}; - } - } - }; + length: { + valueOf: function() { + return {}; + }, + toString: function() { + return {}; + } + } +}; assert.throws(TypeError, function() { - Array.prototype.map.call(obj, callbackfn); + Array.prototype.map.call(obj, callbackfn); }); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-23.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-23.js index 69eb09631fc5d2a0f9fdf64f65486324419b0682..44269d081649db86c735e51e36b419f46dc54463 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-23.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-23.js @@ -9,37 +9,37 @@ description: > an object with an own toString and inherited valueOf methods ---*/ - function callbackfn(val, idx, obj) { - return val < 10; - } +function callbackfn(val, idx, obj) { + return val < 10; +} - var valueOfAccessed = false; - var toStringAccessed = false; +var valueOfAccessed = false; +var toStringAccessed = false; - var proto = { - valueOf: function () { - valueOfAccessed = true; - return 2; - } - }; +var proto = { + valueOf: function() { + valueOfAccessed = true; + return 2; + } +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); +var child = new Con(); - child.toString = function () { - toStringAccessed = true; - return '1'; - }; +child.toString = function() { + toStringAccessed = true; + return '1'; +}; - var obj = { - 0: 11, - 1: 9, - length: child - }; +var obj = { + 0: 11, + 1: 9, + length: child +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); assert(valueOfAccessed, 'valueOfAccessed !== true'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-24.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-24.js index 829ee06977cdf5211e4da6f41206ec7cc4b6d208..870a5631c47bda253287e4b8bf51748396c53cd4 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-24.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-24.js @@ -9,16 +9,16 @@ description: > ensure truncation occurs in the proper direction ---*/ - function callbackfn(val, idx, obj) { - return val < 10; - } +function callbackfn(val, idx, obj) { + return val < 10; +} - var obj = { - 0: 11, - 1: 9, - length: 2.685 - }; +var obj = { + 0: 11, + 1: 9, + length: 2.685 +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-25.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-25.js index 07ed728fc421950021aefb2a100289921d39d357..3c7138f672322fc0402cd86984da46aa3eb360ad 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-25.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-25.js @@ -7,16 +7,16 @@ es5id: 15.4.4.19-3-25 description: Array.prototype.map - value of 'length' is a negative non-integer ---*/ - function callbackfn(val, idx, obj) { - return val < 10; - } +function callbackfn(val, idx, obj) { + return val < 10; +} - var obj = { - 0: 11, - 1: 9, - length: -4294967294.5 - }; +var obj = { + 0: 11, + 1: 9, + length: -4294967294.5 +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); 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 4c0c9848661e6ddcca967e67d9838456d9421050..b4c3e3b311870e0017e975a68676b1eee1a90d93 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 @@ -7,14 +7,14 @@ es5id: 15.4.4.19-3-28 description: Array.prototype.map - value of 'length' is boundary value (2^32) ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var obj = { - 0: 12, - length: 4294967296 - }; +var obj = { + 0: 12, + length: 4294967296 +}; assert.throws(RangeError, function() { - var newArr = Array.prototype.map.call(obj, callbackfn); + var newArr = Array.prototype.map.call(obj, callbackfn); }); 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 647d3c24daf17e3eb7dd96a8481b0b3dcf2f7795..613ab9c8e68b91c5fc357d0f606406a21dfc17a9 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 @@ -9,15 +9,15 @@ description: > 1) ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var obj = { - 0: 11, - 1: 9, - length: 4294967297 - }; +var obj = { + 0: 11, + 1: 9, + length: 4294967297 +}; assert.throws(RangeError, function() { - var newArr = Array.prototype.map.call(obj, callbackfn); + var newArr = Array.prototype.map.call(obj, callbackfn); }); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-3.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-3.js index bc926871d2abcc560b683836ab14d18d81017408..096a0c323626b55ed95b1d6209842ceaddb3829c 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-3.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-3.js @@ -7,12 +7,15 @@ es5id: 15.4.4.19-3-3 description: Array.prototype.map - value of 'length' is a number (value is 0) ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var obj = { 0: 11, length: 0 }; +var obj = { + 0: 11, + length: 0 +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-4.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-4.js index d0a34ea147a381ac1253e04388551d1d3b936b1d..c3d6fbc9cb541344e6e949d4cad721254aa592d1 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-4.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-4.js @@ -7,12 +7,15 @@ es5id: 15.4.4.19-3-4 description: Array.prototype.map - value of 'length' is a number (value is +0) ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var obj = { 0: 11, length: +0 }; +var obj = { + 0: 11, + length: +0 +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-5.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-5.js index d9409340f52c3b9338395fb59314e6a1925e5e1d..d467cfe172d4c9919e20d0c20f91e3fee5629342 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-5.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-5.js @@ -7,12 +7,15 @@ es5id: 15.4.4.19-3-5 description: Array.prototype.map - value of 'length' is a number (value is -0) ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var obj = { 0: 11, length: -0 }; +var obj = { + 0: 11, + length: -0 +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-6.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-6.js index 6efbf8d0b1a5d7660309fb38c5c1f9983f2b5ef1..794464e22a556f0196d2aaa3b8a0a62a04633599 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-6.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-6.js @@ -9,12 +9,17 @@ description: > number ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var obj = { 0: 10, 1: 12, 2: 9, length: 2 }; +var obj = { + 0: 10, + 1: 12, + 2: 9, + length: 2 +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-7.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-7.js index c4b0f1bd4ce2d2efa1efe86d0ab514047386080d..a5215ce4fb2f6d58d923ba07e7a7f944f08999c9 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-7.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-7.js @@ -9,12 +9,17 @@ description: > number ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var obj = { 0: 10, 1: 12, 2: 9, length: -4294967294 }; +var obj = { + 0: 10, + 1: 12, + 2: 9, + length: -4294967294 +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); 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 6265784775bdb5854c222adb2632142edf92f37f..3677932afd848a7d1a111d11d4ecb15376bf40c4 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 @@ -9,11 +9,14 @@ description: > Infinity) ---*/ - function callbackfn(val, idx, obj) { - return val < 10; - } +function callbackfn(val, idx, obj) { + return val < 10; +} - var obj = { 0: 9, length: Infinity }; +var obj = { + 0: 9, + length: Infinity +}; assert.throws(RangeError, function() { - Array.prototype.map.call(obj, callbackfn); + Array.prototype.map.call(obj, callbackfn); }); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-3-9.js b/test/built-ins/Array/prototype/map/15.4.4.19-3-9.js index be3cdf24c6cd01df8af623fe0c5849b79b1b09ee..a97e6065eef75b5718bbdf18eebd04a665d139cd 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-3-9.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-3-9.js @@ -9,12 +9,15 @@ description: > -Infinity) ---*/ - function callbackfn(val, idx, obj) { - return val < 10; - } +function callbackfn(val, idx, obj) { + return val < 10; +} - var obj = { 0: 9, length: -Infinity }; +var obj = { + 0: 9, + length: -Infinity +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); 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 417b73aba78d0df4d16abe8b497ddb7e6ac9eae3..fc826857a19bab49793d6a4afacbab7ac9cb4f31 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.19-4-1 description: Array.prototype.map throws TypeError if callbackfn is undefined ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.map(); + arr.map(); }); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-4-10.js b/test/built-ins/Array/prototype/map/15.4.4.19-4-10.js index 0b449aa216cae2cf4a3f19ba7239b64c3f2ec06c..74bc391271fbf877c09394143f559d502477e662 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-4-10.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-4-10.js @@ -9,15 +9,18 @@ description: > thrown by step 2 ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - Object.defineProperty(obj, "length", { - get: function () { - throw new Test262Error(); - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + throw new Test262Error(); + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.map.call(obj, undefined); + Array.prototype.map.call(obj, undefined); }); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-4-11.js b/test/built-ins/Array/prototype/map/15.4.4.19-4-11.js index 2c9041b64c9b95cdc16728ea66ddc595aa9774fe..5723ab3ed86092736d212eabc7a38922b3810eff 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-4-11.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-4-11.js @@ -9,19 +9,22 @@ description: > thrown by step 3 ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - throw new Test262Error(); - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + throw new Test262Error(); + } + }; + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.map.call(obj, undefined); + Array.prototype.map.call(obj, undefined); }); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-4-12.js b/test/built-ins/Array/prototype/map/15.4.4.19-4-12.js index 68bc2785587687a3032ae263ca7fc5e1307403ac..45d301f5f426c46c83aa5d54d989fb4f5580150f 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-4-12.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-4-12.js @@ -7,11 +7,11 @@ es5id: 15.4.4.19-4-12 description: Array.prototype.map - 'callbackfn' is a function ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var testResult = [11, 9].map(callbackfn); +var testResult = [11, 9].map(callbackfn); assert.sameValue(testResult.length, 2, 'testResult.length'); assert.sameValue(testResult[0], true, 'testResult[0]'); 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 2d440b206def65bf39860275901cdcc5bc0d9ff4..3df2d5ab4e0005e98d890aebdeb6efc88d74e799 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 @@ -9,26 +9,28 @@ description: > passing undefined for callbackfn ---*/ - var obj = { 10: 10 }; - var lengthAccessed = false; - var loopAccessed = false; +var obj = { + 10: 10 +}; +var lengthAccessed = false; +var loopAccessed = false; - Object.defineProperty(obj, "length", { - get: function () { - lengthAccessed = true; - return 20; - }, - configurable: true - }); - Object.defineProperty(obj, "0", { - get: function () { - loopAccessed = true; - return 10; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + lengthAccessed = true; + return 20; + }, + configurable: true +}); +Object.defineProperty(obj, "0", { + get: function() { + loopAccessed = true; + return 10; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.map.call(obj); + Array.prototype.map.call(obj); }); 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 b239210714657aaf4920c005826fa469ce3b6cfa..1da77da817607c2e8a157e8a971ef3e9e950bc65 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 @@ -9,7 +9,7 @@ description: > unreferenced ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(ReferenceError, function() { - arr.map(foo); + 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 2dd6ecef6abcaadd0473b8ad55bc561754eed65a..d6e5f8d341dba1e4e0afe3cc788be3f0695b830a 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.19-4-3 description: Array.prototype.map throws TypeError if callbackfn is null ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.map(null); + 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 fe5eb72aaad57d3c297cdf6c7af46f92ba2a8ea1..fe8918bfcae531e6247fa072be9c5a9a9f2524dc 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.19-4-4 description: Array.prototype.map throws TypeError if callbackfn is boolean ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.map(true); + 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 0c7a6d5e3625b8717f08ac359df24609af2d8117..b6c230364ad161620ba957f50365ae8b1ce3fe50 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.19-4-5 description: Array.prototype.map throws TypeError if callbackfn is number ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.map(5); + 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 bebc2b0202be1f509c53fed236b4792c411a030d..df6ccdb90d51f128ddada074bb67cf1354a84af2 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.19-4-6 description: Array.prototype.map throws TypeError if callbackfn is string ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.map("abc"); + 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 a52fc2c2beaafd1f4b5fdda97dfb7c8913885f43..d795447cb12e49fd831a98be52e774625936fdc0 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 @@ -9,7 +9,7 @@ description: > without Call internal method ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.map(new Object()); + 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 d9126d50ab21f293f66059d8fce16628b0da6257..f7914a9410d2481c002d6eb4bb4ca66dd8a19395 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 @@ -9,18 +9,21 @@ description: > when an exception occurs ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - accessed = true; - return 2; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + accessed = true; + return 2; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.map.call(obj, null); + Array.prototype.map.call(obj, null); }); 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 5a28ad017819a2834187d3ff440acf76beb30e7f..03ecedcc6a8e6ae0e7efca4554b408dc86b5353c 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 @@ -9,22 +9,25 @@ description: > when an exception occurs ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - accessed = true; - return "2"; - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + accessed = true; + return "2"; + } + }; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.map.call(obj, null); + Array.prototype.map.call(obj, null); }); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-1-s.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-1-s.js index 9132028458c7da69d38822663d3d3bd3135bccbe..a2e997d8b4aa7b3dea1b56ed812ecfd1eaf71b19 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-1-s.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-1-s.js @@ -8,14 +8,14 @@ description: Array.prototype.map - thisArg not passed to strict callbackfn flags: [noStrict] ---*/ - var innerThisCorrect = false; +var innerThisCorrect = false; - function callbackfn(val, idx, obj) { - "use strict"; - innerThisCorrect = this===undefined; - return true; - } +function callbackfn(val, idx, obj) { + "use strict"; + innerThisCorrect = this === undefined; + return true; +} - [1].map(callbackfn); +[1].map(callbackfn); assert(innerThisCorrect, 'innerThisCorrect !== true'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-1.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-1.js index c9e19110cfd767a7fde23dffcb7568f015413a99..a2b7393a98d871d18a81a7c17e2fa69d1aac718c 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-1.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-1.js @@ -8,17 +8,17 @@ description: Array.prototype.map - thisArg not passed flags: [noStrict] ---*/ - this._15_4_4_19_5_1 = true; +this._15_4_4_19_5_1 = true; (function() { - var _15_4_4_19_5_1 = false; + var _15_4_4_19_5_1 = false; - function callbackfn(val, idx, obj) { - return this._15_4_4_19_5_1; - } - var srcArr = [1]; - var resArr = srcArr.map(callbackfn); + function callbackfn(val, idx, obj) { + return this._15_4_4_19_5_1; + } + var srcArr = [1]; + var resArr = srcArr.map(callbackfn); -assert.sameValue(resArr[0], true, 'resArr[0]'); + assert.sameValue(resArr[0], true, 'resArr[0]'); })(); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-10.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-10.js index 04fca72a6a7bfcb7d87e1e30fccb091165b69b9f..a2c4d150b421dc59f342a0f6b6472c4b4855f376 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-10.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-10.js @@ -7,12 +7,12 @@ es5id: 15.4.4.19-5-10 description: Array.prototype.map - Array object can be used as thisArg ---*/ - var objArray = new Array(2); +var objArray = new Array(2); - function callbackfn(val, idx, obj) { - return this === objArray; - } +function callbackfn(val, idx, obj) { + return this === objArray; +} - var testResult = [11].map(callbackfn, objArray); +var testResult = [11].map(callbackfn, objArray); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-11.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-11.js index 945db32b66882c042b89643d2a6a79dd58b608c2..98cd84ad181454bdfe87c09dc45bdaaae951dfcb 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-11.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-11.js @@ -7,12 +7,12 @@ es5id: 15.4.4.19-5-11 description: Array.prototype.map - String object can be used as thisArg ---*/ - var objString = new String(); +var objString = new String(); - function callbackfn(val, idx, obj) { - return this === objString; - } +function callbackfn(val, idx, obj) { + return this === objString; +} - var testResult = [11].map(callbackfn, objString); +var testResult = [11].map(callbackfn, objString); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-12.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-12.js index a6bbce103e9d8f796aafc65057d496afba3c57c9..0fbcf8f7a9ef63691c33dc90a746e4a3c70af34c 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-12.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-12.js @@ -7,12 +7,12 @@ es5id: 15.4.4.19-5-12 description: Array.prototype.map - Boolean object can be used as thisArg ---*/ - var objBoolean = new Boolean(); +var objBoolean = new Boolean(); - function callbackfn(val, idx, obj) { - return this === objBoolean; - } +function callbackfn(val, idx, obj) { + return this === objBoolean; +} - var testResult = [11].map(callbackfn, objBoolean); +var testResult = [11].map(callbackfn, objBoolean); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-13.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-13.js index 23db7ce3a36036f0ad5c5ce17008ddd6c0337372..a02c29a9e026c6afa658dca6e84fb746b9594031 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-13.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-13.js @@ -7,12 +7,12 @@ es5id: 15.4.4.19-5-13 description: Array.prototype.map - Number object can be used as thisArg ---*/ - var objNumber = new Number(); +var objNumber = new Number(); - function callbackfn(val, idx, obj) { - return this === objNumber; - } +function callbackfn(val, idx, obj) { + return this === objNumber; +} - var testResult = [11].map(callbackfn, objNumber); +var testResult = [11].map(callbackfn, objNumber); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-14.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-14.js index a845aa77a07a2f450b51eab328c48178c9957284..01a23927ac179d2effef74a5d44ec87efd0e9633 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-14.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-14.js @@ -7,10 +7,10 @@ es5id: 15.4.4.19-5-14 description: Array.prototype.map - the Math object can be used as thisArg ---*/ - function callbackfn(val, idx, obj) { - return this === Math; - } +function callbackfn(val, idx, obj) { + return this === Math; +} - var testResult = [11].map(callbackfn, Math); +var testResult = [11].map(callbackfn, Math); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-15.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-15.js index 84e7c7b78a87336070e20ff24f8bd6e16118d8fc..9dd98f582241f8e93bc297e0d6022f0ba840935c 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-15.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-15.js @@ -7,12 +7,12 @@ es5id: 15.4.4.19-5-15 description: Array.prototype.map - Date object can be used as thisArg ---*/ - var objDate = new Date(); +var objDate = new Date(); - function callbackfn(val, idx, obj) { - return this === objDate; - } +function callbackfn(val, idx, obj) { + return this === objDate; +} - var testResult = [11].map(callbackfn, objDate); +var testResult = [11].map(callbackfn, objDate); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-16.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-16.js index b7a7384274b213dbb9b5b615f8261e58b49ef9f4..f34254d011b20485cc74f43f23e2ad88ddb8e21c 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-16.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-16.js @@ -7,12 +7,12 @@ es5id: 15.4.4.19-5-16 description: Array.prototype.map - RegExp object can be used as thisArg ---*/ - var objRegExp = new RegExp(); +var objRegExp = new RegExp(); - function callbackfn(val, idx, obj) { - return this === objRegExp; - } +function callbackfn(val, idx, obj) { + return this === objRegExp; +} - var testResult = [11].map(callbackfn, objRegExp); +var testResult = [11].map(callbackfn, objRegExp); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-17.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-17.js index acc8b9d40822628167b92fdae3f7d83ef07549b9..42d67bbeff2800af682b22fb923eabc7a9250840 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-17.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-17.js @@ -7,10 +7,10 @@ es5id: 15.4.4.19-5-17 description: Array.prototype.map - the JSON object can be used as thisArg ---*/ - function callbackfn(val, idx, obj) { - return this === JSON; - } +function callbackfn(val, idx, obj) { + return this === JSON; +} - var testResult = [11].map(callbackfn, JSON); +var testResult = [11].map(callbackfn, JSON); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-18.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-18.js index 9b65b9c5b9d38ddb2c2fd43b545a3b939b634796..e3032b4f47631770197ec8e6b6108d0e08159054 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-18.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-18.js @@ -7,12 +7,12 @@ es5id: 15.4.4.19-5-18 description: Array.prototype.map - Error object can be used as thisArg ---*/ - var objError = new RangeError(); +var objError = new RangeError(); - function callbackfn(val, idx, obj) { - return this === objError; - } +function callbackfn(val, idx, obj) { + return this === objError; +} - var testResult = [11].map(callbackfn, objError); +var testResult = [11].map(callbackfn, objError); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-19.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-19.js index 2da89ea4f2ac13c5ee4dc356e5a12c85e3076a10..c2740c110bdfe5156f946ce7c9507714ac0b89d3 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-19.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-19.js @@ -7,16 +7,16 @@ es5id: 15.4.4.19-5-19 description: Array.prototype.map - the Arguments object can be used as thisArg ---*/ - var arg; +var arg; - function callbackfn(val, idx, obj) { - return this === arg; - } +function callbackfn(val, idx, obj) { + return this === arg; +} - arg = (function () { - return arguments; - }(1, 2, 3)); +arg = (function() { + return arguments; +}(1, 2, 3)); - var testResult = [11].map(callbackfn, arg); +var testResult = [11].map(callbackfn, arg); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-2.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-2.js index 6bbeebe523da49cc8e897ed43642265e596c5168..fdb667af1b811e9433b7bd45643a6587cc88f29c 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-2.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-2.js @@ -7,15 +7,16 @@ es5id: 15.4.4.19-5-2 description: Array.prototype.map - thisArg is Object ---*/ - var res = false; - var o = new Object(); - o.res = true; - function callbackfn(val, idx, obj) - { - return this.res; - } +var res = false; +var o = new Object(); +o.res = true; - var srcArr = [1]; - var resArr = srcArr.map(callbackfn,o); +function callbackfn(val, idx, obj) +{ + return this.res; +} + +var srcArr = [1]; +var resArr = srcArr.map(callbackfn, o); assert.sameValue(resArr[0], true, 'resArr[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-21.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-21.js index f101b1660eff0ef8aa8d3616b15594c9a7d5eaf1..0f105c52cec480c6690596c0c9ca2968a24b6ddd 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-21.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-21.js @@ -8,10 +8,11 @@ description: Array.prototype.map - the global object can be used as thisArg ---*/ var global = this; - function callbackfn(val, idx, obj) { - return this === global; - } - var testResult = [11].map(callbackfn, this); +function callbackfn(val, idx, obj) { + return this === global; +} + +var testResult = [11].map(callbackfn, this); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-22.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-22.js index 9ef42b64e2624d0e25546cfaf39136cc7e7571a7..1386aa749304ac5dd1bc055e0634fadd89131c0a 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-22.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-22.js @@ -7,10 +7,10 @@ es5id: 15.4.4.19-5-22 description: Array.prototype.map - boolean primitive can be used as thisArg ---*/ - function callbackfn(val, idx, obj) { - return this.valueOf() === false; - } +function callbackfn(val, idx, obj) { + return this.valueOf() === false; +} - var testResult = [11].map(callbackfn, false); +var testResult = [11].map(callbackfn, false); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-23.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-23.js index 29f99094ab2b3e70f98e5f76f84e9ec6e4e476ae..8e7ee98356441b6b27486823bf00ef26f697e188 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-23.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-23.js @@ -7,10 +7,10 @@ es5id: 15.4.4.19-5-23 description: Array.prototype.map - number primitive can be used as thisArg ---*/ - function callbackfn(val, idx, obj) { - return this.valueOf() === 101; - } +function callbackfn(val, idx, obj) { + return this.valueOf() === 101; +} - var testResult = [11].map(callbackfn, 101); +var testResult = [11].map(callbackfn, 101); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-24.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-24.js index 292dca579adba591b19a70d766bc029239bae978..cb29707e65b0c511bf63ac57331729385c124c0e 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-24.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-24.js @@ -7,10 +7,10 @@ es5id: 15.4.4.19-5-24 description: Array.prototype.map - string primitive can be used as thisArg ---*/ - function callbackfn(val, idx, obj) { - return this.valueOf() === "abc"; - } +function callbackfn(val, idx, obj) { + return this.valueOf() === "abc"; +} - var testResult = [11].map(callbackfn, "abc"); +var testResult = [11].map(callbackfn, "abc"); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-3.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-3.js index 08e3e062b482cf03c7e00cd575640c7e9ec481f7..97dd1e7280088d548c7631b9f0d7b824d9ceb731 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-3.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-3.js @@ -7,15 +7,16 @@ es5id: 15.4.4.19-5-3 description: Array.prototype.map - thisArg is Array ---*/ - var res = false; - var a = new Array(); - a.res = true; - function callbackfn(val, idx, obj) - { - return this.res; - } +var res = false; +var a = new Array(); +a.res = true; - var srcArr = [1]; - var resArr = srcArr.map(callbackfn,a); +function callbackfn(val, idx, obj) +{ + return this.res; +} + +var srcArr = [1]; +var resArr = srcArr.map(callbackfn, a); assert.sameValue(resArr[0], true, 'resArr[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-4.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-4.js index 36c4c36ff32b406079aafbafe9d0c36ed6e55284..85ee3deec963dfe2eaca5e961672e16df718ea51 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-4.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-4.js @@ -9,17 +9,18 @@ description: > template(prototype) ---*/ - var res = false; - function callbackfn(val, idx, obj) - { - return this.res; - } +var res = false; - function foo(){} - foo.prototype.res = true; - var f = new foo(); +function callbackfn(val, idx, obj) +{ + return this.res; +} - var srcArr = [1]; - var resArr = srcArr.map(callbackfn,f); +function foo() {} +foo.prototype.res = true; +var f = new foo(); + +var srcArr = [1]; +var resArr = srcArr.map(callbackfn, f); assert.sameValue(resArr[0], true, 'resArr[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-5.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-5.js index 2e116854993ace05a7600a4abd3015a3c1dff62a..9568cc3d490b1be7a6c04837a18dde370debc86e 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-5.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-5.js @@ -7,17 +7,18 @@ es5id: 15.4.4.19-5-5 description: Array.prototype.map - thisArg is object from object template ---*/ - var res = false; - function callbackfn(val, idx, obj) - { - return this.res; - } +var res = false; - function foo(){} - var f = new foo(); - f.res = true; +function callbackfn(val, idx, obj) +{ + return this.res; +} - var srcArr = [1]; - var resArr = srcArr.map(callbackfn,f); +function foo() {} +var f = new foo(); +f.res = true; + +var srcArr = [1]; +var resArr = srcArr.map(callbackfn, f); assert.sameValue(resArr[0], true, 'resArr[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-6.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-6.js index 8950f71db641eb0a2f4e98117a27460926beb748..20366e19c6ded04b9b02cbe04f65342dc01743aa 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-6.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-6.js @@ -7,16 +7,17 @@ es5id: 15.4.4.19-5-6 description: Array.prototype.map - thisArg is function ---*/ - var res = false; - function callbackfn(val, idx, obj) - { - return this.res; - } +var res = false; - function foo(){} - foo.res = true; +function callbackfn(val, idx, obj) +{ + return this.res; +} - var srcArr = [1]; - var resArr = srcArr.map(callbackfn,foo); +function foo() {} +foo.res = true; + +var srcArr = [1]; +var resArr = srcArr.map(callbackfn, foo); assert.sameValue(resArr[0], true, 'resArr[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-7.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-7.js index 7bd84eb5917ce2d001a107acb1ab0088a1e89f6a..7f11fa6764d94bf3a670bcc824121798f566a9c2 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-7.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-7.js @@ -7,10 +7,10 @@ es5id: 15.4.4.19-5-7 description: Array.prototype.map - built-in functions can be used as thisArg ---*/ - function callbackfn(val, idx, obj) { - return this === eval; - } +function callbackfn(val, idx, obj) { + return this === eval; +} - var testResult = [11].map(callbackfn, eval); +var testResult = [11].map(callbackfn, eval); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-9.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-9.js index 247bfb3c392c9d00d5a54931e2bc2695f33b3fa1..31f536819cd5e8f5d47eae242b78e74a9e3d1433 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-9.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-9.js @@ -7,12 +7,12 @@ es5id: 15.4.4.19-5-9 description: Array.prototype.map - Function object can be used as thisArg ---*/ - var objFunction = function () { }; +var objFunction = function() {}; - function callbackfn(val, idx, obj) { - return this === objFunction; - } +function callbackfn(val, idx, obj) { + return this === objFunction; +} - var testResult = [11].map(callbackfn, objFunction); +var testResult = [11].map(callbackfn, objFunction); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-6-1.js b/test/built-ins/Array/prototype/map/15.4.4.19-6-1.js index 2c86c43b8c8bde46ab1a527136b12240144b2348..b72e54a44a767f0bb3a4970eb7a27f41e5a67dc8 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-6-1.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-6-1.js @@ -9,6 +9,6 @@ description: > argument is the ourput array ---*/ - var newArr = [11].map(function () { }); +var newArr = [11].map(function() {}); assert(Array.isArray(newArr), 'Array.isArray(newArr) !== true'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-6-2.js b/test/built-ins/Array/prototype/map/15.4.4.19-6-2.js index 1acfec147fe1a88967bbea70f1ba757f05bcd720..593496d8516239314f413fddb1c9b69639f965bc 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-6-2.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-6-2.js @@ -7,6 +7,6 @@ es5id: 15.4.4.19-6-2 description: Array.prototype.map - the returned array is instanceof Array ---*/ - var newArr = [11].map(function () { }); +var newArr = [11].map(function() {}); assert(newArr instanceof Array, 'newArr instanceof Array !== true'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-1.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-1.js index eeb0830e84d6b543b9452001de5468ca8fe2709b..07255dc87f8de288087439871b44ab8f33971710 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-1.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-1.js @@ -9,14 +9,14 @@ description: > after it is called ---*/ - function callbackfn(val, idx, obj) - { - srcArr[2] = 3; - srcArr[5] = 6; - return 1; - } +function callbackfn(val, idx, obj) +{ + srcArr[2] = 3; + srcArr[5] = 6; + return 1; +} - var srcArr = [1,2,,4,5]; - var resArr = srcArr.map(callbackfn); +var srcArr = [1, 2, , 4, 5]; +var resArr = srcArr.map(callbackfn); assert.sameValue(resArr.length, 5, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-2.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-2.js index f1bbd8be5dd32415facaf9adf7e5e5be97e603f5..17ff67f93e2cf600eee46aa7430720c2feabe373 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-2.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-2.js @@ -9,17 +9,17 @@ description: > it is called ---*/ - function callbackfn(val, idx, obj) - { - srcArr[4] = -1; - if(val > 0) - return 1; - else - return 0; - } +function callbackfn(val, idx, obj) +{ + srcArr[4] = -1; + if (val > 0) + return 1; + else + return 0; +} - var srcArr = [1,2,3,4,5]; - var resArr = srcArr.map(callbackfn); +var srcArr = [1, 2, 3, 4, 5]; +var resArr = srcArr.map(callbackfn); assert.sameValue(resArr.length, 5, 'resArr.length'); assert.sameValue(resArr[4], 0, 'resArr[4]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-3.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-3.js index 3b6e5a675e405d7c225076fbb71f53e8f4c083a7..10ef81567fc70dd9beb6ef291690d73dc32b1ebf 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-3.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-3.js @@ -9,18 +9,18 @@ description: > the call ---*/ - function callbackfn(val, idx, obj) - { - delete srcArr[4]; - if(val > 0) - return 1; - else - return 0; +function callbackfn(val, idx, obj) +{ + delete srcArr[4]; + if (val > 0) + return 1; + else + return 0; - } +} - var srcArr = [1,2,3,4,5]; - var resArr = srcArr.map(callbackfn); +var srcArr = [1, 2, 3, 4, 5]; +var resArr = srcArr.map(callbackfn); assert.sameValue(resArr.length, 5, 'resArr.length'); assert.sameValue(resArr[4], undefined, 'resArr[4]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-4.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-4.js index 5962cdd901d0350ebc3337d965d6f1174e79c231..e488c814941ffdac4702b8a5138f0e0e65bdd780 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-4.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-4.js @@ -9,16 +9,17 @@ description: > Array.length is decreased ---*/ - var callCnt = 0; - function callbackfn(val, idx, obj) - { - srcArr.length = 2; - callCnt++; - return 1; - } +var callCnt = 0; - var srcArr = [1,2,3,4,5]; - var resArr = srcArr.map(callbackfn); +function callbackfn(val, idx, obj) +{ + srcArr.length = 2; + callCnt++; + return 1; +} + +var srcArr = [1, 2, 3, 4, 5]; +var resArr = srcArr.map(callbackfn); assert.sameValue(resArr.length, 5, 'resArr.length'); assert.sameValue(callCnt, 2, 'callCnt'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-5.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-5.js index 85747416a144f9da85cdf0f1ce29962e52fad3ca..969ef76b088cd277aafe9b250cf6f87f49d63f7c 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-5.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-5.js @@ -9,18 +9,19 @@ description: > sparse array ---*/ - var callCnt = 0; - function callbackfn(val, idx, obj) - { - srcArr[1000] = 3; - callCnt++; - return val; - } +var callCnt = 0; - var srcArr = new Array(10); - srcArr[1] = 1; - srcArr[2] = 2; - var resArr = srcArr.map(callbackfn); +function callbackfn(val, idx, obj) +{ + srcArr[1000] = 3; + callCnt++; + return val; +} + +var srcArr = new Array(10); +srcArr[1] = 1; +srcArr[2] = 2; +var resArr = srcArr.map(callbackfn); assert.sameValue(resArr.length, 10, 'resArr.length'); assert.sameValue(callCnt, 2, 'callCnt'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-6.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-6.js index 131558eb445c0c96aef31014477d75265fbee7a9..1a3d4c17556e51d9ddbbb70d4d0e926e7a0324e7 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-6.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-6.js @@ -9,20 +9,20 @@ description: > when same index is also present in prototype ---*/ - function callbackfn(val, idx, obj) - { - delete srcArr[4]; - if(val > 0) - return 1; - else - return 0; +function callbackfn(val, idx, obj) +{ + delete srcArr[4]; + if (val > 0) + return 1; + else + return 0; - } +} - Array.prototype[4] = 5; - var srcArr = [1,2,3,4,5]; - var resArr = srcArr.map(callbackfn); - delete Array.prototype[4]; +Array.prototype[4] = 5; +var srcArr = [1, 2, 3, 4, 5]; +var resArr = srcArr.map(callbackfn); +delete Array.prototype[4]; assert.sameValue(resArr.length, 5, 'resArr.length'); assert.sameValue(resArr[4], 1, 'resArr[4]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-7.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-7.js index 02da272f15b23f24b55dd0b9f29b16277c7b5fda..537e153f5c871973117a50eea46e0138467ae7ad 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-7.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-7.js @@ -7,18 +7,18 @@ es5id: 15.4.4.19-8-7 description: Array.prototype.map successful to delete the object in callbackfn ---*/ - var obj = {}; - obj.srcArr = [1, 2, 3, 4, 5]; +var obj = {}; +obj.srcArr = [1, 2, 3, 4, 5]; - function callbackfn(val, idx, obj) { - delete obj.srcArr; - if (val > 0) - return 1; - else - return 0; - } +function callbackfn(val, idx, obj) { + delete obj.srcArr; + if (val > 0) + return 1; + else + return 0; +} - var resArr = obj.srcArr.map(callbackfn); +var resArr = obj.srcArr.map(callbackfn); assert.sameValue(resArr.toString(), "1,1,1,1,1", 'resArr.toString()'); assert.sameValue(obj.hasOwnProperty("arr"), false, 'obj.hasOwnProperty("arr")'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-8.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-8.js index 6b3d7146d6ad222083bfc20e88a1c2d4bd6733ee..0a9f95ed4bbf02416d5c1dc5a81c77236e3b62a1 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-8.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-8.js @@ -9,15 +9,20 @@ description: > on an Array-like object ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +var accessed = false; - var obj = { 0: 11, 1: 12, length: 0 }; +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var testResult = Array.prototype.map.call(obj, callbackfn); +var obj = { + 0: 11, + 1: 12, + length: 0 +}; + +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult.length, 0, 'testResult.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-9.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-9.js index 397d7a9ff52cae8808bed5b18d5fe906ab9f0a3f..5f47a3a63ab037cab04612c7aa1471d9917388c4 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-9.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-9.js @@ -9,23 +9,24 @@ description: > of iterations on an Array ---*/ - var called = 0; - function callbackfn(val, idx, obj) { - called += 1; - return val > 10; - } +var called = 0; - var arr = [9, , 12]; +function callbackfn(val, idx, obj) { + called += 1; + return val > 10; +} - Object.defineProperty(arr, "1", { - get: function () { - arr.length = 2; - return 8; - }, - configurable: true - }); +var arr = [9, , 12]; - var testResult = arr.map(callbackfn); +Object.defineProperty(arr, "1", { + get: function() { + arr.length = 2; + return 8; + }, + configurable: true +}); + +var testResult = arr.map(callbackfn); assert.sameValue(testResult.length, 3, 'testResult.length'); assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-1.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-1.js index 1c9aa86a7e69c34391774518220afc2bdeb6c870..ff4a57e8ae93728d3e114eb402c5546590399e48 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-1.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-1.js @@ -9,16 +9,17 @@ description: > assigned values ---*/ - var callCnt = 0; - function callbackfn(val, idx, obj) - { - callCnt++; - return 1; - } +var callCnt = 0; - var srcArr = new Array(10); - srcArr[1] = undefined; //explicitly assigning a value - var resArr = srcArr.map(callbackfn); +function callbackfn(val, idx, obj) +{ + callCnt++; + return 1; +} + +var srcArr = new Array(10); +srcArr[1] = undefined; //explicitly assigning a value +var resArr = srcArr.map(callbackfn); assert.sameValue(resArr.length, 10, 'resArr.length'); assert.sameValue(callCnt, 1, 'callCnt'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-10.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-10.js index 040c0b852c0288ea8d3b9bf1036d1ed7af3bed98..18ef426fb6340c338923c19f5a02629da6d8d6da 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-10.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-10.js @@ -9,21 +9,24 @@ description: > prototype index property not to be visited on an Array-like Object ---*/ - function callbackfn(val, idx, obj) { - return idx === 1 && typeof val === "undefined"; - } - var obj = { 2: 2, length: 20 }; +function callbackfn(val, idx, obj) { + return idx === 1 && typeof val === "undefined"; +} +var obj = { + 2: 2, + length: 20 +}; - Object.defineProperty(obj, "0", { - get: function () { - delete Object.prototype[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + delete Object.prototype[1]; + return 0; + }, + configurable: true +}); - Object.prototype[1] = 1; - var testResult = Array.prototype.map.call(obj, callbackfn); +Object.prototype[1] = 1; +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult.length, 20, 'testResult.length'); assert.sameValue(typeof testResult[1], "undefined", 'typeof testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-11.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-11.js index 58fccded06ae790df2916e42581deec1b98b5ac3..d194b572bf1757ec810ded31c21f13931464a005 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-11.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-11.js @@ -9,21 +9,21 @@ description: > prototype index property not to be visited on an Array ---*/ - function callbackfn(val, idx, obj) { - return idx === 1 && typeof val === "undefined"; - } - var arr = [0, , 2]; +function callbackfn(val, idx, obj) { + return idx === 1 && typeof val === "undefined"; +} +var arr = [0, , 2]; - Object.defineProperty(arr, "0", { - get: function () { - delete Array.prototype[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete Array.prototype[1]; + return 0; + }, + configurable: true +}); - Array.prototype[1] = 1; - var testResult = arr.map(callbackfn); +Array.prototype[1] = 1; +var testResult = arr.map(callbackfn); assert.sameValue(testResult.length, 3, 'testResult.length'); assert.sameValue(typeof testResult[1], "undefined", 'typeof testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-12.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-12.js index 0f5e4fc68d1369130bc8414d4c6e58b64f4ed00a..8d6fd84c8c10fdd8c796f6b5c809c864b3508955 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-12.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-12.js @@ -10,24 +10,29 @@ description: > Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 3) { - return false; - } else { - return true; - } - } - var obj = { 0: 0, 1: 1, 2: 2, length: 10 }; +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 3) { + return false; + } else { + return true; + } +} +var obj = { + 0: 0, + 1: 1, + 2: 2, + length: 10 +}; - Object.defineProperty(obj, "0", { - get: function () { - delete obj[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + delete obj[1]; + return 0; + }, + configurable: true +}); - Object.prototype[1] = 3; - var testResult = Array.prototype.map.call(obj, callbackfn); +Object.prototype[1] = 3; +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult[1], false, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-13.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-13.js index f510e09e24e86e3a2a7cd4e30dab974da27ca9f3..7cea73c7353a96d145c0be9a05db203293bf04bc 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-13.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-13.js @@ -9,24 +9,24 @@ description: > property causes prototype index property to be visited on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 3) { - return false; - } else { - return true; - } - } - var arr = [0, 1, 2]; +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 3) { + return false; + } else { + return true; + } +} +var arr = [0, 1, 2]; - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); - Array.prototype[1] = 3; - var testResult = arr.map(callbackfn); +Array.prototype[1] = 3; +var testResult = arr.map(callbackfn); assert.sameValue(testResult[1], false, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-14.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-14.js index ddef903df1946064afe1996964c71976d5a8f5a1..45131bd9a535d81c21eb107c6b92efb8f1a59d0d 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-14.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-14.js @@ -9,20 +9,20 @@ description: > property not to be visited ---*/ - function callbackfn(val, idx, obj) { - return idx === 3 && typeof val === "undefined"; - } +function callbackfn(val, idx, obj) { + return idx === 3 && typeof val === "undefined"; +} - var arr = [0, 1, 2, "last"]; +var arr = [0, 1, 2, "last"]; - Object.defineProperty(arr, "0", { - get: function () { - arr.length = 3; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + arr.length = 3; + return 0; + }, + configurable: true +}); - var testResult = arr.map(callbackfn); +var testResult = arr.map(callbackfn); assert.sameValue(typeof testResult[3], "undefined", 'typeof testResult[3]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-15.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-15.js index 1ed9f5ad34360f326ada03850322ecec48f76096..2cf1762a52348872d09c17612e7bede8f71f8f6e 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-15.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-15.js @@ -9,31 +9,31 @@ description: > property causes prototype index property to be visited ---*/ - function callbackfn(val, idx, obj) { - if (idx === 2 && val === "prototype") { - return false; - } else { - return true; - } - } - var arr = [0, 1, 2]; +function callbackfn(val, idx, obj) { + if (idx === 2 && val === "prototype") { + return false; + } else { + return true; + } +} +var arr = [0, 1, 2]; - Object.defineProperty(Array.prototype, "2", { - get: function () { - return "prototype"; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "2", { + get: function() { + return "prototype"; + }, + configurable: true +}); - Object.defineProperty(arr, "1", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); - var testResult = arr.map(callbackfn); +var testResult = arr.map(callbackfn); assert.sameValue(testResult.length, 3, 'testResult.length'); assert.sameValue(testResult[2], false, 'testResult[2]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-16.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-16.js index b12e1aab05232ea229b216558461981c7d940f19..5e5290fddaf2c674efed9b0b1b4335c40575610c 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-16.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-16.js @@ -10,32 +10,32 @@ description: > flags: [noStrict] ---*/ - function callbackfn(val, idx, obj) { - if (idx === 2 && val === "unconfigurable") { - return false; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 2 && val === "unconfigurable") { + return false; + } else { + return true; + } +} - var arr = [0, 1, 2]; +var arr = [0, 1, 2]; - Object.defineProperty(arr, "2", { - get: function () { - return "unconfigurable"; - }, - configurable: false - }); +Object.defineProperty(arr, "2", { + get: function() { + return "unconfigurable"; + }, + configurable: false +}); - Object.defineProperty(arr, "1", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); - var testResult = arr.map(callbackfn); +var testResult = arr.map(callbackfn); assert.sameValue(testResult.length, 3, 'testResult.length'); assert.sameValue(testResult[2], false, 'testResult[2]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-2.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-2.js index bc701853645dfaf6397164a29235c7d863de1336..74108f0927b72db24d9850a6b8cf6332af6c8acf 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-2.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-2.js @@ -7,24 +7,24 @@ es5id: 15.4.4.19-8-b-2 description: Array.prototype.map - added properties in step 2 are visible here ---*/ - function callbackfn(val, idx, obj) { - if (idx === 2 && val === "length") { - return false; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 2 && val === "length") { + return false; + } else { + return true; + } +} - var obj = {}; +var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - obj[2] = "length"; - return 3; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + obj[2] = "length"; + return 3; + }, + configurable: true +}); - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult[2], false, 'testResult[2]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-3.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-3.js index 1377383e1575d54ddc1304a8419fe8f28ead2fa5..957b9048a10e2cd780f7ba10db23da73ac5a524c 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-3.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-3.js @@ -7,23 +7,26 @@ es5id: 15.4.4.19-8-b-3 description: Array.prototype.map - deleted properties in step 2 are visible here ---*/ - function callbackfn(val, idx, obj) { - if (idx === 2) { - return false; - } else { - return true; - } - } - var obj = { 2: 6.99, 8: 19 }; +function callbackfn(val, idx, obj) { + if (idx === 2) { + return false; + } else { + return true; + } +} +var obj = { + 2: 6.99, + 8: 19 +}; - Object.defineProperty(obj, "length", { - get: function () { - delete obj[2]; - return 10; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + delete obj[2]; + return 10; + }, + configurable: true +}); - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(typeof testResult[2], "undefined", 'typeof testResult[2]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-4.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-4.js index 8e166666d5e29ecaecd44a13b47a2ab5f89c5820..bf1e739fbb9eafc21f690336a38f019c7f94caaa 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-4.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-4.js @@ -9,30 +9,32 @@ description: > current position are visited on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 1) { - return false; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 1) { + return false; + } else { + return true; + } +} - var obj = { length: 2 }; +var obj = { + length: 2 +}; - Object.defineProperty(obj, "0", { - get: function () { - Object.defineProperty(obj, "1", { - get: function () { - return 1; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + Object.defineProperty(obj, "1", { + get: function() { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); assert.sameValue(testResult[1], false, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-5.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-5.js index a380501440b644f7a3ed506b86626833942aa9c7..c0ca4d25913a9988c7cd143f7e5837110ab5ba3d 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-5.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-5.js @@ -9,30 +9,30 @@ description: > current position are visited on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 1) { - return false; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 1) { + return false; + } else { + return true; + } +} - var arr = [0, , 2]; +var arr = [0, , 2]; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(arr, "1", { - get: function () { - return 1; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(arr, "1", { + get: function() { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - var testResult = arr.map(callbackfn); +var testResult = arr.map(callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); assert.sameValue(testResult[1], false, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-6.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-6.js index 2f12f0c1e1f339f91c3da6ef6884a566b10c6293..6f983455ee1c28c48309ec26b62adc17d9b7842f 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-6.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-6.js @@ -9,29 +9,31 @@ description: > current position are visited on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 6.99) { - return false; - } else { - return true; - } - } - var obj = { length: 2 }; +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 6.99) { + return false; + } else { + return true; + } +} +var obj = { + length: 2 +}; - Object.defineProperty(obj, "0", { - get: function () { - Object.defineProperty(Object.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + Object.defineProperty(Object.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); assert.sameValue(testResult[1], false, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-7.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-7.js index fe1b0998cbb364573089ccf93322ebcf3868a7a1..5e40ddb27318dbf944fb990fbf6bb0c3b6420d3b 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-7.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-7.js @@ -9,29 +9,29 @@ description: > current position are visited on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 6.99) { - return false; - } else { - return true; - } - } - var arr = [0, , 2]; +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 6.99) { + return false; + } else { + return true; + } +} +var arr = [0, , 2]; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(Array.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(Array.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - var testResult = arr.map(callbackfn); +var testResult = arr.map(callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); assert.sameValue(testResult[1], false, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-8.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-8.js index 1dd61b31e2c51527e507a16659d457d40da7a3f0..58f3ac9c18895b894c0ae4e3961b7c7a3c5bad4d 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-8.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-8.js @@ -9,31 +9,33 @@ description: > not to be visited on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1) { - return false; - } else { - return true; - } - } - var obj = { length: 2 }; +function callbackfn(val, idx, obj) { + if (idx === 1) { + return false; + } else { + return true; + } +} +var obj = { + length: 2 +}; - Object.defineProperty(obj, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + return 6.99; + }, + configurable: true +}); - Object.defineProperty(obj, "0", { - get: function () { - delete obj[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + delete obj[1]; + return 0; + }, + configurable: true +}); - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); assert.sameValue(typeof testResult[1], "undefined", 'typeof testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-9.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-9.js index 1d0cc76407246ed7ff93096a451db9548aa6ad40..a1dd861f20cb2304229cc31c141fda3b3eab19c2 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-9.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-9.js @@ -9,31 +9,31 @@ description: > not to be visited on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1) { - return false; - } else { - return true; - } - } - var arr = [1, 2]; +function callbackfn(val, idx, obj) { + if (idx === 1) { + return false; + } else { + return true; + } +} +var arr = [1, 2]; - Object.defineProperty(arr, "1", { - get: function () { - return "6.99"; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + return "6.99"; + }, + configurable: true +}); - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); - var testResult = arr.map(callbackfn); +var testResult = arr.map(callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); assert.sameValue(typeof testResult[1], "undefined", 'typeof testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-1.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-1.js index 8543d0ead620681c9642702b5e91e053fc7e31ed..16b3fe32611031ac1ece401649360b71e36d12be 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-1.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-1.js @@ -9,17 +9,20 @@ description: > on an Array-like object ---*/ - var kValue = {}; +var kValue = {}; - function callbackfn(val, idx, obj) { - if (idx === 5) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 5) { + return val === kValue; + } + return false; +} - var obj = { 5: kValue, length: 100 }; +var obj = { + 5: kValue, + length: 100 +}; - var newArr = Array.prototype.map.call(obj, callbackfn); +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr[5], true, 'newArr[5]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-10.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-10.js index ccf8d3fbd2dc6d4933aad0c61b1f2cb2b5182b2e..f9809a1a5834945ee8d497a7cc6e6383130f96a0 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-10.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-10.js @@ -9,24 +9,24 @@ description: > property on an Array ---*/ - var kValue = "abc"; +var kValue = "abc"; - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; +} - var arr = []; +var arr = []; - Object.defineProperty(arr, "0", { - get: function () { - return kValue; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + return kValue; + }, + configurable: true +}); - var testResult = arr.map(callbackfn); +var testResult = arr.map(callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-11.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-11.js index 5e8f0eba5a2e26ffc7811a95766b7990e15a5c0e..db7bfa03d375ae6ff3fd35aa8327930746f7fff1 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-11.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-11.js @@ -10,29 +10,32 @@ description: > Array-like object ---*/ - var kValue = "abc"; +var kValue = "abc"; - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; +} - var proto = { 0: 5, length: 2 }; +var proto = { + 0: 5, + length: 2 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); +var child = new Con(); - Object.defineProperty(child, "0", { - get: function () { - return kValue; - }, - configurable: true - }); +Object.defineProperty(child, "0", { + get: function() { + return kValue; + }, + configurable: true +}); - var testResult = Array.prototype.map.call(child, callbackfn); +var testResult = Array.prototype.map.call(child, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-12.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-12.js index b233477370b0238e04cfb99ca9f756a843cc176e..9f61f72be72f82afc536b20f233b9b00a3ab2ba3 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-12.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-12.js @@ -9,26 +9,26 @@ description: > property that overrides an inherited data property on an Array ---*/ - var kValue = "abc"; +var kValue = "abc"; - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; +} - var arr = []; +var arr = []; - Array.prototype[0] = 11; +Array.prototype[0] = 11; - Object.defineProperty(arr, "0", { - get: function () { - return kValue; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + return kValue; + }, + configurable: true +}); - var testResult = arr.map(callbackfn); +var testResult = arr.map(callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-13.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-13.js index 47c8e86c5d26aff13b173ea572d5e97d7c8bf4b3..3ca3d54de96bf3e675dcb604f7f0edd39c8d955d 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-13.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-13.js @@ -10,36 +10,38 @@ description: > Array-like object ---*/ - var kValue = "abc"; - - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === kValue; - } - return false; - } - - var proto = { length: 2 }; - - Object.defineProperty(proto, "0", { - get: function () { - return 5; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - - Object.defineProperty(child, "0", { - get: function () { - return kValue; - }, - configurable: true - }); - - var testResult = Array.prototype.map.call(child, callbackfn); +var kValue = "abc"; + +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; +} + +var proto = { + length: 2 +}; + +Object.defineProperty(proto, "0", { + get: function() { + return 5; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); + +Object.defineProperty(child, "0", { + get: function() { + return kValue; + }, + configurable: true +}); + +var testResult = Array.prototype.map.call(child, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-14.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-14.js index 57580015db728e6164d2913311480c3abb9215a0..148bf9dbcbc73bd620ec41a80a3c357e5f0c4551 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-14.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-14.js @@ -9,31 +9,31 @@ description: > property that overrides an inherited accessor property on an Array ---*/ - var kValue = "abc"; - - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === kValue; - } - return false; - } - - var arr = []; - - Object.defineProperty(Array.prototype, "0", { - get: function () { - return 11; - }, - configurable: true - }); - - Object.defineProperty(arr, "0", { - get: function () { - return kValue; - }, - configurable: true - }); - - var testResult = arr.map(callbackfn); +var kValue = "abc"; + +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; +} + +var arr = []; + +Object.defineProperty(Array.prototype, "0", { + get: function() { + return 11; + }, + configurable: true +}); + +Object.defineProperty(arr, "0", { + get: function() { + return kValue; + }, + configurable: true +}); + +var testResult = arr.map(callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-15.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-15.js index ada617c65bab523392cc3f2513e956b3d4714d9e..590dbe8bd05641e4513714aac5abdc426f6de980 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-15.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-15.js @@ -9,29 +9,31 @@ description: > accessor property on an Array-like object ---*/ - var kValue = "abc"; +var kValue = "abc"; - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; +} - var proto = { length: 2 }; +var proto = { + length: 2 +}; - Object.defineProperty(proto, "0", { - get: function () { - return kValue; - }, - configurable: true - }); +Object.defineProperty(proto, "0", { + get: function() { + return kValue; + }, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); +var child = new Con(); - var testResult = Array.prototype.map.call(child, callbackfn); +var testResult = Array.prototype.map.call(child, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-16.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-16.js index 78714aeabb7c98f2392ce9284c3abf95ebaa19e3..8be14c2d2957bc0db8ce02a4de76e32c626a7a74 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-16.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-16.js @@ -9,22 +9,22 @@ description: > accessor property on an Array ---*/ - var kValue = "abc"; +var kValue = "abc"; - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; +} - Object.defineProperty(Array.prototype, "0", { - get: function () { - return kValue; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return kValue; + }, + configurable: true +}); - var testResult = [, ].map(callbackfn); +var testResult = [, ].map(callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-17.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-17.js index 2e3f9f98726ff77a560fb5d3b7aea3fb09306229..9c0a96b09a082919a1c09eb5bc4dd6f1602eb020 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-17.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-17.js @@ -9,20 +9,22 @@ description: > property without a get function on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1) { - return typeof val === "undefined"; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + return typeof val === "undefined"; + } + return false; +} - var obj = { length: 2 }; +var obj = { + length: 2 +}; - Object.defineProperty(obj, "1", { - set: function () { }, - configurable: true - }); +Object.defineProperty(obj, "1", { + set: function() {}, + configurable: true +}); - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult[1], true, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-18.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-18.js index fda5968c70eb004a91b4cd464f6fec069773361e..142b2878daf144f030addee514e119e98716a38a 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-18.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-18.js @@ -9,20 +9,20 @@ description: > property without a get function on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1) { - return typeof val === "undefined"; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + return typeof val === "undefined"; + } + return false; +} - var arr = []; +var arr = []; - Object.defineProperty(arr, "1", { - set: function () { }, - configurable: true - }); +Object.defineProperty(arr, "1", { + set: function() {}, + configurable: true +}); - var testResult = arr.map(callbackfn); +var testResult = arr.map(callbackfn); assert.sameValue(testResult[1], true, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-19.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-19.js index 7589e4c132cf6824ac71687f9beab9d1615bcf47..f20dbc09850b2516c4774c4119634b07083b5193 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-19.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-19.js @@ -10,27 +10,27 @@ description: > accessor property on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return typeof val === "undefined"; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return typeof val === "undefined"; + } + return false; +} - var arr = []; +var arr = []; - Object.defineProperty(arr, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(arr, "0", { + set: function() {}, + configurable: true +}); - Object.defineProperty(Array.prototype, "0", { - get: function () { - return 100; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return 100; + }, + configurable: true +}); - var testResult = arr.map(callbackfn); +var testResult = arr.map(callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-2.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-2.js index e9fb0f5588f48920635ba8561e2b6408b342fff6..b3c0686e222d952299fa17f424cfb4c42a157059 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-2.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-2.js @@ -9,17 +9,17 @@ description: > on an Array ---*/ - var kValue = {}; +var kValue = {}; - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; +} - var arr = [kValue]; +var arr = [kValue]; - var newArr = arr.map(callbackfn); +var newArr = arr.map(callbackfn); assert.sameValue(newArr[0], true, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-20.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-20.js index d73b92a01e14096d65f2616fa117fff5bf7c2419..79faa22950003cbfd8850531963042a42e23a467 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-20.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-20.js @@ -10,33 +10,33 @@ description: > accessor property on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return typeof val === "undefined"; - } - return false; - } - - var proto = {}; - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 2; - - Object.defineProperty(child, "0", { - set: function () { }, - configurable: true - }); - - Object.defineProperty(proto, "0", { - get: function () { - return 100; - }, - configurable: true - }); - - var testResult = Array.prototype.map.call(child, callbackfn); +function callbackfn(val, idx, obj) { + if (idx === 0) { + return typeof val === "undefined"; + } + return false; +} + +var proto = {}; + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 2; + +Object.defineProperty(child, "0", { + set: function() {}, + configurable: true +}); + +Object.defineProperty(proto, "0", { + get: function() { + return 100; + }, + configurable: true +}); + +var testResult = Array.prototype.map.call(child, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-21.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-21.js index 09387d32895d739553e216f426d7d238220ffe42..d7e36fc415cd24ef2058fbc4ca9657b38a86025b 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-21.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-21.js @@ -9,24 +9,26 @@ description: > accessor property without a get function on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return typeof val === "undefined"; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return typeof val === "undefined"; + } + return false; +} - var proto = { length: 2 }; - Object.defineProperty(proto, "0", { - set: function () { }, - configurable: true - }); +var proto = { + length: 2 +}; +Object.defineProperty(proto, "0", { + set: function() {}, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); +var child = new Con(); - var testResult = Array.prototype.map.call(child, callbackfn); +var testResult = Array.prototype.map.call(child, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-22.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-22.js index c45f502b2d08ce7672270009b6fff1318679c236..1a4ba76c0e5a090c47d4e71bde0756d44f21f9ae 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-22.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-22.js @@ -9,18 +9,18 @@ description: > accessor property without a get function on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return typeof val === "undefined"; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return typeof val === "undefined"; + } + return false; +} - Object.defineProperty(Array.prototype, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + set: function() {}, + configurable: true +}); - var testResult = [,].map(callbackfn); +var testResult = [, ].map(callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-25.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-25.js index 41cff6af1b2ce75cf44581297a54d83b7b75d2a2..74fd1615f9e970df4f4cb4a684da0115ee11f3f9 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-25.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-25.js @@ -10,18 +10,18 @@ description: > less than number of parameters) ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === 9; - } else { - return false; - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 9; + } else { + return false; + } +} - var func = function (a, b) { - return Array.prototype.map.call(arguments, callbackfn); - }; +var func = function(a, b) { + return Array.prototype.map.call(arguments, callbackfn); +}; - var testResult = func(9); +var testResult = func(9); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-26.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-26.js index bf4e46b1de2f48048dae88f3cd53c5989c73ebe4..66bb2323393935ef5c202aef96ccf28295c6e6da 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-26.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-26.js @@ -10,21 +10,21 @@ description: > number of parameters) ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === 9; - } else if (idx === 1) { - return val === 11; - } else { - return false; - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 9; + } else if (idx === 1) { + return val === 11; + } else { + return false; + } +} - var func = function (a, b) { - return Array.prototype.map.call(arguments, callbackfn); - }; +var func = function(a, b) { + return Array.prototype.map.call(arguments, callbackfn); +}; - var testResult = func(9, 11); +var testResult = func(9, 11); assert.sameValue(testResult[0], true, 'testResult[0]'); assert.sameValue(testResult[1], true, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-27.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-27.js index 3140c2b3bc6216e5018e17202c07126bddf98a87..c47bd08c3dd0f724fe5c9c3cd8dcd7a32a4febd9 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-27.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-27.js @@ -10,24 +10,24 @@ description: > greater than number of parameters) ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === 9; - } else if (idx === 1) { - return val === 11; - } else if (idx === 2) { - return val === 12; - } else { - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 9; + } else if (idx === 1) { + return val === 11; + } else if (idx === 2) { + return val === 12; + } else { + return false; + } - } +} - var func = function (a, b) { - return Array.prototype.map.call(arguments, callbackfn); - }; +var func = function(a, b) { + return Array.prototype.map.call(arguments, callbackfn); +}; - var testResult = func(9, 11, 12); +var testResult = func(9, 11, 12); assert.sameValue(testResult[0], true, 'testResult[0]'); assert.sameValue(testResult[1], true, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-28.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-28.js index ba96bfa5b997239bba00304b50819895a3dde8a3..142bcdd8d03463da7c587fadf77cff042e77576c 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-28.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-28.js @@ -9,39 +9,39 @@ description: > iterations is observed on an Array ---*/ - var preIterVisible = false; - var arr = []; +var preIterVisible = false; +var arr = []; - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === 11; - } else if (idx === 1) { - return val === 9; - } else { - return false; - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 11; + } else if (idx === 1) { + return val === 9; + } else { + return false; + } +} - Object.defineProperty(arr, "0", { - get: function () { - preIterVisible = true; - return 11; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + preIterVisible = true; + return 11; + }, + configurable: true +}); - Object.defineProperty(arr, "1", { - get: function () { - if (preIterVisible) { - return 9; - } else { - return 11; - } - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + if (preIterVisible) { + return 9; + } else { + return 11; + } + }, + configurable: true +}); - var testResult = arr.map(callbackfn); +var testResult = arr.map(callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); assert.sameValue(testResult[1], true, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-29.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-29.js index 4e034ba2cc1aecffbae6832fee4262189ac21487..9d97893b818dd967460bb0b58be2e33913ae5b3a 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-29.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-29.js @@ -9,39 +9,41 @@ description: > iterations is observed on an Array-like object ---*/ - var preIterVisible = false; - var obj = { length: 2 }; +var preIterVisible = false; +var obj = { + length: 2 +}; - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === 11; - } else if (idx === 1) { - return val === 9; - } else { - return false; - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 11; + } else if (idx === 1) { + return val === 9; + } else { + return false; + } +} - Object.defineProperty(obj, "0", { - get: function () { - preIterVisible = true; - return 11; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + preIterVisible = true; + return 11; + }, + configurable: true +}); - Object.defineProperty(obj, "1", { - get: function () { - if (preIterVisible) { - return 9; - } else { - return 11; - } - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + if (preIterVisible) { + return 9; + } else { + return 11; + } + }, + configurable: true +}); - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); assert.sameValue(testResult[1], true, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-3.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-3.js index f3d9e7dd90b1b7ec95980ac6740fbe139b025f16..dac643e4e5cf16e5150566b74c55e4ec87a07d68 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-3.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-3.js @@ -9,23 +9,26 @@ description: > that overrides an inherited data property on an Array-like object ---*/ - var kValue = "abc"; +var kValue = "abc"; - function callbackfn(val, idx, obj) { - if (idx === 5) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 5) { + return val === kValue; + } + return false; +} - var proto = { 5: 12, length: 10 }; +var proto = { + 5: 12, + length: 10 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[5] = kValue; +var child = new Con(); +child[5] = kValue; - var testResult = Array.prototype.map.call(child, callbackfn); +var testResult = Array.prototype.map.call(child, callbackfn); assert.sameValue(testResult[5], true, 'testResult[5]'); 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 d9cec7c6b899580f2a5fe4ba839ad20de65e7b6c..cae9865e2edd544c694112911fced1c27c4aaea2 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 @@ -9,30 +9,35 @@ description: > terminate iteration on an Array-like object ---*/ - var obj = { 0: 11, 5: 10, 10: 8, length: 20 }; - var accessed = false; +var obj = { + 0: 11, + 5: 10, + 10: 8, + length: 20 +}; +var accessed = false; - function callbackfn(val, idx, obj) { - if (idx > 1) { - accessed = true; - } - } +function callbackfn(val, idx, obj) { + if (idx > 1) { + accessed = true; + } +} - Object.defineProperty(obj, "1", { - get: function () { - throw new RangeError("unhandle exception happened in getter"); - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true +}); - Object.defineProperty(obj, "2", { - get: function () { - accessed = true; - return 100; - }, - configurable: true - }); +Object.defineProperty(obj, "2", { + get: function() { + accessed = true; + return 100; + }, + configurable: true +}); assert.throws(RangeError, function() { - Array.prototype.map.call(obj, callbackfn); + Array.prototype.map.call(obj, callbackfn); }); 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 6923f6d8f7abf0d56751878780eb99b4fddbabdb..094568212e9925a11a870eaf1a44ec1b779713af 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 @@ -9,33 +9,33 @@ description: > terminate iteration on an Array ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - if (idx > 1) { - accessed = true; - } - } +function callbackfn(val, idx, obj) { + if (idx > 1) { + accessed = true; + } +} - var arr = []; - arr[5] = 10; - arr[10] = 100; +var arr = []; +arr[5] = 10; +arr[10] = 100; - Object.defineProperty(arr, "1", { - get: function () { - throw new RangeError("unhandle exception happened in getter"); - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true +}); - Object.defineProperty(arr, "2", { - get: function () { - accessed = true; - return 100; - }, - configurable: true - }); +Object.defineProperty(arr, "2", { + get: function() { + accessed = true; + return 100; + }, + configurable: true +}); assert.throws(RangeError, function() { - arr.map(callbackfn); + arr.map(callbackfn); }); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-4.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-4.js index 192dd3f4d5d56e3cfa2ab2e307257f1ee524d4a4..cf77e37961bed2c4974a19d72241499b31259575 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-4.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-4.js @@ -9,17 +9,17 @@ description: > that overrides an inherited data property on an Array ---*/ - var kValue = "abc"; +var kValue = "abc"; - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; +} - Array.prototype[0] = 11; +Array.prototype[0] = 11; - var testResult = [kValue].map(callbackfn); +var testResult = [kValue].map(callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-5.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-5.js index 70b85169b0e86ad66679e6dfab02aefdf47212d8..cf2c63c9b84d40ee29780d1df314f4d82cc6bf05 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-5.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-5.js @@ -10,34 +10,34 @@ description: > object ---*/ - var kValue = "abc"; - - function callbackfn(val, idx, obj) { - if (idx === 5) { - return val === kValue; - } - return false; - } - - var proto = {}; - - Object.defineProperty(proto, "5", { - get: function () { - return 11; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 10; - Object.defineProperty(child, "5", { - value: kValue, - configurable: true - }); - - var testResult = Array.prototype.map.call(child, callbackfn); +var kValue = "abc"; + +function callbackfn(val, idx, obj) { + if (idx === 5) { + return val === kValue; + } + return false; +} + +var proto = {}; + +Object.defineProperty(proto, "5", { + get: function() { + return 11; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 10; +Object.defineProperty(child, "5", { + value: kValue, + configurable: true +}); + +var testResult = Array.prototype.map.call(child, callbackfn); assert.sameValue(testResult[5], true, 'testResult[5]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-6.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-6.js index c7970fc48fea6d56fb93cd6e2d12a0943479ff13..4c9ae77760a5da1cd4f89b75f4f4cfe4c24aca86 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-6.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-6.js @@ -9,22 +9,22 @@ description: > that overrides an inherited accessor property on an Array ---*/ - var kValue = "abc"; +var kValue = "abc"; - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; +} - Object.defineProperty(Array.prototype, "0", { - get: function () { - return 9; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return 9; + }, + configurable: true +}); - var testResult = [kValue].map(callbackfn); +var testResult = [kValue].map(callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-7.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-7.js index 9a2b37c7b493ecee1a4cc6e086e0e4e39d63f39b..908e1e6b1c9e49df3230f5d5b4f444a0185ab358 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-7.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-7.js @@ -9,22 +9,25 @@ description: > property on an Array-like object ---*/ - var kValue = "abc"; +var kValue = "abc"; - function callbackfn(val, idx, obj) { - if (idx === 5) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 5) { + return val === kValue; + } + return false; +} - var proto = { 5: kValue, length: 10 }; +var proto = { + 5: kValue, + length: 10 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); +var child = new Con(); - var newArr = Array.prototype.map.call(child, callbackfn); +var newArr = Array.prototype.map.call(child, callbackfn); assert.sameValue(newArr[5], true, 'newArr[5]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-8.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-8.js index 45597f7ea25aedf49d0d728826cab19db1deda5c..03d312b30e376bd8a23da5d01d1b621ab0613419 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-8.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-8.js @@ -9,15 +9,15 @@ description: > property on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1) { - return val === 13; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + return val === 13; + } + return false; +} - Array.prototype[1] = 13; +Array.prototype[1] = 13; - var newArr = [, , , ].map(callbackfn); +var newArr = [, , , ].map(callbackfn); assert.sameValue(newArr[1], true, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-9.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-9.js index ac0a9750c334d9134cde7be8f905e1ad68bf8e60..2d58d345f75e3bff4c6268fa828d7e61b81b1075 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-9.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-9.js @@ -9,24 +9,26 @@ description: > property on an Array-like object ---*/ - var kValue = "abc"; +var kValue = "abc"; - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; +} - var obj = { length: 2 }; +var obj = { + length: 2 +}; - Object.defineProperty(obj, "0", { - get: function () { - return kValue; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + return kValue; + }, + configurable: true +}); - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-1.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-1.js index d5ad9c8f93f7993aa75743e462da1a29e09c5506..94a0fad1d34703ace7f11881c777c30314a6a579 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-1.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-1.js @@ -7,18 +7,19 @@ es5id: 15.4.4.19-8-c-ii-1 description: Array.prototype.map - callbackfn called with correct parameters ---*/ - var bPar = true; - var bCalled = false; - function callbackfn(val, idx, obj) - { - bCalled = true; - if(obj[idx] !== val) - bPar = false; - } +var bPar = true; +var bCalled = false; - var srcArr = [0,1,true,null,new Object(),"five"]; - srcArr[999999] = -6.6; - var resArr = srcArr.map(callbackfn); +function callbackfn(val, idx, obj) +{ + bCalled = true; + if (obj[idx] !== val) + bPar = false; +} + +var srcArr = [0, 1, true, null, new Object(), "five"]; +srcArr[999999] = -6.6; +var resArr = srcArr.map(callbackfn); assert.sameValue(bCalled, true, 'bCalled'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-10.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-10.js index 2602ab100db2e81cab75a7d87b6f4ebc4054d1ad..546a841428d66e01677f3350b00f26cd3ef58f0c 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-10.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-10.js @@ -7,10 +7,10 @@ es5id: 15.4.4.19-8-c-ii-10 description: Array.prototype.map - callbackfn is called with 1 formal parameter ---*/ - function callbackfn(val) { - return val > 10; - } +function callbackfn(val) { + return val > 10; +} - var testResult = [11].map(callbackfn); +var testResult = [11].map(callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-11.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-11.js index 4bfbc76db26c52c211b8ceaef11f8287550ef5c0..503c65ad35a3c988b4726b6ca5611086683b0fdd 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-11.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-11.js @@ -7,10 +7,10 @@ es5id: 15.4.4.19-8-c-ii-11 description: Array.prototype.map - callbackfn is called with 2 formal parameters ---*/ - function callbackfn(val, idx) { - return (val > 10 && arguments[2][idx] === val); - } +function callbackfn(val, idx) { + return (val > 10 && arguments[2][idx] === val); +} - var testResult = [11].map(callbackfn); +var testResult = [11].map(callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-12.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-12.js index 8919089d12ff223c36e8f6f333a18283d66ee775..d97ab07072effb56624d6a0f8235f57dd0df16f8 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-12.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-12.js @@ -7,10 +7,10 @@ es5id: 15.4.4.19-8-c-ii-12 description: Array.prototype.map - callbackfn is called with 3 formal parameters ---*/ - function callbackfn(val, idx, obj) { - return (val > 10 && obj[idx] === val); - } +function callbackfn(val, idx, obj) { + return (val > 10 && obj[idx] === val); +} - var testResult = [11].map(callbackfn); +var testResult = [11].map(callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-13.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-13.js index 35523402a3bfb438563a17a58d7ec786bb0ebc4b..cf89b225976b54858e5c136c0984fc504b99ff27 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-13.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-13.js @@ -9,10 +9,10 @@ description: > parameter value ---*/ - function callbackfn() { - return arguments[2][arguments[1]] === arguments[0]; - } +function callbackfn() { + return arguments[2][arguments[1]] === arguments[0]; +} - var testResult = [11].map(callbackfn); +var testResult = [11].map(callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-16.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-16.js index be5f0d3c7381dddc82e18a2170d36a8d444be9d6..bc4d4dce5deb1fb6c7a447351724914a64e8bd51 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-16.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-16.js @@ -9,12 +9,15 @@ description: > a boolean primitive) ---*/ - function callbackfn(val, idx, obj) { - return this.valueOf() === false; - } +function callbackfn(val, idx, obj) { + return this.valueOf() === false; +} - var obj = { 0: 11, length: 2 }; +var obj = { + 0: 11, + length: 2 +}; - var testResult = Array.prototype.map.call(obj, callbackfn, false); +var testResult = Array.prototype.map.call(obj, callbackfn, false); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-17.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-17.js index dd16accb11daea472d1f15a02e5b2c42bcfcc113..e095ed03e5e3e3de1084298bcb583a6ce5c55f55 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-17.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-17.js @@ -9,12 +9,15 @@ description: > a number) ---*/ - function callbackfn(val, idx, obj) { - return this.valueOf() === 5; - } +function callbackfn(val, idx, obj) { + return this.valueOf() === 5; +} - var obj = { 0: 11, length: 2 }; +var obj = { + 0: 11, + length: 2 +}; - var testResult = Array.prototype.map.call(obj, callbackfn, 5); +var testResult = Array.prototype.map.call(obj, callbackfn, 5); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-18.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-18.js index 2fbb0a5b1e2f61acadf2ceaac09cf9bce5228575..90501719bbcb0373990d7d3b909b13d9420ed9ac 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-18.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-18.js @@ -9,12 +9,15 @@ description: > a string primitive) ---*/ - function callbackfn(val, idx, obj) { - return this.valueOf() === "hello!"; - } +function callbackfn(val, idx, obj) { + return this.valueOf() === "hello!"; +} - var obj = { 0: 11, length: 2 }; +var obj = { + 0: 11, + length: 2 +}; - var testResult = Array.prototype.map.call(obj, callbackfn, "hello!"); +var testResult = Array.prototype.map.call(obj, callbackfn, "hello!"); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-19.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-19.js index 58f038dbcd6e698f3c4459ca9cf6f0bda8136bff..a638a3126252076efeb7ce639c24216ce6151bdd 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-19.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-19.js @@ -7,20 +7,24 @@ es5id: 15.4.4.19-8-c-ii-19 description: Array.prototype.map - non-indexed properties are not called. ---*/ - var called = 0; - var result = false; +var called = 0; +var result = false; - function callbackfn(val, idx, obj) { - called++; - if (val === 11) { - result = true; - } - return true; - } +function callbackfn(val, idx, obj) { + called++; + if (val === 11) { + result = true; + } + return true; +} - var obj = { 0: 9, non_index_property: 11, length: 20 }; +var obj = { + 0: 9, + non_index_property: 11, + length: 20 +}; - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(result, false, 'result'); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-2.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-2.js index b405b41c5e32655cbda6c89cc74375ab2eb1d9f1..34a8c1a41167e0a53430048dab29543468b17151 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-2.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-2.js @@ -7,17 +7,18 @@ es5id: 15.4.4.19-8-c-ii-2 description: Array.prototype.map - callbackfn takes 3 arguments ---*/ - var parCnt = 3; - var bCalled = false - function callbackfn(val, idx, obj) - { - bCalled = true; - if(arguments.length !== 3) - parCnt = arguments.length; //verify if callbackfn was called with 3 parameters - } +var parCnt = 3; +var bCalled = false - var srcArr = [0,1,2,3,4,5,6,7,8,9]; - var resArr = srcArr.map(callbackfn); +function callbackfn(val, idx, obj) +{ + bCalled = true; + if (arguments.length !== 3) + parCnt = arguments.length; //verify if callbackfn was called with 3 parameters +} + +var srcArr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; +var resArr = srcArr.map(callbackfn); assert.sameValue(bCalled, true, 'bCalled'); assert.sameValue(parCnt, 3, 'parCnt'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-20.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-20.js index ddb58576265d2ef837743f7225d677acc352b741..96f50c481cf412db459b8a848bc82faac90d1e89 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-20.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-20.js @@ -9,14 +9,20 @@ description: > (thisArg is correct) ---*/ - function callbackfn(val, idx, obj) { - return this.threshold === 10; - } +function callbackfn(val, idx, obj) { + return this.threshold === 10; +} - var thisArg = { threshold: 10 }; +var thisArg = { + threshold: 10 +}; - var obj = { 0: 11, 1: 9, length: 2 }; +var obj = { + 0: 11, + 1: 9, + length: 2 +}; - var testResult = Array.prototype.map.call(obj, callbackfn, thisArg); +var testResult = Array.prototype.map.call(obj, callbackfn, thisArg); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-21.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-21.js index b4f908ac83189a90ff8260e8931e6bbb1421012a..50cd9a2cdd9f3d436cf68fdd67e4730ea10cb6f6 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-21.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-21.js @@ -9,21 +9,25 @@ description: > (kValue is correct) ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === 11; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 11; + } - if (idx === 1) { - return val === 12; - } + if (idx === 1) { + return val === 12; + } - return false; - } + return false; +} - var obj = { 0: 11, 1: 12, length: 2 }; +var obj = { + 0: 11, + 1: 12, + length: 2 +}; - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); assert.sameValue(testResult[1], true, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-22.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-22.js index 7da27f9ee1a7f3839e5903f51f6cc78e7eee50a5..a5a30861adc4442e14f8d770aff51ba755732b1d 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-22.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-22.js @@ -9,21 +9,25 @@ description: > (the index k is correct) ---*/ - function callbackfn(val, idx, obj) { - if (val === 11) { - return idx === 0; - } +function callbackfn(val, idx, obj) { + if (val === 11) { + return idx === 0; + } - if (val === 12) { - return idx === 1; - } + if (val === 12) { + return idx === 1; + } - return false; - } + return false; +} - var obj = { 0: 11, 1: 12, length: 2 }; +var obj = { + 0: 11, + 1: 12, + length: 2 +}; - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); assert.sameValue(testResult[1], true, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-23.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-23.js index 78575602e7d909ba3fd123877f3807acfae05a66..fd14317056d1e47099a1df33f76ba14f7871708e 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-23.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-23.js @@ -9,12 +9,15 @@ description: > (this object O is correct) ---*/ - var obj = { 0: 11, length: 2 }; +var obj = { + 0: 11, + length: 2 +}; - function callbackfn(val, idx, o) { - return obj === o; - } +function callbackfn(val, idx, o) { + return obj === o; +} - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-4.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-4.js index b47ecdde1b671ba22b2d0a1b28a60614cc64408e..5fe857f9338641bfeb7d1216a3aa48fa7f6d800f 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-4.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-4.js @@ -7,20 +7,21 @@ es5id: 15.4.4.19-8-c-ii-4 description: Array.prototype.map - k values are passed in acending numeric order ---*/ - var arr = [0, 1, 2, 3, 4, 5]; - var lastIdx = 0; - var called = 0; - var result = true; - function callbackfn(val, idx, o) { - called++; - if (lastIdx !== idx) { - result = false; - } else { - lastIdx++; - } - } +var arr = [0, 1, 2, 3, 4, 5]; +var lastIdx = 0; +var called = 0; +var result = true; - arr.map(callbackfn); +function callbackfn(val, idx, o) { + called++; + if (lastIdx !== idx) { + result = false; + } else { + lastIdx++; + } +} + +arr.map(callbackfn); assert(result, 'result !== true'); assert.sameValue(arr.length, called, 'arr.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-5.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-5.js index fa7136b47102663752f3b150329f3db889589954..d0d8859c6789a2f6a89baced33ebec8a783e9a8b 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-5.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-5.js @@ -9,24 +9,24 @@ description: > and not prior to starting the loop. ---*/ - var kIndex = []; +var kIndex = []; - //By below way, we could verify that k would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time. - function callbackfn(val, idx, obj) { - //Each position should be visited one time, which means k is accessed one time during iterations. - if (typeof kIndex[idx] === "undefined") { - //when current position is visited, its previous index should has been visited. - if (idx !== 0 && typeof kIndex[idx - 1] === "undefined") { - return true; - } - kIndex[idx] = 1; - return false; - } else { - return true; - } - } +//By below way, we could verify that k would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time. +function callbackfn(val, idx, obj) { + //Each position should be visited one time, which means k is accessed one time during iterations. + if (typeof kIndex[idx] === "undefined") { + //when current position is visited, its previous index should has been visited. + if (idx !== 0 && typeof kIndex[idx - 1] === "undefined") { + return true; + } + kIndex[idx] = 1; + return false; + } else { + return true; + } +} - var testResult = [11, 12, 13, 14].map(callbackfn); +var testResult = [11, 12, 13, 14].map(callbackfn); assert.sameValue(testResult.length, 4, 'testResult.length'); assert.sameValue(testResult[0], false, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-6.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-6.js index 880856724b641a32bd3de719d3fd85b1c817cabf..7ac9796c3eb28a0f5771bf7f9853d78576c28bdd 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-6.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-6.js @@ -7,16 +7,19 @@ es5id: 15.4.4.19-8-c-ii-6 description: Array.prototype.map - arguments to callbackfn are self consistent. ---*/ - var obj = { 0: 11, length: 1 }; - var thisArg = {}; +var obj = { + 0: 11, + length: 1 +}; +var thisArg = {}; - function callbackfn() { - return this === thisArg && - arguments[0] === 11 && - arguments[1] === 0 && - arguments[2] === obj; - } +function callbackfn() { + return this === thisArg && + arguments[0] === 11 && + arguments[1] === 0 && + arguments[2] === obj; +} - var testResult = Array.prototype.map.call(obj, callbackfn, thisArg); +var testResult = Array.prototype.map.call(obj, callbackfn, thisArg); assert.sameValue(testResult[0], true, 'testResult[0]'); 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 346adb6c95a62734a960a14ae364fed535116cbe..0ae5970fefc59e6ba15146e79cf559fdfff758d0 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 @@ -9,19 +9,24 @@ description: > terminate iteration ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - if (idx > 0) { - accessed = true; - } - if (idx === 0) { - throw new Error("Exception occurred in callbackfn"); - } - } +function callbackfn(val, idx, obj) { + if (idx > 0) { + accessed = true; + } + if (idx === 0) { + throw new Error("Exception occurred in callbackfn"); + } +} - var obj = { 0: 11, 4: 10, 10: 8, length: 20 }; +var obj = { + 0: 11, + 4: 10, + 10: 8, + length: 20 +}; assert.throws(Error, function() { - Array.prototype.map.call(obj, callbackfn); + Array.prototype.map.call(obj, callbackfn); }); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-8.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-8.js index 467f3589af86b598f78c03e37c3bc028ac13b863..e4e4d231da58494a04528032b1c35b2a0d59ea2c 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-8.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-8.js @@ -9,15 +9,19 @@ description: > iterations is observed ---*/ - var obj = { 0: 9, 1: 12, length: 2 }; +var obj = { + 0: 9, + 1: 12, + length: 2 +}; - function callbackfn(val, idx, o) { - if (idx === 0) { - obj[idx + 1] = 8; - } - return val > 10; - } +function callbackfn(val, idx, o) { + if (idx === 0) { + obj[idx + 1] = 8; + } + return val > 10; +} - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult[1], false, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-9.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-9.js index 88f74819adb8dc2c7f9eab23723d05d134a898eb..3554ac85b51b7cd09b159d34258b7a3378b4de42 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-9.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-ii-9.js @@ -7,10 +7,10 @@ es5id: 15.4.4.19-8-c-ii-9 description: Array.prototype.map - callbackfn with 0 formal parameter ---*/ - function callbackfn() { - return true; - } +function callbackfn() { + return true; +} - var testResult = [11].map(callbackfn); +var testResult = [11].map(callbackfn); assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-1.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-1.js index b3fa6ffcc294807b97d9052e76c0d82052347b5f..5f759befbe7ba287549adda478482f666e71c917 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-1.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-1.js @@ -9,14 +9,14 @@ description: > returned array element ---*/ - function callbackfn(val, idx, obj){ - if(val % 2) - return (2 * val + 1); - else - return (val / 2); - } - var srcArr = [0,1,2,3,4]; - var resArr = srcArr.map(callbackfn); +function callbackfn(val, idx, obj) { + if (val % 2) + return (2 * val + 1); + else + return (val / 2); +} +var srcArr = [0, 1, 2, 3, 4]; +var resArr = srcArr.map(callbackfn); assert(resArr.length > 0, 'resArr.length > 0'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-2.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-2.js index 999460193cb4685ecb613f09dbcbf2a2317c8bae..6f5cbb81bb22ada2026e4aafb2238c2ca0cf4c51 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-2.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-2.js @@ -9,12 +9,16 @@ description: > 'mappedValue' ---*/ - function callbackfn(val, idx, obj) { - return val; - } +function callbackfn(val, idx, obj) { + return val; +} - var obj = { 0: 11, 1: 9, length: 2 }; - var newArr = Array.prototype.map.call(obj, callbackfn); +var obj = { + 0: 11, + 1: 9, + length: 2 +}; +var newArr = Array.prototype.map.call(obj, callbackfn); assert.sameValue(newArr[0], obj[0], 'newArr[0]'); assert.sameValue(newArr[1], obj[1], 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-3.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-3.js index fed4c1424ea5d7b6d16810a8c5f1b5d1e8f15f4b..7525d1b0c0b98308440a352d5e768690f882ac9b 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-3.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-3.js @@ -9,14 +9,18 @@ description: > overwritten ---*/ - function callbackfn(val, idx, obj) { - return 11; - } +function callbackfn(val, idx, obj) { + return 11; +} - var obj = { 0: 11, 1: 9, length: 2 }; - var newArr = Array.prototype.map.call(obj, callbackfn); +var obj = { + 0: 11, + 1: 9, + length: 2 +}; +var newArr = Array.prototype.map.call(obj, callbackfn); - var tempVal = newArr[1]; - newArr[1] += 1; +var tempVal = newArr[1]; +newArr[1] += 1; assert.notSameValue(newArr[1], tempVal, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-4.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-4.js index f15aad4f1c80460b57c269b047d4e685d4c89814..4b918884d4f9bc244972bc9aeedbe249cb013ed2 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-4.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-4.js @@ -9,21 +9,24 @@ description: > enumerated ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { 0: 11, length: 2 }; - var newArr = Array.prototype.map.call(obj, callbackfn); +var obj = { + 0: 11, + length: 2 +}; +var newArr = Array.prototype.map.call(obj, callbackfn); - var prop; - var enumerable = false; - for (prop in newArr) { - if (newArr.hasOwnProperty(prop)) { - if (prop === "0") { - enumerable = true; - } - } - } +var prop; +var enumerable = false; +for (prop in newArr) { + if (newArr.hasOwnProperty(prop)) { + if (prop === "0") { + enumerable = true; + } + } +} assert(enumerable, 'enumerable !== true'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-5.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-5.js index 4bb7b42ff04d4723747b9b43fae4288bf07834a7..44eaea59e1259f924f9189c013795b4b977982c6 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-5.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-5.js @@ -9,15 +9,19 @@ description: > changed or deleted ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { 0: 11, 1: 9, length: 2 }; - var newArr = Array.prototype.map.call(obj, callbackfn); +var obj = { + 0: 11, + 1: 9, + length: 2 +}; +var newArr = Array.prototype.map.call(obj, callbackfn); - var tempVal = newArr[1]; - delete newArr[1]; +var tempVal = newArr[1]; +delete newArr[1]; assert.notSameValue(tempVal, undefined, 'tempVal'); assert.sameValue(newArr[1], undefined, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-9-1.js b/test/built-ins/Array/prototype/map/15.4.4.19-9-1.js index daabdf4cbadfcb8acb53011b7db4ec317c642db9..a9cb1f51e8b2c4ef3defaef414cd4ba1549b692f 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-9-1.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-9-1.js @@ -9,12 +9,12 @@ description: > on ---*/ - function callbackfn(val, idx, obj) - { - return true; - } - var srcArr = [1,2,3,4,5]; - srcArr.map(callbackfn); +function callbackfn(val, idx, obj) +{ + return true; +} +var srcArr = [1, 2, 3, 4, 5]; +srcArr.map(callbackfn); assert.sameValue(srcArr[0], 1, 'srcArr[0]'); assert.sameValue(srcArr[1], 2, 'srcArr[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-9-10.js b/test/built-ins/Array/prototype/map/15.4.4.19-9-10.js index 1b1854f44fe2ff5ec5338e2c921fadb82d7d8128..5407e1ee9e2e14e19eb0cac3464c914fcdfc4cfa 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-9-10.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-9-10.js @@ -9,22 +9,22 @@ description: > (subclassed Array, length overridden with obj with valueOf) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var Foo = function () { }; - Foo.prototype = [1, 2, 3]; - var obj = new Foo(); - obj.length = { - valueOf: function () { - return 0; - } - }; +var Foo = function() {}; +Foo.prototype = [1, 2, 3]; +var obj = new Foo(); +obj.length = { + valueOf: function() { + return 0; + } +}; - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult.length, 0, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-9-11.js b/test/built-ins/Array/prototype/map/15.4.4.19-9-11.js index f8c6a295f8e3fe03ce06f13c207f97265c48ddf6..aa0fd889123d4598d38d536c014be35881011c58 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-9-11.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-9-11.js @@ -10,26 +10,26 @@ description: > (toString)) ---*/ - function Foo() { } - Foo.prototype = [1, 2, 3]; +function Foo() {} +Foo.prototype = [1, 2, 3]; - var f = new Foo(); +var f = new Foo(); - var o = { - toString: function () { - return '0'; - } - }; - f.length = o; +var o = { + toString: function() { + return '0'; + } +}; +f.length = o; - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. - function cb() { } - var a = Array.prototype.map.call(f, cb); +function cb() {} +var a = Array.prototype.map.call(f, cb); assert(Array.isArray(a), 'Array.isArray(a) !== true'); assert.sameValue(a.length, 0, 'a.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-9-12.js b/test/built-ins/Array/prototype/map/15.4.4.19-9-12.js index 41b4e362b5e281ecf28e8cf457b5963f07f992fa..9ae64cd57a7b5cac0ae134f61c6f75f1bcc3de9a 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-9-12.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-9-12.js @@ -9,28 +9,28 @@ description: > (subclassed Array, length overridden with []) ---*/ - function Foo() { } - Foo.prototype = [1, 2, 3]; - var f = new Foo(); +function Foo() {} +Foo.prototype = [1, 2, 3]; +var f = new Foo(); - f.length = []; +f.length = []; - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - // - // The toString( ) method on Array converts the array elements to strings, - // then returns the result of concatenating these strings, with commas in - // between. An array with no elements converts to the empty string, which - // converts to the number 0. If an array has a single element that is a - // number n, the array converts to a string representation of n, which is - // then converted back to n itself. If an array contains more than one element, - // or if its one element is not a number, the array converts to NaN. +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +// +// The toString( ) method on Array converts the array elements to strings, +// then returns the result of concatenating these strings, with commas in +// between. An array with no elements converts to the empty string, which +// converts to the number 0. If an array has a single element that is a +// number n, the array converts to a string representation of n, which is +// then converted back to n itself. If an array contains more than one element, +// or if its one element is not a number, the array converts to NaN. - function cb() { } - var a = Array.prototype.map.call(f, cb); +function cb() {} +var a = Array.prototype.map.call(f, cb); assert(Array.isArray(a), 'Array.isArray(a) !== true'); assert.sameValue(a.length, 0, 'a.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-9-13.js b/test/built-ins/Array/prototype/map/15.4.4.19-9-13.js index d4c208ccdf11defa53c2869e97a4ff19452bd572..f84a937eecfaef3203101be7ed96f25c5a5c1dfb 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-9-13.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-9-13.js @@ -9,16 +9,16 @@ description: > functions, O is unmodified ---*/ - var called = 0; +var called = 0; - function callbackfn(val, idx, obj) { - called++; - return val > 2; - } +function callbackfn(val, idx, obj) { + called++; + return val > 2; +} - var arr = [1, 2, 3, 4]; +var arr = [1, 2, 3, 4]; - arr.map(callbackfn); +arr.map(callbackfn); assert.sameValue(arr[0], 1, 'arr[0]'); assert.sameValue(arr[1], 2, 'arr[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-9-2.js b/test/built-ins/Array/prototype/map/15.4.4.19-9-2.js index c876d7f0aab97bd2dc7c952552357201bed0e397..cc3657e87c4db5067e2f27dfcad71a50db44384c 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-9-2.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-9-2.js @@ -9,12 +9,12 @@ description: > and values the result of callbackfn ---*/ - function callbackfn(val, idx, obj) - { - return val + 10; - } - var srcArr = [1,2,3,4,5]; - var resArr = srcArr.map(callbackfn); +function callbackfn(val, idx, obj) +{ + return val + 10; +} +var srcArr = [1, 2, 3, 4, 5]; +var resArr = srcArr.map(callbackfn); assert.sameValue(resArr[0], 11, 'resArr[0]'); assert.sameValue(resArr[1], 12, 'resArr[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-9-3.js b/test/built-ins/Array/prototype/map/15.4.4.19-9-3.js index f89f39c9c32f4f14ffcfb990153652a3ebd9448b..815868a4825cfb4e50c29146fc446ccbf7ce3bbd 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-9-3.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-9-3.js @@ -7,13 +7,14 @@ es5id: 15.4.4.19-9-3 description: Array.prototype.map - subclassed array when length is reduced ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = 1; +foo.prototype = new Array(1, 2, 3); - function cb(){} - var a = f.map(cb); +function foo() {} +var f = new foo(); +f.length = 1; + +function cb() {} +var a = f.map(cb); assert(Array.isArray(a), 'Array.isArray(a) !== true'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-9-4.js b/test/built-ins/Array/prototype/map/15.4.4.19-9-4.js index f27f93bf09adf5bc5468693555e2dd0ace520b2c..3c01de3d0a84b794594d27776d326542c829017b 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-9-4.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-9-4.js @@ -7,15 +7,16 @@ es5id: 15.4.4.19-9-4 description: Array.prototype.map doesn't visit expandos ---*/ - var callCnt = 0; - function callbackfn(val, idx, obj) - { - callCnt++; - } - var srcArr = [1,2,3,4,5]; - srcArr["i"] = 10; - srcArr[true] = 11; +var callCnt = 0; - var resArr = srcArr.map(callbackfn); +function callbackfn(val, idx, obj) +{ + callCnt++; +} +var srcArr = [1, 2, 3, 4, 5]; +srcArr["i"] = 10; +srcArr[true] = 11; + +var resArr = srcArr.map(callbackfn); assert.sameValue(callCnt, 5, 'callCnt'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-9-5.js b/test/built-ins/Array/prototype/map/15.4.4.19-9-5.js index 84ca53f1527ade27c109522b69c35eee59c68f18..6c04bb72e4b2f089233d0a7b5d3d538fd94a6b9d 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-9-5.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-9-5.js @@ -9,12 +9,16 @@ description: > (empty array) ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var obj = { 0: 9, 1: 8, length: 0 }; +var obj = { + 0: 9, + 1: 8, + length: 0 +}; - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult.length, 0, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-9-6.js b/test/built-ins/Array/prototype/map/15.4.4.19-9-6.js index e2adc884c2736e3ad3e5993ae40d017ea3becbcf..a44859e171e33fb9f93bdbfe7404791203ec2802 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-9-6.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-9-6.js @@ -9,15 +9,15 @@ description: > (subclassed Array, length overridden to null (type conversion)) ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} - var Foo = function () { }; - Foo.prototype = [1, 2, 3]; - var obj = new Foo(); - obj.length = null; +var Foo = function() {}; +Foo.prototype = [1, 2, 3]; +var obj = new Foo(); +obj.length = null; - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult.length, 0, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-9-7.js b/test/built-ins/Array/prototype/map/15.4.4.19-9-7.js index b6ebf35ee2bede0168a6baaad66c075bfcd1342e..3370cc36ca81906ce565bb2af4bd8a00af3c6e8a 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-9-7.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-9-7.js @@ -9,18 +9,18 @@ description: > (subclassed Array, length overridden to false (type conversion)) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var Foo = function () { }; - Foo.prototype = [1, 2, 3]; - var obj = new Foo(); - obj.length = false; +var Foo = function() {}; +Foo.prototype = [1, 2, 3]; +var obj = new Foo(); +obj.length = false; - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult.length, 0, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-9-8.js b/test/built-ins/Array/prototype/map/15.4.4.19-9-8.js index fe1e1f5e4dad9767d4c185a57d51734d8adf6b03..9e08d61d392870a60cab8bc5bd3d02ab07e98b38 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-9-8.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-9-8.js @@ -9,18 +9,18 @@ description: > (subclassed Array, length overridden to 0 (type conversion)) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var Foo = function () { }; - Foo.prototype = [1, 2, 3]; - var obj = new Foo(); - obj.length = 0; +var Foo = function() {}; +Foo.prototype = [1, 2, 3]; +var obj = new Foo(); +obj.length = 0; - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult.length, 0, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-9-9.js b/test/built-ins/Array/prototype/map/15.4.4.19-9-9.js index 31d18a8079b439ccf090a99cbb053e507af35631..73425afa10baee37764e6e951c45b0fe97a0cce5 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-9-9.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-9-9.js @@ -9,18 +9,18 @@ description: > (subclassed Array, length overridden to '0' (type conversion)) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var Foo = function () { }; - Foo.prototype = [1, 2, 3]; - var obj = new Foo(); - obj.length = '0'; +var Foo = function() {}; +Foo.prototype = [1, 2, 3]; +var obj = new Foo(); +obj.length = '0'; - var testResult = Array.prototype.map.call(obj, callbackfn); +var testResult = Array.prototype.map.call(obj, callbackfn); assert.sameValue(testResult.length, 0, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/create-ctor-non-object.js b/test/built-ins/Array/prototype/map/create-ctor-non-object.js index b020704a2ae82f1a428b3d84f5c9ec8899b9d1aa..505b661cee16b612e19078ca0aae8932fcfc168d 100644 --- a/test/built-ins/Array/prototype/map/create-ctor-non-object.js +++ b/test/built-ins/Array/prototype/map/create-ctor-non-object.js @@ -20,7 +20,9 @@ info: | var a = []; var callCount = 0; -var cb = function() { callCount += 0; }; +var cb = function() { + callCount += 0; +}; a.constructor = null; assert.throws(TypeError, function() { diff --git a/test/built-ins/Array/prototype/map/create-ctor-poisoned.js b/test/built-ins/Array/prototype/map/create-ctor-poisoned.js index f99c51bdd180dab8bd08e1c5f51dbfd63599f253..39318bb94e5093b0f45ba3561b2f1deb33fb98fc 100644 --- a/test/built-ins/Array/prototype/map/create-ctor-poisoned.js +++ b/test/built-ins/Array/prototype/map/create-ctor-poisoned.js @@ -17,7 +17,9 @@ info: | var a = []; var callCount = 0; -var cb = function() { callCount += 1; }; +var cb = function() { + callCount += 1; +}; Object.defineProperty(a, 'constructor', { get: function() { diff --git a/test/built-ins/Array/prototype/map/create-non-array-invalid-len.js b/test/built-ins/Array/prototype/map/create-non-array-invalid-len.js index 484b77e6f933c844a31ded2d5551ef9bd278adf4..125e50a38726db79df4655d4da0a7b5d2f2e4f13 100644 --- a/test/built-ins/Array/prototype/map/create-non-array-invalid-len.js +++ b/test/built-ins/Array/prototype/map/create-non-array-invalid-len.js @@ -22,7 +22,9 @@ info: | ---*/ var callCount = 0; -var obj = { length: Math.pow(2, 32) }; +var obj = { + length: Math.pow(2, 32) +}; var cb = function() { callCount += 1; }; diff --git a/test/built-ins/Array/prototype/map/create-non-array.js b/test/built-ins/Array/prototype/map/create-non-array.js index 05f315eba5a80e057e112ec55bc805d589f1fc40..077d421df9eb211e86115753cb299e7a80d18917 100644 --- a/test/built-ins/Array/prototype/map/create-non-array.js +++ b/test/built-ins/Array/prototype/map/create-non-array.js @@ -16,7 +16,9 @@ info: | 4. If isArray is false, return ? ArrayCreate(length). ---*/ -var obj = { length: 0 }; +var obj = { + length: 0 +}; var callCount = 0; var result; Object.defineProperty(obj, 'constructor', { diff --git a/test/built-ins/Array/prototype/map/create-revoked-proxy.js b/test/built-ins/Array/prototype/map/create-revoked-proxy.js index a725bc8778e475159f573ff0422a188b9d004f29..77967d256ea21360ae331fe01410630ef3e441dd 100644 --- a/test/built-ins/Array/prototype/map/create-revoked-proxy.js +++ b/test/built-ins/Array/prototype/map/create-revoked-proxy.js @@ -26,7 +26,9 @@ features: [Proxy] var o = Proxy.revocable([], {}); var ctorCount = 0; var cbCount = 0; -var cb = function() { cbCount += 1; }; +var cb = function() { + cbCount += 1; +}; Object.defineProperty(o.proxy, 'constructor', { get: function() { diff --git a/test/built-ins/Array/prototype/map/create-species-abrupt.js b/test/built-ins/Array/prototype/map/create-species-abrupt.js index dec04db2eb2de725fe603f6d418f61855649b0b3..5c6656f281ceb320aee19148af716bdd86b71fa5 100644 --- a/test/built-ins/Array/prototype/map/create-species-abrupt.js +++ b/test/built-ins/Array/prototype/map/create-species-abrupt.js @@ -26,7 +26,9 @@ var Ctor = function() { throw new Test262Error(); }; var callCount = 0; -var cb = function() { callCount += 1; }; +var cb = function() { + callCount += 1; +}; var a = []; a.constructor = {}; a.constructor[Symbol.species] = Ctor; diff --git a/test/built-ins/Array/prototype/map/create-species-non-ctor.js b/test/built-ins/Array/prototype/map/create-species-non-ctor.js index 50657fef70d0d36dc33c8d332c3f8d73e72b63ad..661894f6ff5a8f1bf680679b6136d57a98898299 100644 --- a/test/built-ins/Array/prototype/map/create-species-non-ctor.js +++ b/test/built-ins/Array/prototype/map/create-species-non-ctor.js @@ -25,7 +25,9 @@ features: [Symbol.species] var a = []; var callCount = 0; -var cb = function() { callCount += 1; }; +var cb = function() { + callCount += 1; +}; a.constructor = {}; a.constructor[Symbol.species] = parseInt; diff --git a/test/built-ins/Array/prototype/map/create-species-poisoned.js b/test/built-ins/Array/prototype/map/create-species-poisoned.js index 11fb340d32c95b71ad8011c7bc150884e62fdfd8..a232b6aa0d1e1f22b12c6c299bc593d8d0cf8a75 100644 --- a/test/built-ins/Array/prototype/map/create-species-poisoned.js +++ b/test/built-ins/Array/prototype/map/create-species-poisoned.js @@ -21,7 +21,9 @@ features: [Symbol.species] var a = []; var callCount = 0; -var cb = function() { callCount += 1; }; +var cb = function() { + callCount += 1; +}; a.constructor = {}; Object.defineProperty(a.constructor, Symbol.species, { diff --git a/test/built-ins/Array/prototype/map/create-species-undef-invalid-len.js b/test/built-ins/Array/prototype/map/create-species-undef-invalid-len.js index bcd89aadf3c6fd69b5a6041e7de43ee1d0650778..bcd781bca63a07a59f6288c6c69710bdcdce7e4e 100644 --- a/test/built-ins/Array/prototype/map/create-species-undef-invalid-len.js +++ b/test/built-ins/Array/prototype/map/create-species-undef-invalid-len.js @@ -32,7 +32,9 @@ var array = []; var maxLength = Math.pow(2, 32); var cbCount = 0; var setCount = 0; -var cb = function() { cbCount += 1; }; +var cb = function() { + cbCount += 1; +}; var proxy = new Proxy(array, { get: function(_, name) { if (name === 'length') { diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A1.1_T1.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A1.1_T1.js index 7b729afbaf20926ec06dad06021042c9c4a89f2c..f0c867df5ef7cb5c54ab52f9650c817100d181ff 100644 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A1.1_T1.js +++ b/test/built-ins/Array/prototype/pop/S15.4.4.6_A1.1_T1.js @@ -23,7 +23,7 @@ if (x.length !== 0) { } //CHECK#3 -var x = Array(1,2,3); +var x = Array(1, 2, 3); x.length = 0; var pop = x.pop(); if (pop !== undefined) { diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A1.2_T1.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A1.2_T1.js index b12c14952ca1ae7f00e156a5f2ce1ca935b71a2f..0e0cf824a1151ce304494eb66074df35967a83b8 100644 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A1.2_T1.js +++ b/test/built-ins/Array/prototype/pop/S15.4.4.6_A1.2_T1.js @@ -11,7 +11,7 @@ description: Checking this use new Array() and [] ---*/ //CHECK#1 -var x = new Array(0,1,2,3); +var x = new Array(0, 1, 2, 3); var pop = x.pop(); if (pop !== 3) { $ERROR('#1: x = new Array(0,1,2,3); x.pop() === 3. Actual: ' + (pop)); diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A2_T1.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A2_T1.js index 32ce3b74c3c48746fa5620215ff227b8884c0243..0ab566a45dccf7b99b9f93c6eb167f629a1dd8c5 100644 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A2_T1.js +++ b/test/built-ins/Array/prototype/pop/S15.4.4.6_A2_T1.js @@ -18,15 +18,15 @@ obj.pop = Array.prototype.pop; if (obj.length !== undefined) { $ERROR('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length)); } else { - //CHECK#1 - var pop = obj.pop(); -if (pop !== undefined) { - $ERROR('#1: var obj = {}; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop)); - } - //CHECK#2 - if (obj.length !== 0) { - $ERROR('#2: var obj = {}; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length)); - } + //CHECK#1 + var pop = obj.pop(); + if (pop !== undefined) { + $ERROR('#1: var obj = {}; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop)); + } + //CHECK#2 + if (obj.length !== 0) { + $ERROR('#2: var obj = {}; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length)); + } } //CHECK#3 diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A2_T2.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A2_T2.js index ace9cd55596dceb7db2745620905960bde892ce3..3573d2a234e45ba5a81ba0b0f2290b47dc317e70 100644 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A2_T2.js +++ b/test/built-ins/Array/prototype/pop/S15.4.4.6_A2_T2.js @@ -62,7 +62,7 @@ if (pop !== undefined) { if (obj.length !== 0) { $ERROR('#8: var obj = {}; obj.length = -0; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length)); } else { - if (1/obj.length !== Number.POSITIVE_INFINITY) { + if (1 / obj.length !== Number.POSITIVE_INFINITY) { $ERROR('#8: var obj = {}; obj.length = -0; obj.pop = Array.prototype.pop; obj.pop(); obj.length === +0. Actual: ' + (obj.length)); } } diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A2_T4.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A2_T4.js index 43d1f76e1f032c8d804ea1a76939ac9f1bdd1319..d4dcd8184bea44573552a221579d9b753bb5175a 100644 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A2_T4.js +++ b/test/built-ins/Array/prototype/pop/S15.4.4.6_A2_T4.js @@ -17,7 +17,11 @@ obj.pop = Array.prototype.pop; //CHECK#1 obj[0] = -1; -obj.length = {valueOf: function() {return 1}}; +obj.length = { + valueOf: function() { + return 1 + } +}; var pop = obj.pop(); if (pop !== -1) { $ERROR('#1: obj[0] = -1; obj.length = {valueOf: function() {return 1}} obj.pop() === -1. Actual: ' + (pop)); @@ -25,7 +29,14 @@ if (pop !== -1) { //CHECK#2 obj[0] = -1; -obj.length = {valueOf: function() {return 1}, toString: function() {return 0}}; +obj.length = { + valueOf: function() { + return 1 + }, + toString: function() { + return 0 + } +}; var pop = obj.pop(); if (pop !== -1) { $ERROR('#0: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {return 0}} obj.pop() === -1. Actual: ' + (pop)); @@ -33,7 +44,14 @@ if (pop !== -1) { //CHECK#3 obj[0] = -1; -obj.length = {valueOf: function() {return 1}, toString: function() {return {}}}; +obj.length = { + valueOf: function() { + return 1 + }, + toString: function() { + return {} + } +}; var pop = obj.pop(); if (pop !== -1) { $ERROR('#3: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {return {}}} obj.pop() === -1. Actual: ' + (pop)); @@ -42,9 +60,16 @@ if (pop !== -1) { //CHECK#4 try { obj[0] = -1; - obj.length = {valueOf: function() {return 1}, toString: function() {throw "error"}}; + obj.length = { + valueOf: function() { + return 1 + }, + toString: function() { + throw "error" + } + }; var pop = obj.pop(); -if (pop !== -1) { + if (pop !== -1) { $ERROR('#4.1: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {throw "error"}}; obj.pop() === ",". Actual: ' + (pop)); } } @@ -58,7 +83,11 @@ catch (e) { //CHECK#5 obj[0] = -1; -obj.length = {toString: function() {return 0}}; +obj.length = { + toString: function() { + return 0 + } +}; var pop = obj.pop(); if (pop !== undefined) { $ERROR('#5: obj[0] = -1; obj.length = {toString: function() {return 0}} obj.pop() === undefined. Actual: ' + (pop)); @@ -66,7 +95,14 @@ if (pop !== undefined) { //CHECK#6 obj[0] = -1; -obj.length = {valueOf: function() {return {}}, toString: function() {return 0}} +obj.length = { + valueOf: function() { + return {} + }, + toString: function() { + return 0 + } +} var pop = obj.pop(); if (pop !== undefined) { $ERROR('#6: obj[0] = -1; obj.length = {valueOf: function() {return {}}, toString: function() {return 0}} obj.pop() === undefined. Actual: ' + (pop)); @@ -75,7 +111,14 @@ if (pop !== undefined) { //CHECK#7 try { obj[0] = -1; - obj.length = {valueOf: function() {throw "error"}, toString: function() {return 0}}; + obj.length = { + valueOf: function() { + throw "error" + }, + toString: function() { + return 0 + } + }; var pop = obj.pop(); $ERROR('#7.1: obj[0] = -1; obj.length = {valueOf: function() {throw "error"}, toString: function() {return 0}}; obj.pop() throw "error". Actual: ' + (pop)); } @@ -88,7 +131,14 @@ catch (e) { //CHECK#8 try { obj[0] = -1; - obj.length = {valueOf: function() {return {}}, toString: function() {return {}}}; + obj.length = { + valueOf: function() { + return {} + }, + toString: function() { + return {} + } + }; var pop = obj.pop(); $ERROR('#8.1: obj[0] = -1; obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.pop() throw TypeError. Actual: ' + (pop)); } diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A3_T1.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A3_T1.js index 2be2539f5a99a34f65a925e095064267d84a8ca0..424b9943c745bf551ebed99d34fd317b5d1576c2 100644 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A3_T1.js +++ b/test/built-ins/Array/prototype/pop/S15.4.4.6_A3_T1.js @@ -27,10 +27,10 @@ if (obj.length !== 4294967295) { //CHECK#3 if (obj[0] !== "x") { - $ERROR('#3: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.pop(); obj[0] === "x". Actual: ' + (obj[0])); + $ERROR('#3: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.pop(); obj[0] === "x". Actual: ' + (obj[0])); } //CHECK#4 if (obj[4294967295] !== undefined) { - $ERROR('#4: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.pop(); obj[4294967295] === undefined. Actual: ' + (obj[4294967295])); + $ERROR('#4: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.pop(); obj[4294967295] === undefined. Actual: ' + (obj[4294967295])); } diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A3_T2.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A3_T2.js index fdbbc28cfd5e186d78bfa17dc74986addbfd30bf..b309bc48ade8e1d1827578064a5f6d6fefcc6fb1 100644 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A3_T2.js +++ b/test/built-ins/Array/prototype/pop/S15.4.4.6_A3_T2.js @@ -27,10 +27,10 @@ if (obj.length !== 4294967296) { //CHECK#3 if (obj[0] !== "x") { - $ERROR('#3: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; obj.pop(); obj[0] === "x". Actual: ' + (obj[0])); + $ERROR('#3: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; obj.pop(); obj[0] === "x". Actual: ' + (obj[0])); } //CHECK#4 if (obj[4294967296] !== undefined) { - $ERROR('#4: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; obj.pop(); obj[4294967296] === undefined. Actual: ' + (obj[4294967296])); + $ERROR('#4: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; obj.pop(); obj[4294967296] === undefined. Actual: ' + (obj[4294967296])); } diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A3_T3.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A3_T3.js index 4b9c4020bc3b503d479c55cdcf6e117d40523935..56919c5557cd651d70c6bbe83db65c2e4d2ef861 100644 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A3_T3.js +++ b/test/built-ins/Array/prototype/pop/S15.4.4.6_A3_T3.js @@ -26,5 +26,5 @@ if (obj.length !== 0) { //CHECK#3 if (obj[4294967294] !== "x") { - $ERROR('#3: var obj = {}; obj.pop = Array.prototype.pop; obj[4294967294] = "x"; obj.length = -1; obj.pop(); obj[4294967294] === "x". Actual: ' + (obj[4294967294])); + $ERROR('#3: var obj = {}; obj.pop = Array.prototype.pop; obj[4294967294] = "x"; obj.length = -1; obj.pop(); obj[4294967294] === "x". Actual: ' + (obj[4294967294])); } diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A4_T1.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A4_T1.js index 45d5af8865d0d2d0f6079102e4f10eb73f6eca01..b5ebe7a12a52e00f45b82b39ffe3bba69d35974e 100644 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A4_T1.js +++ b/test/built-ins/Array/prototype/pop/S15.4.4.6_A4_T1.js @@ -28,7 +28,9 @@ if (x[1] !== 1) { Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; -x = {0:0}; +x = { + 0: 0 +}; //CHECK#3 var pop = x.pop(); diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A4_T2.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A4_T2.js index 7ef34c737e40600973181fb09f985f9e46543840..3592d7253278262563a37c0c2e85810faa56326a 100644 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A4_T2.js +++ b/test/built-ins/Array/prototype/pop/S15.4.4.6_A4_T2.js @@ -11,7 +11,7 @@ description: > ---*/ Array.prototype[1] = -1; -var x = [0,1]; +var x = [0, 1]; x.length = 2; //CHECK#1 @@ -28,7 +28,10 @@ if (x[1] !== -1) { Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; -x = {0:0,1:1}; +x = { + 0: 0, + 1: 1 +}; //CHECK#3 var pop = x.pop(); diff --git a/test/built-ins/Array/prototype/pop/clamps-to-integer-limit.js b/test/built-ins/Array/prototype/pop/clamps-to-integer-limit.js index 92adbd6ab6600ad2409c7bad9ac43cdeb0a1b5c9..0c5899a55eb420e0be0eba0e8936fb322e871da2 100644 --- a/test/built-ins/Array/prototype/pop/clamps-to-integer-limit.js +++ b/test/built-ins/Array/prototype/pop/clamps-to-integer-limit.js @@ -18,18 +18,18 @@ info: | var arrayLike = {}; -arrayLike.length = 2**53 - 1; +arrayLike.length = 2 ** 53 - 1; Array.prototype.pop.call(arrayLike); -assert.sameValue(arrayLike.length, 2**53 - 2, "Length is 2**53 - 1"); +assert.sameValue(arrayLike.length, 2 ** 53 - 2, "Length is 2**53 - 1"); -arrayLike.length = 2**53; +arrayLike.length = 2 ** 53; Array.prototype.pop.call(arrayLike); -assert.sameValue(arrayLike.length, 2**53 - 2, "Length is 2**53"); +assert.sameValue(arrayLike.length, 2 ** 53 - 2, "Length is 2**53"); -arrayLike.length = 2**53 + 2; +arrayLike.length = 2 ** 53 + 2; Array.prototype.pop.call(arrayLike); -assert.sameValue(arrayLike.length, 2**53 - 2, "Length is 2**53 + 2"); +assert.sameValue(arrayLike.length, 2 ** 53 - 2, "Length is 2**53 + 2"); arrayLike.length = Infinity; Array.prototype.pop.call(arrayLike); -assert.sameValue(arrayLike.length, 2**53 - 2, "Length is Infinity"); +assert.sameValue(arrayLike.length, 2 ** 53 - 2, "Length is Infinity"); diff --git a/test/built-ins/Array/prototype/pop/length-near-integer-limit.js b/test/built-ins/Array/prototype/pop/length-near-integer-limit.js index 7763b8f3c0b4fc7b74c5eb4aee7ce47304fbd64f..a480b9c6c87bba48e61ace1b721ad8fa6b1c5f7c 100644 --- a/test/built-ins/Array/prototype/pop/length-near-integer-limit.js +++ b/test/built-ins/Array/prototype/pop/length-near-integer-limit.js @@ -22,22 +22,22 @@ var arrayLike = { "9007199254740989": "9007199254740989", "9007199254740990": "9007199254740990", "9007199254740991": "9007199254740991", - length: 2**53 - 1 + length: 2 ** 53 - 1 }; var value = Array.prototype.pop.call(arrayLike); assert.sameValue(value, "9007199254740990", - "arrayLike['9007199254740990'] is returned from pop()"); + "arrayLike['9007199254740990'] is returned from pop()"); -assert.sameValue(arrayLike.length, 2**53 - 2, - "New arrayLike.length is 2**53 - 2"); +assert.sameValue(arrayLike.length, 2 ** 53 - 2, + "New arrayLike.length is 2**53 - 2"); assert.sameValue(arrayLike["9007199254740989"], "9007199254740989", - "arrayLike['9007199254740989'] is unchanged"); + "arrayLike['9007199254740989'] is unchanged"); assert.sameValue("9007199254740990" in arrayLike, false, - "arrayLike['9007199254740990'] is removed"); + "arrayLike['9007199254740990'] is removed"); assert.sameValue(arrayLike["9007199254740991"], "9007199254740991", - "arrayLike['9007199254740991'] is unchanged"); + "arrayLike['9007199254740991'] is unchanged"); diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T1.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T1.js index 181e68ca0527f9b79b2b3f70c649346a11c638d7..8d2e84db963ea50aed3d38f0da47d86903be1aa9 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T1.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T1.js @@ -19,19 +19,19 @@ obj.push = Array.prototype.push; if (obj.length !== undefined) { $ERROR('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length)); } else { - //CHECK#1 - var push = obj.push(-1); -if (push !== 1) { - $ERROR('#1: var obj = {}; obj.push = Array.prototype.push; obj.push(-1) === 1. Actual: ' + (push)); - } - //CHECK#2 - if (obj.length !== 1) { - $ERROR('#2: var obj = {}; obj.push = Array.prototype.push; obj.push(-1); obj.length === 1. Actual: ' + (obj.length)); - } - //CHECK#3 - if (obj["0"] !== -1) { - $ERROR('#3: var obj = {}; obj.push = Array.prototype.push; obj.push(-1); obj["0"] === -1. Actual: ' + (obj["0"])); - } + //CHECK#1 + var push = obj.push(-1); + if (push !== 1) { + $ERROR('#1: var obj = {}; obj.push = Array.prototype.push; obj.push(-1) === 1. Actual: ' + (push)); + } + //CHECK#2 + if (obj.length !== 1) { + $ERROR('#2: var obj = {}; obj.push = Array.prototype.push; obj.push(-1); obj.length === 1. Actual: ' + (obj.length)); + } + //CHECK#3 + if (obj["0"] !== -1) { + $ERROR('#3: var obj = {}; obj.push = Array.prototype.push; obj.push(-1); obj["0"] === -1. Actual: ' + (obj["0"])); + } } //CHECK#4 diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T2.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T2.js index 04ab24c3c44e2bb6b544cc05d4e49eb59e46fefd..6c5c1c4adc69441114bc229b3fc8a39a248987d1 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T2.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T2.js @@ -35,7 +35,9 @@ if (obj["0"] !== -1) { //CHECK#4 obj.length = Number.POSITIVE_INFINITY; -assert.throws(TypeError, function() { obj.push(-4); }); +assert.throws(TypeError, function() { + obj.push(-4); +}); //CHECK#5 if (obj.length !== Number.POSITIVE_INFINITY) { diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T3.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T3.js index f92536cc6a20805b7d6cad23ef979e4021bc111c..32aa882169647fa7f6d5929f5fbc1b11d93d974a 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T3.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T3.js @@ -16,21 +16,39 @@ var obj = {}; obj.push = Array.prototype.push; //CHECK#1 -obj.length = {valueOf: function() {return 3}}; +obj.length = { + valueOf: function() { + return 3 + } +}; var push = obj.push(); if (push !== 3) { $ERROR('#1: obj.length = {valueOf: function() {return 3}} obj.push() === 3. Actual: ' + (push)); } //CHECK#2 -obj.length = {valueOf: function() {return 3}, toString: function() {return 1}}; +obj.length = { + valueOf: function() { + return 3 + }, + toString: function() { + return 1 + } +}; var push = obj.push(); if (push !== 3) { $ERROR('#0: obj.length = {valueOf: function() {return 3}, toString: function() {return 1}} obj.push() === 3. Actual: ' + (push)); } //CHECK#3 -obj.length = {valueOf: function() {return 3}, toString: function() {return {}}}; +obj.length = { + valueOf: function() { + return 3 + }, + toString: function() { + return {} + } +}; var push = obj.push(); if (push !== 3) { $ERROR('#1: obj.length = {valueOf: function() {return 3}, toString: function() {return {}}} obj.push() === 3. Actual: ' + (push)); @@ -39,9 +57,16 @@ if (push !== 3) { //CHECK#4 try { - obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; + obj.length = { + valueOf: function() { + return 3 + }, + toString: function() { + throw "error" + } + }; var push = obj.push(); -if (push !== 3) { + if (push !== 3) { $ERROR('#4.1: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.push() === ",". Actual: ' + (push)); } } @@ -54,14 +79,25 @@ catch (e) { } //CHECK#5 -obj.length = {toString: function() {return 1}}; +obj.length = { + toString: function() { + return 1 + } +}; var push = obj.push(); if (push !== 1) { $ERROR('#5: obj.length = {toString: function() {return 1}} obj.push() === 1. Actual: ' + (push)); } //CHECK#6 -obj.length = {valueOf: function() {return {}}, toString: function() {return 1}} +obj.length = { + valueOf: function() { + return {} + }, + toString: function() { + return 1 + } +} var push = obj.push(); if (push !== 1) { $ERROR('#6: obj.length = {valueOf: function() {return {}}, toString: function() {return 1}} obj.push() === 1. Actual: ' + (push)); @@ -70,7 +106,14 @@ if (push !== 1) { //CHECK#7 try { - obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; + obj.length = { + valueOf: function() { + throw "error" + }, + toString: function() { + return 1 + } + }; var push = obj.push(); $ERROR('#7.1: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; obj.push() throw "error". Actual: ' + (push)); } @@ -83,7 +126,14 @@ catch (e) { //CHECK#8 try { - obj.length = {valueOf: function() {return {}}, toString: function() {return {}}}; + obj.length = { + valueOf: function() { + return {} + }, + toString: function() { + return {} + } + }; var push = obj.push(); $ERROR('#8.1: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.push() throw TypeError. Actual: ' + (push)); } diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A3.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A3.js index dd596aefd50969c2c2055ef2a339ff92da2b0504..d9b26a6e3402934657dacaa946374d4ef0c0a1de 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A3.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A3.js @@ -21,7 +21,7 @@ if (push !== 4294967295) { try { x.push("x"); $ERROR('#2.1: x = []; x.length = 4294967295; x.push("x") throw RangeError. Actual: ' + (push)); -} catch(e) { +} catch (e) { if ((e instanceof RangeError) !== true) { $ERROR('#2.2: x = []; x.length = 4294967295; x.push("x") throw RangeError. Actual: ' + (e)); } @@ -29,10 +29,10 @@ try { //CHECK#3 if (x[4294967295] !== "x") { - $ERROR('#3: x = []; x.length = 4294967295; try {x.push("x")}catch(e){}; x[4294967295] === "x". Actual: ' + (x[4294967295])); + $ERROR('#3: x = []; x.length = 4294967295; try {x.push("x")}catch(e){}; x[4294967295] === "x". Actual: ' + (x[4294967295])); } //CHECK#4 if (x.length !== 4294967295) { - $ERROR('#4: x = []; x.length = 4294967295; try {x.push("x")}catch(e){}; x.length === 4294967295. Actual: ' + (x.length)); + $ERROR('#4: x = []; x.length = 4294967295; try {x.push("x")}catch(e){}; x.length === 4294967295. Actual: ' + (x.length)); } diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T1.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T1.js index bc762776c5075b927087f5fda41980cc52ab78e1..90ed3ae4cf46b3d6fc0fb119ad8fd3d65e5b2524 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T1.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T1.js @@ -25,32 +25,32 @@ if (obj.length !== 4294967299) { //CHECK#3 if (obj[0] !== undefined) { - $ERROR('#3: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[0] === undefined. Actual: ' + (obj[0])); + $ERROR('#3: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[0] === undefined. Actual: ' + (obj[0])); } //CHECK#4 if (obj[1] !== undefined) { - $ERROR('#4: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[1] === undefined. Actual: ' + (obj[1])); + $ERROR('#4: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[1] === undefined. Actual: ' + (obj[1])); } //CHECK#5 if (obj[2] !== undefined) { - $ERROR('#5: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[2] === undefined. Actual: ' + (obj[2])); + $ERROR('#5: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[2] === undefined. Actual: ' + (obj[2])); } //CHECK#6 if (obj[4294967296] !== "x") { - $ERROR('#6: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[4294967296] === "x". Actual: ' + (obj[4294967296])); + $ERROR('#6: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[4294967296] === "x". Actual: ' + (obj[4294967296])); } //CHECK#7 if (obj[4294967297] !== "y") { - $ERROR('#7: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[4294967297] === "y". Actual: ' + (obj[4294967297])); + $ERROR('#7: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[4294967297] === "y". Actual: ' + (obj[4294967297])); } //CHECK#8 if (obj[4294967298] !== "z") { - $ERROR('#8: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[4294967298] === "z". Actual: ' + (obj[4294967298])); + $ERROR('#8: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[4294967298] === "z". Actual: ' + (obj[4294967298])); } var obj = {}; diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T2.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T2.js index 22a2c5b432b0c9debefe1c7b4f7dc74343467097..0ed4b027c45b18fdfad4f79713a0cb7cb7baa4ef 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T2.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T2.js @@ -25,15 +25,15 @@ if (obj.length !== 4294967298) { //CHECK#3 if (obj[4294967295] !== "x") { - $ERROR('#3: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967295; obj.push("x", "y", "z"); obj[4294967295] === "x". Actual: ' + (obj[4294967295])); + $ERROR('#3: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967295; obj.push("x", "y", "z"); obj[4294967295] === "x". Actual: ' + (obj[4294967295])); } //CHECK#4 if (obj[4294967296] !== "y") { - $ERROR('#4: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967295; obj.push("x", "y", "z"); obj[4294967296] === "y". Actual: ' + (obj[4294967296])); + $ERROR('#4: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967295; obj.push("x", "y", "z"); obj[4294967296] === "y". Actual: ' + (obj[4294967296])); } //CHECK#5 if (obj[4294967297] !== "z") { - $ERROR('#5: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967295; obj.push("x", "y", "z"); obj[4294967297] === "z". Actual: ' + (obj[4294967297])); + $ERROR('#5: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967295; obj.push("x", "y", "z"); obj[4294967297] === "z". Actual: ' + (obj[4294967297])); } diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T3.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T3.js index 464dcacca498e967ac87d9eeedee0cbd116c4d5f..afaf0b143dad067ae9c772722a720771cffd1719 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T3.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T3.js @@ -25,30 +25,30 @@ if (obj.length !== 3) { //CHECK#3 if (obj[4294967295] !== undefined) { - $ERROR('#3: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[4294967295] === undefined. Actual: ' + (obj[4294967295])); + $ERROR('#3: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[4294967295] === undefined. Actual: ' + (obj[4294967295])); } //CHECK#4 if (obj[4294967296] !== undefined) { - $ERROR('#4: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[4294967296] === undefined. Actual: ' + (obj[4294967296])); + $ERROR('#4: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[4294967296] === undefined. Actual: ' + (obj[4294967296])); } //CHECK#5 if (obj[4294967297] !== undefined) { - $ERROR('#5: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[4294967297] === undefined. Actual: ' + (obj[4294967297])); + $ERROR('#5: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[4294967297] === undefined. Actual: ' + (obj[4294967297])); } //CHECK#6 if (obj[0] !== "x") { - $ERROR('#3: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[0] === "x". Actual: ' + (obj[0])); + $ERROR('#3: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[0] === "x". Actual: ' + (obj[0])); } //CHECK#7 if (obj[1] !== "y") { - $ERROR('#4: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[1] === "y". Actual: ' + (obj[1])); + $ERROR('#4: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[1] === "y". Actual: ' + (obj[1])); } //CHECK#8 if (obj[2] !== "z") { - $ERROR('#5: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[2] === "z". Actual: ' + (obj[2])); + $ERROR('#5: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[2] === "z". Actual: ' + (obj[2])); } diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A5_T1.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A5_T1.js index 6cbf65e0745f3fb91f0f568d8666876e29ac51b6..70f1b41ac3ae789c20041a436d87e266e582e983 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A5_T1.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A5_T1.js @@ -13,7 +13,9 @@ description: > Object.prototype[1] = -1; Object.prototype.length = 1; Object.prototype.push = Array.prototype.push; -var x = {0:0}; +var x = { + 0: 0 +}; //CHECK#1 var push = x.push(1); diff --git a/test/built-ins/Array/prototype/push/clamps-to-integer-limit.js b/test/built-ins/Array/prototype/push/clamps-to-integer-limit.js index d4100dd0c0506851563399cb68233f9dd2a0d0ac..9cfc323fc30137cb8bd9c51a95bd9a68d9fec057 100644 --- a/test/built-ins/Array/prototype/push/clamps-to-integer-limit.js +++ b/test/built-ins/Array/prototype/push/clamps-to-integer-limit.js @@ -18,18 +18,18 @@ info: | var arrayLike = {}; -arrayLike.length = 2**53 - 1; +arrayLike.length = 2 ** 53 - 1; Array.prototype.push.call(arrayLike); -assert.sameValue(arrayLike.length, 2**53 - 1, "Length is 2**53 - 1"); +assert.sameValue(arrayLike.length, 2 ** 53 - 1, "Length is 2**53 - 1"); -arrayLike.length = 2**53; +arrayLike.length = 2 ** 53; Array.prototype.push.call(arrayLike); -assert.sameValue(arrayLike.length, 2**53 - 1, "Length is 2**53"); +assert.sameValue(arrayLike.length, 2 ** 53 - 1, "Length is 2**53"); -arrayLike.length = 2**53 + 2; +arrayLike.length = 2 ** 53 + 2; Array.prototype.push.call(arrayLike); -assert.sameValue(arrayLike.length, 2**53 - 1, "Length is 2**53 + 2"); +assert.sameValue(arrayLike.length, 2 ** 53 - 1, "Length is 2**53 + 2"); arrayLike.length = Infinity; Array.prototype.push.call(arrayLike); -assert.sameValue(arrayLike.length, 2**53 - 1, "Length is Infinity"); +assert.sameValue(arrayLike.length, 2 ** 53 - 1, "Length is Infinity"); diff --git a/test/built-ins/Array/prototype/push/length-near-integer-limit.js b/test/built-ins/Array/prototype/push/length-near-integer-limit.js index b727b51157ccaf2dfdae422ab0351de33e796cb0..4c94e29873a07f7925f05a1a0729b66ac8cd9135 100644 --- a/test/built-ins/Array/prototype/push/length-near-integer-limit.js +++ b/test/built-ins/Array/prototype/push/length-near-integer-limit.js @@ -21,19 +21,19 @@ var arrayLike = { "9007199254740989": "9007199254740989", /* "9007199254740990": empty */ "9007199254740991": "9007199254740991", - length: 2**53 - 2 + length: 2 ** 53 - 2 }; Array.prototype.push.call(arrayLike, "new-value"); -assert.sameValue(arrayLike.length, 2**53 - 1, - "New arrayLike.length is 2**53 - 1"); +assert.sameValue(arrayLike.length, 2 ** 53 - 1, + "New arrayLike.length is 2**53 - 1"); assert.sameValue(arrayLike["9007199254740989"], "9007199254740989", - "arrayLike['9007199254740989'] is unchanged"); + "arrayLike['9007199254740989'] is unchanged"); assert.sameValue(arrayLike["9007199254740990"], "new-value", - "arrayLike['9007199254740990'] has new value"); + "arrayLike['9007199254740990'] has new value"); assert.sameValue(arrayLike["9007199254740991"], "9007199254740991", - "arrayLike['9007199254740991'] is unchanged"); + "arrayLike['9007199254740991'] is unchanged"); diff --git a/test/built-ins/Array/prototype/push/throws-if-integer-limit-exceeded.js b/test/built-ins/Array/prototype/push/throws-if-integer-limit-exceeded.js index 1542fd02569f990d40bdbe4b36435f922c5fc676..ae71cd417aecbe87082ff8ff9997a4d92364d2db 100644 --- a/test/built-ins/Array/prototype/push/throws-if-integer-limit-exceeded.js +++ b/test/built-ins/Array/prototype/push/throws-if-integer-limit-exceeded.js @@ -17,17 +17,17 @@ info: | var arrayLike = {}; -arrayLike.length = 2**53 - 1; +arrayLike.length = 2 ** 53 - 1; assert.throws(TypeError, function() { Array.prototype.push.call(arrayLike, null); }, "Length is 2**53 - 1"); -arrayLike.length = 2**53; +arrayLike.length = 2 ** 53; assert.throws(TypeError, function() { Array.prototype.push.call(arrayLike, null); }, "Length is 2**53"); -arrayLike.length = 2**53 + 2; +arrayLike.length = 2 ** 53 + 2; assert.throws(TypeError, function() { Array.prototype.push.call(arrayLike, null); }, "Length is 2**53 + 2"); 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 fdb550a91ab9da49bb13ae617e8747e0c5c54c1e..264cd7934a39883cc11a480cc47bf48d2f3d4b5c 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 @@ -9,5 +9,5 @@ description: Array.prototype.reduce applied to undefined assert.throws(TypeError, function() { - Array.prototype.reduce.call(undefined); + Array.prototype.reduce.call(undefined); }); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-10.js index d24e9841c1610adba02081751090cab228b88801..04bb5ee2a3f247517169a4bd21710126122ee6d2 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-10.js @@ -7,11 +7,11 @@ es5id: 15.4.4.21-1-10 description: Array.prototype.reduce applied to the Math object ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return ('[object Math]' === Object.prototype.toString.call(obj)); - } +function callbackfn(prevVal, curVal, idx, obj) { + return ('[object Math]' === Object.prototype.toString.call(obj)); +} - Math.length = 1; - Math[0] = 1; +Math.length = 1; +Math[0] = 1; assert(Array.prototype.reduce.call(Math, callbackfn, 1), 'Array.prototype.reduce.call(Math, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-11.js index 4f4a9d6fd87cf807e25f31f5ce59b5697e881c4d..67534e33994fa6f7e4e0ca07863b8bf455a88b74 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-11.js @@ -7,12 +7,12 @@ es5id: 15.4.4.21-1-11 description: Array.prototype.reduce applied to Date object ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return obj instanceof Date; - } +function callbackfn(prevVal, curVal, idx, obj) { + return obj instanceof Date; +} - var obj = new Date(); - obj.length = 1; - obj[0] = 1; +var obj = new Date(); +obj.length = 1; +obj[0] = 1; assert(Array.prototype.reduce.call(obj, callbackfn, 1), 'Array.prototype.reduce.call(obj, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-12.js index 7e9604d556d232570404276f1adab1fa525dee9e..ade27ade62e70f22ff726e9faf683092475326f3 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-12.js @@ -7,12 +7,12 @@ es5id: 15.4.4.21-1-12 description: Array.prototype.reduce applied to RegExp object ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return obj instanceof RegExp; - } +function callbackfn(prevVal, curVal, idx, obj) { + return obj instanceof RegExp; +} - var obj = new RegExp(); - obj.length = 1; - obj[0] = 1; +var obj = new RegExp(); +obj.length = 1; +obj[0] = 1; assert(Array.prototype.reduce.call(obj, callbackfn, 1), 'Array.prototype.reduce.call(obj, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-13.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-13.js index 88633083943d5c933954b3ba946bc917b199484d..3bdd3e1723683793ee19962c5c2cb0cbec7e78c8 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-13.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-13.js @@ -7,11 +7,11 @@ es5id: 15.4.4.21-1-13 description: Array.prototype.reduce applied to the JSON object ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return ('[object JSON]' === Object.prototype.toString.call(obj)); - } +function callbackfn(prevVal, curVal, idx, obj) { + return ('[object JSON]' === Object.prototype.toString.call(obj)); +} - JSON.length = 1; - JSON[0] = 1; +JSON.length = 1; +JSON[0] = 1; assert(Array.prototype.reduce.call(JSON, callbackfn, 1), 'Array.prototype.reduce.call(JSON, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-14.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-14.js index ae958b3d21afdd0b1228ae058c4598fd41874db0..424e1e69f2fdedb931d2d9d8f1350e5740f94dc5 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-14.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-14.js @@ -7,12 +7,12 @@ es5id: 15.4.4.21-1-14 description: Array.prototype.reduce applied to Error object ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return obj instanceof Error; - } +function callbackfn(prevVal, curVal, idx, obj) { + return obj instanceof Error; +} - var obj = new Error(); - obj.length = 1; - obj[0] = 1; +var obj = new Error(); +obj.length = 1; +obj[0] = 1; assert(Array.prototype.reduce.call(obj, callbackfn, 1), 'Array.prototype.reduce.call(obj, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-15.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-15.js index efa389f9db384631569335d7140dfa73d3ee395f..a5387f27805db5d0c8dc0202d1804e1bbc5a3c34 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-15.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-15.js @@ -7,12 +7,12 @@ es5id: 15.4.4.21-1-15 description: Array.prototype.reduce applied to the Arguments object ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return ('[object Arguments]' === Object.prototype.toString.call(obj)); - } +function callbackfn(prevVal, curVal, idx, obj) { + return ('[object Arguments]' === Object.prototype.toString.call(obj)); +} - var obj = (function () { - return arguments; - }("a", "b")); +var obj = (function() { + return arguments; +}("a", "b")); assert(Array.prototype.reduce.call(obj, callbackfn, 1), 'Array.prototype.reduce.call(obj, callbackfn, 1) !== true'); 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 709021d9a782a62966f8daa6aaf1c10d3f82866f..b070b9ea19337b9e33321e08d5ea85c79d123813 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 @@ -9,5 +9,5 @@ description: Array.prototype.reduce applied to null assert.throws(TypeError, function() { - Array.prototype.reduce.call(null); + Array.prototype.reduce.call(null); }); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-3.js index ae7e782149107e6bb0b5e10781fdc5034b2095b2..833762b496ff7d11e8125b08d59cdce9ea27c2d2 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-3.js @@ -7,11 +7,11 @@ es5id: 15.4.4.21-1-3 description: Array.prototype.reduce applied to boolean primitive ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return obj instanceof Boolean; - } +function callbackfn(prevVal, curVal, idx, obj) { + return obj instanceof Boolean; +} - Boolean.prototype[0] = true; - Boolean.prototype.length = 1; +Boolean.prototype[0] = true; +Boolean.prototype.length = 1; assert(Array.prototype.reduce.call(false, callbackfn, 1), 'Array.prototype.reduce.call(false, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-4.js index 33519f325ad4470c9cffd627c61f252d47981b17..c08a750771c1fe93a806f4c438f1535ee755e7fb 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-4.js @@ -7,13 +7,13 @@ es5id: 15.4.4.21-1-4 description: Array.prototype.reduce applied to Boolean object ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return obj instanceof Boolean; - } +function callbackfn(prevVal, curVal, idx, obj) { + return obj instanceof Boolean; +} - var obj = new Boolean(true); - obj.length = 2; - obj[0] = 11; - obj[1] = 12; +var obj = new Boolean(true); +obj.length = 2; +obj[0] = 11; +obj[1] = 12; assert(Array.prototype.reduce.call(obj, callbackfn, 1), 'Array.prototype.reduce.call(obj, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-5.js index 20ca2f99f5441ec7cce97016ca657d311370b2cd..8314bea9bd989314680782c051c663a1e89cd39e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-5.js @@ -7,11 +7,11 @@ es5id: 15.4.4.21-1-5 description: Array.prototype.reduce applied to number primitive ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return obj instanceof Number; - } +function callbackfn(prevVal, curVal, idx, obj) { + return obj instanceof Number; +} - Number.prototype[0] = 1; - Number.prototype.length = 1; +Number.prototype[0] = 1; +Number.prototype.length = 1; assert(Array.prototype.reduce.call(2.5, callbackfn, 1), 'Array.prototype.reduce.call(2.5, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-6.js index 55eba5ba35755a497f6476e1255f5ceb0b0c7703..4ab488dc4c0d4b1dcaed3359cdf858baca8d6d1e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-6.js @@ -7,13 +7,13 @@ es5id: 15.4.4.21-1-6 description: Array.prototype.reduce applied to Number object ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return obj instanceof Number; - } +function callbackfn(prevVal, curVal, idx, obj) { + return obj instanceof Number; +} - var obj = new Number(-128); - obj.length = 2; - obj[0] = 11; - obj[1] = 12; +var obj = new Number(-128); +obj.length = 2; +obj[0] = 11; +obj[1] = 12; assert(Array.prototype.reduce.call(obj, callbackfn, 1), 'Array.prototype.reduce.call(obj, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-7.js index ca99114882f18b72ee40495a4353f46e32e6c226..6869f90c099f9b65af742b7aba60ce4f1dca314d 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-7.js @@ -7,8 +7,8 @@ es5id: 15.4.4.21-1-7 description: Array.prototype.reduce applied to string primitive ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return obj instanceof String; - } +function callbackfn(prevVal, curVal, idx, obj) { + return obj instanceof String; +} assert(Array.prototype.reduce.call("abc", callbackfn, 1), 'Array.prototype.reduce.call("abc", callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-8.js index 169467bb27539b8958031e064aca58fe4a1ab023..96635cee29a2ec68d5692369210dbde6f1768d67 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-8.js @@ -7,10 +7,10 @@ es5id: 15.4.4.21-1-8 description: Array.prototype.reduce applied to String object ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return obj instanceof String; - } +function callbackfn(prevVal, curVal, idx, obj) { + return obj instanceof String; +} - var obj = new String("abc"); +var obj = new String("abc"); assert(Array.prototype.reduce.call(obj, callbackfn, 1), 'Array.prototype.reduce.call(obj, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-9.js index dd00fe9bba10f28b8fe3ff0e3f512b15202c8d29..b2bd796bb75fc9293a8d859cda33e730080fb2e7 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-9.js @@ -7,14 +7,14 @@ es5id: 15.4.4.21-1-9 description: Array.prototype.reduce applied to Function object ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return obj instanceof Function; - } +function callbackfn(prevVal, curVal, idx, obj) { + return obj instanceof Function; +} - var obj = function (a, b) { - return a + b; - }; - obj[0] = 11; - obj[1] = 9; +var obj = function(a, b) { + return a + b; +}; +obj[0] = 11; +obj[1] = 9; assert(Array.prototype.reduce.call(obj, callbackfn, 1), 'Array.prototype.reduce.call(obj, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-1.js index ae5680106eb88b08d634a2d2d45d69188b197f63..777c4d3f8a1ca0db8386ded9e785f301d5508419 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-1.js @@ -9,12 +9,12 @@ description: > called on ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - return 1; - } - var srcArr = [1,2,3,4,5]; - srcArr.reduce(callbackfn); +function callbackfn(prevVal, curVal, idx, obj) +{ + return 1; +} +var srcArr = [1, 2, 3, 4, 5]; +srcArr.reduce(callbackfn); assert.sameValue(srcArr[0], 1, 'srcArr[0]'); assert.sameValue(srcArr[1], 2, 'srcArr[1]'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-2.js index 57b27d794387849ad0532db89bf80405e87fc16f..a01a48c92cb91cc45035f0676ea7e12295be12dd 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-2.js @@ -9,10 +9,10 @@ description: > indices ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - return prevVal + curVal; - } - var srcArr = ['1','2','3','4','5']; +function callbackfn(prevVal, curVal, idx, obj) +{ + return prevVal + curVal; +} +var srcArr = ['1', '2', '3', '4', '5']; assert.sameValue(srcArr.reduce(callbackfn), '12345', 'srcArr.reduce(callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-3.js index ee1cd1801cbfef7552ab31e5c3d576299321e161..5174a6300fc64f3683b2fad40baaf4f6bcc0e077 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-3.js @@ -7,10 +7,11 @@ es5id: 15.4.4.21-10-3 description: Array.prototype.reduce - subclassed array of length 1 ---*/ - foo.prototype = [1]; - function foo() {} - var f = new foo(); +foo.prototype = [1]; - function cb(){} +function foo() {} +var f = new foo(); + +function cb() {} assert.sameValue(f.reduce(cb), 1, 'f.reduce(cb)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-4.js index 5dcd159f6e1d90a88924a313b3b36eb623b75d9a..e84e53a710a48935aecc11502daf0dd9860862de 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-4.js @@ -7,10 +7,13 @@ es5id: 15.4.4.21-10-4 description: Array.prototype.reduce - subclassed array with length more than 1 ---*/ - foo.prototype = new Array(1, 2, 3, 4); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3, 4); - function cb(prevVal, curVal, idx, obj){return prevVal + curVal;} +function foo() {} +var f = new foo(); + +function cb(prevVal, curVal, idx, obj) { + return prevVal + curVal; +} assert.sameValue(f.reduce(cb), 10, 'f.reduce(cb)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-5.js index f7778c537f53519f102cd42ac354377dcb6b42d6..82c843ecd4869f757445ddcb0644a629d3938ed9 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-5.js @@ -9,10 +9,10 @@ description: > indices(initialvalue present) ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - return prevVal + curVal; - } - var srcArr = ['1','2','3','4','5']; +function callbackfn(prevVal, curVal, idx, obj) +{ + return prevVal + curVal; +} +var srcArr = ['1', '2', '3', '4', '5']; -assert.sameValue(srcArr.reduce(callbackfn,'0'), '012345', 'srcArr.reduce(callbackfn,"0")'); +assert.sameValue(srcArr.reduce(callbackfn, '0'), '012345', 'srcArr.reduce(callbackfn,"0")'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-6.js index 5babbe757bc8ce6f44d392884e7b4971e9ffc9a6..35e50b1262dbfb04e0768a3d4dd1fcbd15b52421 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-6.js @@ -9,10 +9,13 @@ description: > provided ---*/ - foo.prototype = [1,2,3,4]; - function foo() {} - var f = new foo(); +foo.prototype = [1, 2, 3, 4]; - function cb(prevVal, curVal, idx, obj){return prevVal + curVal;} +function foo() {} +var f = new foo(); -assert.sameValue(f.reduce(cb,-1), 9, 'f.reduce(cb,-1)'); +function cb(prevVal, curVal, idx, obj) { + return prevVal + curVal; +} + +assert.sameValue(f.reduce(cb, -1), 9, 'f.reduce(cb,-1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-7.js index e0cd77f6356b80a82ea6938bd6dbd217de76b3e0..1725c367ea54e420d30c356a84f87786c35bf35e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-7.js @@ -9,10 +9,13 @@ description: > initialvalue provided ---*/ - foo.prototype = [1]; - function foo() {} - var f = new foo(); +foo.prototype = [1]; - function cb(prevVal, curVal, idx, obj){return prevVal + curVal;} +function foo() {} +var f = new foo(); -assert.sameValue(f.reduce(cb,-1), 0, 'f.reduce(cb,-1)'); +function cb(prevVal, curVal, idx, obj) { + return prevVal + curVal; +} + +assert.sameValue(f.reduce(cb, -1), 0, 'f.reduce(cb,-1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-8.js index abb4066ee7095cffba2068870efd975d41c8d9f7..3f1ffdcb4785e00204961efc394401626bb2bdd3 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-8.js @@ -7,15 +7,16 @@ es5id: 15.4.4.21-10-8 description: Array.prototype.reduce doesn't visit expandos ---*/ - var callCnt = 0; - function callbackfn(prevVal, curVal, idx, obj) - { - callCnt++; - return curVal; - } - var srcArr = ['1','2','3','4','5']; - srcArr["i"] = 10; - srcArr[true] = 11; - srcArr.reduce(callbackfn); +var callCnt = 0; + +function callbackfn(prevVal, curVal, idx, obj) +{ + callCnt++; + return curVal; +} +var srcArr = ['1', '2', '3', '4', '5']; +srcArr["i"] = 10; +srcArr[true] = 11; +srcArr.reduce(callbackfn); assert.sameValue(callCnt, 4, 'callCnt'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-1.js index 700961b96eee9be3d23a35e522a04ea826744b47..4e5e8bb973aad5143888b222f1bd31f382a85c6b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-1.js @@ -9,15 +9,15 @@ description: > Array-like object ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (obj.length === 2); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (obj.length === 2); +} - var obj = { - 0: 12, - 1: 11, - 2: 9, - length: 2 - }; +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: 2 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-10.js index 41de90c5c3e6b184c23e252acf9a5c97cadaacc0..18e09d6d32b4c7a64a9b7aee687731ff45709788 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-10.js @@ -9,25 +9,25 @@ description: > an inherited accessor property ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (obj.length === 2); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (obj.length === 2); +} - var proto = {}; +var proto = {}; - Object.defineProperty(proto, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(proto, "length", { + get: function() { + return 2; + }, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[0] = 12; - child[1] = 11; - child[2] = 9; +var child = new Con(); +child[0] = 12; +child[1] = 11; +child[2] = 9; assert.sameValue(Array.prototype.reduce.call(child, callbackfn, 1), true, 'Array.prototype.reduce.call(child, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-11.js index 25cf0e462f3f57e564dc2daa9036a99d31fd8f4e..9dd5748b689639c6be80c54a6d4278e0f10e70f7 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-11.js @@ -9,19 +9,20 @@ description: > an own accessor property without a get function ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - } +var accessed = false; - var obj = { - 0: 11, - 1: 12 - }; - Object.defineProperty(obj, "length", { - set: function () { }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; +} + +var obj = { + 0: 11, + 1: 12 +}; +Object.defineProperty(obj, "length", { + set: function() {}, + configurable: true +}); assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-12.js index 375fa552d67b5e612c2e775c8093529be6edf688..da2f2a6ac3b92edb329d1e08f31d35d83ff39cf7 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-12.js @@ -10,23 +10,27 @@ description: > Array ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - } +var accessed = false; - Object.defineProperty(Object.prototype, "length", { - get: function () { - return 2; - }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; +} - var obj = { 0: 12, 1: 11 }; - Object.defineProperty(obj, "length", { - set: function () { }, - configurable: true - }); +Object.defineProperty(Object.prototype, "length", { + get: function() { + return 2; + }, + configurable: true +}); + +var obj = { + 0: 12, + 1: 11 +}; +Object.defineProperty(obj, "length", { + set: function() {}, + configurable: true +}); assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-13.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-13.js index 2be60731593b85001aa9725dcfd8dfc679f4bd8d..7f125029277cc3fc7763e6b598c1a80a77adce4b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-13.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-13.js @@ -9,24 +9,24 @@ description: > is inherited accessor property without a get function ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; +} - var proto = {}; - Object.defineProperty(proto, "length", { - set: function () { }, - configurable: true - }); +var proto = {}; +Object.defineProperty(proto, "length", { + set: function() {}, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[0] = 11; - child[1] = 12; +var child = new Con(); +child[0] = 11; +child[1] = 12; assert.sameValue(Array.prototype.reduce.call(child, callbackfn, 1), 1, 'Array.prototype.reduce.call(child, callbackfn, 1)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-14.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-14.js index 3ed0c858f5add1a763c76e8bbab575eece3e64d0..f21ee41e7191c4e8c2ac518b11f2dedbec62f9d1 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-14.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-14.js @@ -9,13 +9,16 @@ description: > 'length' property doesn't exist ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; +} - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-17.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-17.js index 2d0636319810ffec74f54484964e6085c271718f..c53ac5820dd1c6eb7ee2677909ab02ebc717604f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-17.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-17.js @@ -9,13 +9,13 @@ description: > implements its own property get method ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (obj.length === 2); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (obj.length === 2); +} - var func = function (a, b) { - arguments[2] = 9; - return Array.prototype.reduce.call(arguments, callbackfn, 1); - }; +var func = function(a, b) { + arguments[2] = 9; + return Array.prototype.reduce.call(arguments, callbackfn, 1); +}; assert.sameValue(func(12, 11), true, 'func(12, 11)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-18.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-18.js index 6e50eadc58632a16bd73ef3d0f2fdb5016a52b86..43c4f960d126b9e6369c227c52de1c45c6396cd6 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-18.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-18.js @@ -9,10 +9,10 @@ description: > its own property get method ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (obj.length === 3); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (obj.length === 3); +} - var str = new String("012"); +var str = new String("012"); assert.sameValue(Array.prototype.reduce.call(str, callbackfn, 1), true, 'Array.prototype.reduce.call(str, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-19.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-19.js index 5b9a2c1c8dc30343a75fa67a472f2ff4cc066189..02eaafd2be782214d22c630bb62b2a530e7ee48c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-19.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-19.js @@ -9,15 +9,15 @@ description: > implements its own property get method ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (obj.length === 2); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (obj.length === 2); +} - var fun = function (a, b) { - return a + b; - }; - fun[0] = 12; - fun[1] = 11; - fun[2] = 9; +var fun = function(a, b) { + return a + b; +}; +fun[0] = 12; +fun[1] = 11; +fun[2] = 9; assert.sameValue(Array.prototype.reduce.call(fun, callbackfn, 1), true, 'Array.prototype.reduce.call(fun, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-2.js index 0770dea2b9a363df98b14046c90424b32f979db5..6b63af80a9b10afef707c609e48d4466ea813364 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-2.js @@ -7,8 +7,8 @@ es5id: 15.4.4.21-2-2 description: Array.prototype.reduce - 'length' is own data property on an Array ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (obj.length === 2); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (obj.length === 2); +} assert.sameValue([12, 11].reduce(callbackfn, 1), true, '[12, 11].reduce(callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-3.js index 7abfa8846f81a9c4362399847e6ddcd6f36469a5..ae2642759dc584f3bb7031469637ee09b312afa7 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-3.js @@ -9,19 +9,21 @@ description: > overrides an inherited data property on an Array-like object ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (obj.length === 2); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (obj.length === 2); +} - var proto = { length: 3 }; +var proto = { + length: 3 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 2; - child[0] = 12; - child[1] = 11; - child[2] = 9; +var child = new Con(); +child.length = 2; +child[0] = 12; +child[1] = 11; +child[2] = 9; assert.sameValue(Array.prototype.reduce.call(child, callbackfn, 1), true, 'Array.prototype.reduce.call(child, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-4.js index f1acd1884a6ce4cff90e01a68aa50d9c58f0541f..a2666931e990d83dc54dd765921295d4f1e65bdb 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-4.js @@ -9,13 +9,13 @@ description: > overrides an inherited data property on an Array ---*/ - var storeProtoLength; +var storeProtoLength; - function callbackfn(prevVal, curVal, idx, obj) { - return (obj.length === 2); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (obj.length === 2); +} - storeProtoLength = Array.prototype.length; - Array.prototype.length = 0; +storeProtoLength = Array.prototype.length; +Array.prototype.length = 0; assert.sameValue([12, 11].reduce(callbackfn, 1), true, '[12, 11].reduce(callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-5.js index 2b000ba6a3cf9c24fc622dfdc327a53351f2fd3b..5e826cf7415801f43327a3eac74b34e387c30c8f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-5.js @@ -9,29 +9,29 @@ description: > an own data property that overrides an inherited accessor property ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (obj.length === 2); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (obj.length === 2); +} - var proto = {}; +var proto = {}; - Object.defineProperty(proto, "length", { - get: function () { - return 3; - }, - configurable: true - }); +Object.defineProperty(proto, "length", { + get: function() { + return 3; + }, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - Object.defineProperty(child, "length", { - value: 2, - configurable: true - }); - child[0] = 12; - child[1] = 11; - child[2] = 9; +var child = new Con(); +Object.defineProperty(child, "length", { + value: 2, + configurable: true +}); +child[0] = 12; +child[1] = 11; +child[2] = 9; assert.sameValue(Array.prototype.reduce.call(child, callbackfn, 1), true, 'Array.prototype.reduce.call(child, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-6.js index 9385b2243365d99208dc855e79d9247dd15a419b..9088ded910abbe3747f2af684047a709cb4d6e72 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-6.js @@ -9,18 +9,20 @@ description: > an inherited data property ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (obj.length === 2); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (obj.length === 2); +} - var proto = { length: 2 }; +var proto = { + length: 2 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[0] = 12; - child[1] = 11; - child[2] = 9; +var child = new Con(); +child[0] = 12; +child[1] = 11; +child[2] = 9; assert.sameValue(Array.prototype.reduce.call(child, callbackfn, 1), true, 'Array.prototype.reduce.call(child, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-7.js index 1adfa3c8b063fdb5fb8928a549079ab7f041c100..2aea682c728d06f18541954e64b2c380c89e94d0 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-7.js @@ -9,21 +9,21 @@ description: > an own accessor property ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (obj.length === 2); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (obj.length === 2); +} - var obj = {}; +var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return 2; + }, + configurable: true +}); - obj[0] = 12; - obj[1] = 11; - obj[2] = 9; +obj[0] = 12; +obj[1] = 11; +obj[2] = 9; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-8.js index 2e76fa739282df731688a9fa9f9dd7ccdad6a9f7..6d9537535608a217d038e92c70b930adbba1a26d 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-8.js @@ -9,26 +9,28 @@ description: > an own accessor property that overrides an inherited data property ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (obj.length === 2); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (obj.length === 2); +} - var proto = { length: 3 }; +var proto = { + length: 3 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); +var child = new Con(); - Object.defineProperty(child, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(child, "length", { + get: function() { + return 2; + }, + configurable: true +}); - child[0] = 12; - child[1] = 11; - child[2] = 9; +child[0] = 12; +child[1] = 11; +child[2] = 9; assert.sameValue(Array.prototype.reduce.call(child, callbackfn, 1), true, 'Array.prototype.reduce.call(child, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-9.js index 08ef5140b97a734684fcce9c9f4cf473420dc733..34b6ca18d1ceed4a3be58226531f5f4016b7d6ed 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-9.js @@ -10,33 +10,33 @@ description: > property ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (obj.length === 2); - } - - var proto = {}; - - Object.defineProperty(proto, "length", { - get: function () { - return 3; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - - Object.defineProperty(child, "length", { - get: function () { - return 2; - }, - configurable: true - }); - - child[0] = 12; - child[1] = 11; - child[2] = 9; +function callbackfn(prevVal, curVal, idx, obj) { + return (obj.length === 2); +} + +var proto = {}; + +Object.defineProperty(proto, "length", { + get: function() { + return 3; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); + +Object.defineProperty(child, "length", { + get: function() { + return 2; + }, + configurable: true +}); + +child[0] = 12; +child[1] = 11; +child[2] = 9; assert.sameValue(Array.prototype.reduce.call(child, callbackfn, 1), true, 'Array.prototype.reduce.call(child, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-1.js index a7b0582268236c68ba4c69234785fbc79153642d..1cd10992a6a7950ca903dae7411e16686c3a382b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-1.js @@ -7,14 +7,18 @@ es5id: 15.4.4.21-3-1 description: Array.prototype.reduce - value of 'length' is undefined ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return 2; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return 2; +} - var obj = { 0: 0, 1: 1, length: undefined }; +var obj = { + 0: 0, + 1: 1, + length: undefined +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-10.js index a2c41a303551e843295e1853140d2cf120525c69..982fd8965eeee9996f67d9de4e660e7406d26124 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-10.js @@ -9,14 +9,17 @@ description: > (value is NaN) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return 2; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return 2; +} - var obj = { 0: 9, length: NaN }; +var obj = { + 0: 9, + length: NaN +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-11.js index a5bbcd485d180bba49d3c21801f8b7a211fd4242..01185212a190e0869d617a53f2d03dd1e2b20996 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-11.js @@ -9,10 +9,14 @@ description: > positive number ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (curVal === 11 && idx === 1); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (curVal === 11 && idx === 1); +} - var obj = { 1: 11, 2: 9, length: "2" }; +var obj = { + 1: 11, + 2: 9, + length: "2" +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-12.js index ca3bbd9810c13cc6ab739e43c56204a13fdc7d38..c1610fdf107d73902475231a854e3e08c411ae4f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-12.js @@ -9,10 +9,14 @@ description: > negative number ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (curVal === 11 && idx === 1); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (curVal === 11 && idx === 1); +} - var obj = { 1: 11, 2: 9, length: "-4294967294" }; +var obj = { + 1: 11, + 2: 9, + length: "-4294967294" +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-13.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-13.js index 4ab83fe8e0ab8b7a56e29e88361e5fa4eff4a77a..77c594df4888880fa996becc1e373da86cc93b09 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-13.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-13.js @@ -9,10 +9,14 @@ description: > number ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (curVal === 11 && idx === 1); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (curVal === 11 && idx === 1); +} - var obj = { 1: 11, 2: 9, length: "2.5" }; +var obj = { + 1: 11, + 2: 9, + length: "2.5" +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-14.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-14.js index 8feeae4a83e2bf72273f6b426268306ba45f77da..26bf70c04fdce50e1d90e567c99c929a655807ed 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-14.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-14.js @@ -7,14 +7,17 @@ es5id: 15.4.4.21-3-14 description: Array.prototype.reduce - 'length' is a string containing -Infinity ---*/ - var accessed2 = false; +var accessed2 = false; - function callbackfn2(prevVal, curVal, idx, obj) { - accessed2 = true; - return 2; - } +function callbackfn2(prevVal, curVal, idx, obj) { + accessed2 = true; + return 2; +} - var obj2 = { 0: 9, length: "-Infinity" }; +var obj2 = { + 0: 9, + length: "-Infinity" +}; assert.sameValue(Array.prototype.reduce.call(obj2, callbackfn2, 1), 1, 'Array.prototype.reduce.call(obj2, callbackfn2, 1)'); assert.sameValue(accessed2, false, 'accessed2'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-15.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-15.js index e17fd3d9e79dec9ffec5db1a47a97355a08ca355..a467d5ba461426aa6201ddb14e48bd7eaf204fcb 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-15.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-15.js @@ -9,10 +9,14 @@ description: > exponential number ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (curVal === 11 && idx === 1); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (curVal === 11 && idx === 1); +} - var obj = { 1: 11, 2: 9, length: "2E0" }; +var obj = { + 1: 11, + 2: 9, + length: "2E0" +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-16.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-16.js index ac8545db7b977589077c26162c044f10dab6760a..c1e8c7a11d5153ab155570efdbd9c0a21b8cb835 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-16.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-16.js @@ -9,10 +9,14 @@ description: > number ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (curVal === 11 && idx === 1); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (curVal === 11 && idx === 1); +} - var obj = { 1: 11, 2: 9, length: "0x0002" }; +var obj = { + 1: 11, + 2: 9, + length: "0x0002" +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-17.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-17.js index 8671845291e9ff3dca864c501e17d882d2bf4d60..683e3d900fbd5b38a1f34d850f5f85b477debc00 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-17.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-17.js @@ -9,10 +9,14 @@ description: > with leading zeros ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (curVal === 11 && idx === 1); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (curVal === 11 && idx === 1); +} - var obj = { 1: 11, 2: 9, length: "0002.00" }; +var obj = { + 1: 11, + 2: 9, + length: "0002.00" +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-18.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-18.js index d5705664f11e48d0957424e5a5cfb79a8df6bf86..4b797136b212c17a0a84b846fba05c1e365bcb68 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-18.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-18.js @@ -9,13 +9,17 @@ description: > convert to a number ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return 2; - } +var accessed = false; - var obj = { 0: 9, length: "asdf!_" }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return 2; +} + +var obj = { + 0: 9, + length: "asdf!_" +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-19.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-19.js index 3cc7aac5eefa9d077864de14ac499f1f0200ac2a..7d168f5e06e223f5bcd0e1b0882b3dac36fb107d 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-19.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-19.js @@ -9,18 +9,18 @@ description: > an own toString method ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (curVal === 11 && idx === 1); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (curVal === 11 && idx === 1); +} - var obj = { - 1: 11, - 2: 9, - length: { - toString: function () { - return '2'; - } - } - }; +var obj = { + 1: 11, + 2: 9, + length: { + toString: function() { + return '2'; + } + } +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-2.js index f4fc199e4425a9532e5006959f8092904c50766b..32492611fd0ff6a9105d49892325b90006151f9d 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-2.js @@ -9,10 +9,14 @@ description: > true) ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (curVal === 11 && idx === 0); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (curVal === 11 && idx === 0); +} - var obj = { 0: 11, 1: 9, length: true }; +var obj = { + 0: 11, + 1: 9, + length: true +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-20.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-20.js index b15ff9a1d0823d74f5820970c4e99467f5b5481e..32f5200bcd3f16235572ba5fcdd724ce1e130045 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-20.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-20.js @@ -9,18 +9,18 @@ description: > an own valueOf method ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (curVal === 11 && idx === 1); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (curVal === 11 && idx === 1); +} - var obj = { - 1: 11, - 2: 9, - length: { - valueOf: function () { - return 2; - } - } - }; +var obj = { + 1: 11, + 2: 9, + length: { + valueOf: function() { + return 2; + } + } +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-21.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-21.js index 1188ac3efd21389ad96a2e5b5faf0579e03b158b..9470d767963bd1eb4d6654e05d2c4a528e1068df 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-21.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-21.js @@ -10,27 +10,27 @@ description: > returns a string ---*/ - var valueOfOccured = false; - var toStringOccured = false; +var valueOfOccured = false; +var toStringOccured = false; - function callbackfn(prevVal, curVal, idx, obj) { - return (curVal === 11 && idx === 1); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (curVal === 11 && idx === 1); +} - var obj = { - 1: 11, - 2: 9, - length: { - valueOf: function () { - valueOfOccured = true; - return {}; - }, - toString: function () { - toStringOccured = true; - return '2'; - } - } - }; +var obj = { + 1: 11, + 2: 9, + length: { + valueOf: function() { + valueOfOccured = true; + return {}; + }, + toString: function() { + toStringOccured = true; + return '2'; + } + } +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); assert(valueOfOccured, 'valueOfOccured !== true'); 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 63fca1bd38c1f5237f39f309b0e89e700aee5f1e..b7d4a852c0922a2ff138929d48e633b284068e84 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 @@ -10,32 +10,32 @@ description: > primitive values ---*/ - var accessed = false; - var valueOfAccessed = false; - var toStringAccessed = false; +var accessed = false; +var valueOfAccessed = false; +var toStringAccessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return true; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return true; +} - var obj = { - 1: 11, - 2: 12, +var obj = { + 1: 11, + 2: 12, - length: { - valueOf: function () { - valueOfAccessed = true; - return {}; - }, - toString: function () { - toStringAccessed = true; - return {}; - } - } - }; + length: { + valueOf: function() { + valueOfAccessed = true; + return {}; + }, + toString: function() { + toStringAccessed = true; + return {}; + } + } +}; assert.throws(TypeError, function() { - Array.prototype.reduce.call(obj, callbackfn, 1); + Array.prototype.reduce.call(obj, callbackfn, 1); }); assert.sameValue(accessed, false, 'accessed'); assert(toStringAccessed, 'toStringAccessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-23.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-23.js index d48e58c90908f9a14a4065706dcc967b4cdce442..c281ba361e44b8e5165b5e5519044ca1711dba87 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-23.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-23.js @@ -9,35 +9,35 @@ description: > an object with an own toString and inherited valueOf methods ---*/ - var valueOfAccessed = false; - var toStringAccessed = false; - - function callbackfn(prevVal, curVal, idx, obj) { - return (curVal === 11 && idx === 1); - } - - var proto = { - valueOf: function () { - valueOfAccessed = true; - return 2; - } - }; - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - - child.toString = function () { - toStringAccessed = true; - return '1'; - }; - - var obj = { - 1: 11, - 2: 9, - length: child - }; +var valueOfAccessed = false; +var toStringAccessed = false; + +function callbackfn(prevVal, curVal, idx, obj) { + return (curVal === 11 && idx === 1); +} + +var proto = { + valueOf: function() { + valueOfAccessed = true; + return 2; + } +}; + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); + +child.toString = function() { + toStringAccessed = true; + return '1'; +}; + +var obj = { + 1: 11, + 2: 9, + length: child +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); assert(valueOfAccessed, 'valueOfAccessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-24.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-24.js index 48c4ede3ca2e0eb7c44a40954b731ad7e1d881f8..c3e969f575b2f62c4458f05fe87a3ec18ff6e026 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-24.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-24.js @@ -9,14 +9,14 @@ description: > non-integer, ensure truncation occurs in the proper direction ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (curVal === 11 && idx === 1); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (curVal === 11 && idx === 1); +} - var obj = { - 1: 11, - 2: 9, - length: 2.685 - }; +var obj = { + 1: 11, + 2: 9, + length: 2.685 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-25.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-25.js index 352c988a0a738f37ff9ea805dae4f3884c75bee6..5a8f54239c4e6a6d08e5c1708f9a6888348a2756 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-25.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-25.js @@ -9,14 +9,14 @@ description: > non-integer ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (curVal === 11 && idx === 1); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (curVal === 11 && idx === 1); +} - var obj = { - 1: 11, - 2: 9, - length: -4294967294.5 - }; +var obj = { + 1: 11, + 2: 9, + length: -4294967294.5 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-3.js index 89231153da8eb93589dc948fcfed991940fdaa5d..0fe83bd714bfbd5089497f5f82b3e179c293ebab 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-3.js @@ -7,14 +7,18 @@ es5id: 15.4.4.21-3-3 description: Array.prototype.reduce - value of 'length' is a number (value is 0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return 2; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return 2; +} - var obj = { 0: 1, 1: 1, length: 0 }; +var obj = { + 0: 1, + 1: 1, + length: 0 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-4.js index 1c6e0d988a965107519b4d71752e826243906978..864a0c1e5269c0f4613d983544b2ba7396511137 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-4.js @@ -9,14 +9,17 @@ description: > +0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return 2; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return 2; +} - var obj = { 0: 11, length: +0 }; +var obj = { + 0: 11, + length: +0 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-5.js index da3f4cf5f34052e49fff851f8552502794af93e7..0a22d02a3e683effaba0adab91527b8673875102 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-5.js @@ -9,14 +9,17 @@ description: > -0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return 2; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return 2; +} - var obj = { 0: 11, length: -0 }; +var obj = { + 0: 11, + length: -0 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-6.js index 1617a74935b53e7beeaa96e99a27109f91315825..fbee22d4254b11cf2612f7dc939d8ed4bf8a86f2 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-6.js @@ -9,10 +9,14 @@ description: > positive) ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (curVal === 11 && idx === 1); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (curVal === 11 && idx === 1); +} - var obj = { 1: 11, 2: 9, length: 2 }; +var obj = { + 1: 11, + 2: 9, + length: 2 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-7.js index b8eb598714fa946ce9ba242fc0dbaa6f29ee5520..b171abfd20f7f15d98f0eb1068a0cd64870105e5 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-7.js @@ -9,10 +9,14 @@ description: > negative) ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (curVal === 11 && idx === 1); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (curVal === 11 && idx === 1); +} - var obj = { 1: 11, 2: 9, length: -4294967294 }; +var obj = { + 1: 11, + 2: 9, + length: -4294967294 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-9.js index dc8cbfd8d64bd941b063015c2a6b06cc7fcd0a98..33c8a72d3270c63796bbd51d9f83e86a3877515b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-9.js @@ -9,13 +9,16 @@ description: > -Infinity) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; +} - var obj = { 0: 9, length: -Infinity }; +var obj = { + 0: 9, + length: -Infinity +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-1.js index 565eec8bfdcb0f927e4e77577b69986388e240cf..ffc66baacf394a1c54056ad56d6faf5168421032 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.21-4-1 description: Array.prototype.reduce throws TypeError if callbackfn is undefined ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.reduce(); + arr.reduce(); }); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-10.js index b37a75ea8029d03c091da41b7986b620bec64646..5592d22dc8e1e04280993b7ac7047b6c202893c2 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-10.js @@ -9,15 +9,18 @@ description: > was thrown by step 2 ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - Object.defineProperty(obj, "length", { - get: function () { - throw new Test262Error(); - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + throw new Test262Error(); + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.reduce.call(obj, undefined); + Array.prototype.reduce.call(obj, undefined); }); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-11.js index c3a43989882bd474b18e279e3af78a6995b724c4..a9993c23952c9d17aa3c8a03136ac5382341b5fd 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-11.js @@ -9,19 +9,22 @@ description: > was thrown by step 3 ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - throw new Test262Error(); - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + throw new Test262Error(); + } + }; + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.reduce.call(obj, undefined); + Array.prototype.reduce.call(obj, undefined); }); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-12.js index 087ba33ec49e801d98d4d4f4ccdf45cb39d32473..391122864646e2b1b9ba5f23da76f303adac4fcb 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-12.js @@ -7,11 +7,12 @@ es5id: 15.4.4.21-4-12 description: Array.prototype.reduce - 'callbackfn' is a function ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return curVal > 10; - } +var accessed = false; + +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return curVal > 10; +} assert.sameValue([11, 9].reduce(callbackfn, 1), false, '[11, 9].reduce(callbackfn, 1)'); assert(accessed, 'accessed !== true'); 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 509aeb6182cc88f64ea2703c9f888991d5c6dd0d..7072a1d2c056b4c83bf252c7d70160cd5a3f9a6f 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 @@ -9,27 +9,29 @@ description: > passing undefined for callbackfn ---*/ - var obj = { 10: 10 }; - var lengthAccessed = false; - var loopAccessed = false; +var obj = { + 10: 10 +}; +var lengthAccessed = false; +var loopAccessed = false; - Object.defineProperty(obj, "length", { - get: function () { - lengthAccessed = true; - return 20; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + lengthAccessed = true; + return 20; + }, + configurable: true +}); - Object.defineProperty(obj, "0", { - get: function () { - loopAccessed = true; - return 10; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + loopAccessed = true; + return 10; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.reduce.call(obj); + Array.prototype.reduce.call(obj); }); 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 bc24e2d621ffe09de7005d67ff20b2772fcf1b08..a510f11e1a3e74ee63263c8ef1edc39b32c0f47e 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 @@ -9,7 +9,7 @@ description: > unreferenced ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(ReferenceError, function() { - arr.reduce(foo); + 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 8f1bbae3a40355ab984f8acd6d332438661efe44..c980003a34f2c2050a8bdf227fbb4b29cae486cf 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.21-4-3 description: Array.prototype.reduce throws TypeError if callbackfn is null ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.reduce(null); + 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 f562ac79ffffc983f15c9c5d7d7cc78b5acf2f0d..f86249342b18cb3a4bccabbc0bf6b54c0d1a60c5 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.21-4-4 description: Array.prototype.reduce throws TypeError if callbackfn is boolean ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.reduce(true); + 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 a17c110efd9ad6255a9f7cd3ecd5b4cb3a4638f1..19ea080d09eb549404fb5428cc4e469c8b2a5361 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.21-4-5 description: Array.prototype.reduce throws TypeError if callbackfn is number ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.reduce(5); + 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 7a815eddc29343c57bf1a834c3f868946d853287..10d80e6651bd3a01a3a25180282532b630e0a926 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.21-4-6 description: Array.prototype.reduce throws TypeError if callbackfn is string ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.reduce("abc"); + 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 57281c17c9da2f51740165be92627750ceed1bb0..5f5bb65167ef16a3e726739c25e9d6483252cb7e 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 @@ -9,7 +9,7 @@ description: > without [[Call]] internal method ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.reduce(new Object()); + 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 07e01936b10eb453bb92cc353b6e620d6eefbfa1..da9ba950c695a3de00ff55cea774710ea69f2f46 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 @@ -9,18 +9,21 @@ description: > visible when an exception occurs ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - accessed = true; - return 2; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + accessed = true; + return 2; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.reduce.call(obj, null); + Array.prototype.reduce.call(obj, null); }); 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 31738344a2e20749a557044af1ae1fd21500d95a..b0e48b6282ba908753a4ce80fa0f4c83a386f2e8 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 @@ -9,22 +9,25 @@ description: > visible when an exception occurs ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - accessed = true; - return "2"; - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + accessed = true; + return "2"; + } + }; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.reduce.call(obj, null); + Array.prototype.reduce.call(obj, null); }); 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 ebf1d03649bf535c1032fa7f37463cbe56ad3104..ca6c5403463595bf5e59339fd6fc326a4f45508e 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 @@ -9,7 +9,7 @@ description: > array), no initVal ---*/ - function cb(){} +function cb() {} assert.throws(TypeError, function() { - [].reduce(cb); + [].reduce(cb); }); 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 457d6114db99ad69d46e581ffea831a10181993c..2d392481cef9e64f51478154753c3c63a6dce471 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 @@ -9,22 +9,25 @@ description: > side-effects that might be produced by step 2 ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (curVal > 10); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (curVal > 10); +} - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - accessed = true; - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + accessed = true; + return 0; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.reduce.call(obj, callbackfn); + Array.prototype.reduce.call(obj, callbackfn); }); 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 604a91c147df33010681114c6f4d342f7a9cdd78..8b63d3e3e12bc1d3e24942049293b89e320560a4 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 @@ -9,26 +9,29 @@ description: > any side-effects that might be produced by step 3 ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (curVal > 10); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (curVal > 10); +} - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - accessed = true; - return "0"; - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + accessed = true; + return "0"; + } + }; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.reduce.call(obj, callbackfn); + Array.prototype.reduce.call(obj, callbackfn); }); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-12.js index 57209d338e163f5d33b7335fcf12d2bc9043ff89..8cdeb3b4c80c8c3460ed8a2a397737459c12fddf 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-12.js @@ -9,19 +9,22 @@ description: > was thrown by step 2 ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (curVal > 10); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (curVal > 10); +} - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - Object.defineProperty(obj, "length", { - get: function () { - throw new Test262Error(); - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + throw new Test262Error(); + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.reduce.call(obj, callbackfn); + Array.prototype.reduce.call(obj, callbackfn); }); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-13.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-13.js index 297d0d481cb49c6e2d723e277765a0007cc77b2c..3285912c3c1ed3e41acd4309c347c924a456e801 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-13.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-13.js @@ -9,23 +9,26 @@ description: > was thrown by step 3 ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return (curVal > 10); - } +function callbackfn(prevVal, curVal, idx, obj) { + return (curVal > 10); +} - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - throw new Test262Error(); - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + throw new Test262Error(); + } + }; + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.reduce.call(obj, callbackfn); + Array.prototype.reduce.call(obj, callbackfn); }); 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 c3ff294e2fc9d3bbfafe171338131621b43ba586..ac61503048fa76f23f8e21c015e709d7651126f9 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 @@ -10,12 +10,13 @@ description: > no initVal ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = null; +foo.prototype = new Array(1, 2, 3); - function cb(){} +function foo() {} +var f = new foo(); +f.length = null; + +function cb() {} assert.throws(TypeError, function() { - f.reduce(cb); + f.reduce(cb); }); 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 b0b9d0060221c3540e40cc614ea759f6aa110fb2..1fb61ac829b8e3e89af338a2f8af31d9869b0e82 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 @@ -10,12 +10,13 @@ description: > no initVal ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = false; +foo.prototype = new Array(1, 2, 3); - function cb(){} +function foo() {} +var f = new foo(); +f.length = false; + +function cb() {} assert.throws(TypeError, function() { - f.reduce(cb); + f.reduce(cb); }); 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 c452e0f55ba592e437eab981047e8816c9b2aa89..a68dd493432ef073f9b3905e973cca15217bd478 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 @@ -10,12 +10,13 @@ description: > initVal ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = 0; +foo.prototype = new Array(1, 2, 3); - function cb(){} +function foo() {} +var f = new foo(); +f.length = 0; + +function cb() {} assert.throws(TypeError, function() { - f.reduce(cb); + f.reduce(cb); }); 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 287cae36096e8653721beeccdecbe4aa13f107f9..0717a9eddc9025545d0fb581cf68a2539a12daa4 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 @@ -10,12 +10,13 @@ description: > initVal ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = '0'; +foo.prototype = new Array(1, 2, 3); - function cb(){} +function foo() {} +var f = new foo(); +f.length = '0'; + +function cb() {} assert.throws(TypeError, function() { - f.reduce(cb); + f.reduce(cb); }); 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 aba39d0b1aec6b9688ec170e8e57008380bacd03..4a935d9a756c9eba212376708d2810c7418e5639 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 @@ -10,14 +10,19 @@ description: > initVal ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - var o = { valueOf: function () { return 0;}}; - f.length = o; +function foo() {} +var f = new foo(); - function cb(){} +var o = { + valueOf: function() { + return 0; + } +}; +f.length = o; + +function cb() {} assert.throws(TypeError, function() { - f.reduce(cb); + f.reduce(cb); }); 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 13e218f2c2fc0df730054ec11cd3181d307bc183..faede22226061f824cc78e6f16a5d29b37e61fec 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 @@ -10,20 +10,25 @@ description: > (toString)), no initVal ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - var o = { toString: function () { return '0';}}; - f.length = o; +function foo() {} +var f = new foo(); - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. +var o = { + toString: function() { + return '0'; + } +}; +f.length = o; - function cb(){} +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. + +function cb() {} assert.throws(TypeError, function() { - f.reduce(cb); + f.reduce(cb); }); 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 9d932b3710738b1486e2595c6b0bc3394eec5f89..ddf3cbf52449c15e8502dcfbbe1b864ec14d5bcb 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 @@ -9,27 +9,28 @@ description: > (subclassed Array, length overridden with []), no initVal ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - f.length = []; +function foo() {} +var f = new foo(); - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - // - // The toString( ) method on Array converts the array elements to strings, - // then returns the result of concatenating these strings, with commas in - // between. An array with no elements converts to the empty string, which - // converts to the number 0. If an array has a single element that is a - // number n, the array converts to a string representation of n, which is - // then converted back to n itself. If an array contains more than one element, - // or if its one element is not a number, the array converts to NaN. +f.length = []; - function cb(){} +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +// +// The toString( ) method on Array converts the array elements to strings, +// then returns the result of concatenating these strings, with commas in +// between. An array with no elements converts to the empty string, which +// converts to the number 0. If an array has a single element that is a +// number n, the array converts to a string representation of n, which is +// then converted back to n itself. If an array contains more than one element, +// or if its one element is not a number, the array converts to NaN. + +function cb() {} assert.throws(TypeError, function() { - f.reduce(cb); + f.reduce(cb); }); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-9.js index edbcb465fae13255e8697217ef4658136ad4458f..8df0ed8c93176819e3db940b2617596cf9004ed3 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-9.js @@ -9,10 +9,11 @@ description: > and 'initialValue' is present ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - } +var accessed = false; + +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; +} assert.sameValue([].reduce(callbackfn, 3), 3, '[].reduce(callbackfn, 3)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-1.js index db603f9524f2438988dc3eaed130616688d5057f..785c4e32f937baa9ff9a5eaee26095138e8d930d 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-1.js @@ -9,5 +9,5 @@ description: > initialValue is present (empty array) ---*/ - function cb(){} -assert.sameValue([].reduce(cb,1), 1, '[].reduce(cb,1)'); +function cb() {} +assert.sameValue([].reduce(cb, 1), 1, '[].reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-10.js index f86e9806f9e609f937ebb80f0cd070072855be0a..a03752192de425ad573d4eb4e9f2fa291efcb607 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-10.js @@ -7,6 +7,6 @@ es5id: 15.4.4.21-7-10 description: Array.prototype.reduce - 'initialValue' is present ---*/ - var str = "initialValue is present"; +var str = "initialValue is present"; -assert.sameValue([].reduce(function () { }, str), str, '[].reduce(function () { }, str)'); +assert.sameValue([].reduce(function() {}, str), str, '[].reduce(function () { }, str)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-11.js index 619bb2d271eaf6b8d6239c9e47a195540179c546..7c2dd91ff320e895daec66d6463d991f9fccdd11 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-11.js @@ -7,6 +7,6 @@ es5id: 15.4.4.21-7-11 description: Array.prototype.reduce - 'initialValue' is not present ---*/ - var str = "initialValue is not present"; +var str = "initialValue is not present"; -assert.sameValue([str].reduce(function () { }), str, '[str].reduce(function () { })'); +assert.sameValue([str].reduce(function() {}), str, '[str].reduce(function () { })'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-2.js index 27ddd16b043463fc5ccc2476b9f5de9cc71c4fee..7c227878cec1348eb35cfa04eeae929f4260c0b8 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-2.js @@ -10,10 +10,11 @@ description: > null (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = null; +foo.prototype = new Array(1, 2, 3); - function cb(){} -assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); +function foo() {} +var f = new foo(); +f.length = null; + +function cb() {} +assert.sameValue(f.reduce(cb, 1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-3.js index eed2c040f4785da7fe90e034f0c6b0811daa73d3..525f769e3e751c561c6cf2199f4ef0765bddb0b5 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-3.js @@ -10,10 +10,11 @@ description: > false (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = false; +foo.prototype = new Array(1, 2, 3); - function cb(){} -assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); +function foo() {} +var f = new foo(); +f.length = false; + +function cb() {} +assert.sameValue(f.reduce(cb, 1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-4.js index 4fb6146f13dd20486a12e9fffeda64bc1f16d2a2..fed398c8e1cf9a9ee41d6b6ef520606a1755e05e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-4.js @@ -10,10 +10,11 @@ description: > (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = 0; +foo.prototype = new Array(1, 2, 3); - function cb(){} -assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); +function foo() {} +var f = new foo(); +f.length = 0; + +function cb() {} +assert.sameValue(f.reduce(cb, 1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-5.js index 4a6d8d59e4044861ac6c217614049f288b422f27..8634d03a640e0b98dbeec6b6ed7c19e352c81a0f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-5.js @@ -10,10 +10,11 @@ description: > '0' (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = '0'; +foo.prototype = new Array(1, 2, 3); - function cb(){} -assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); +function foo() {} +var f = new foo(); +f.length = '0'; + +function cb() {} +assert.sameValue(f.reduce(cb, 1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-6.js index 2c2174482f812c1e9f2319ab78d16431fcfcf8db..33c22e6e73cf8e168c3cdfc9de9fbe9ab4abdc3c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-6.js @@ -10,12 +10,17 @@ description: > obj with valueOf) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - var o = { valueOf: function () { return 0;}}; - f.length = o; +function foo() {} +var f = new foo(); - function cb(){} -assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); +var o = { + valueOf: function() { + return 0; + } +}; +f.length = o; + +function cb() {} +assert.sameValue(f.reduce(cb, 1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-7.js index 3d7783369aeeddeb488bde60ab469e5818560f3f..db7132e8a839ada125bd35880fd7edf39cb95bc0 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-7.js @@ -10,18 +10,23 @@ description: > obj w/o valueOf (toString)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - var o = { toString: function () { return '0';}}; - f.length = o; +function foo() {} +var f = new foo(); - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. +var o = { + toString: function() { + return '0'; + } +}; +f.length = o; - function cb(){} -assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. + +function cb() {} +assert.sameValue(f.reduce(cb, 1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-8.js index 430c58cd158ab0abcddf218625a4ce9b00768ed9..8ddc5cd6f25e14a27f696f3e065f62fc3d685629 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-8.js @@ -10,25 +10,26 @@ description: > []) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - f.length = []; +function foo() {} +var f = new foo(); - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - // - // The toString( ) method on Array converts the array elements to strings, - // then returns the result of concatenating these strings, with commas in - // between. An array with no elements converts to the empty string, which - // converts to the number 0. If an array has a single element that is a - // number n, the array converts to a string representation of n, which is - // then converted back to n itself. If an array contains more than one element, - // or if its one element is not a number, the array converts to NaN. +f.length = []; - function cb(){} -assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +// +// The toString( ) method on Array converts the array elements to strings, +// then returns the result of concatenating these strings, with commas in +// between. An array with no elements converts to the empty string, which +// converts to the number 0. If an array has a single element that is a +// number n, the array converts to a string representation of n, which is +// then converted back to n itself. If an array contains more than one element, +// or if its one element is not a number, the array converts to NaN. + +function cb() {} +assert.sameValue(f.reduce(cb, 1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-9.js index 744659f51c619bc7b190ec42ad6dd8e1eb0e49c7..4f9f86265aaae0bb296977ebfc3a8ac65559a87c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-9.js @@ -10,25 +10,26 @@ description: > [0]) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - f.length = [0]; +function foo() {} +var f = new foo(); - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - // - // The toString( ) method on Array converts the array elements to strings, - // then returns the result of concatenating these strings, with commas in - // between. An array with no elements converts to the empty string, which - // converts to the number 0. If an array has a single element that is a - // number n, the array converts to a string representation of n, which is - // then converted back to n itself. If an array contains more than one element, - // or if its one element is not a number, the array converts to NaN. +f.length = [0]; - function cb(){} -assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +// +// The toString( ) method on Array converts the array elements to strings, +// then returns the result of concatenating these strings, with commas in +// between. An array with no elements converts to the empty string, which +// converts to the number 0. If an array has a single element that is a +// number n, the array converts to a string representation of n, which is +// then converted back to n itself. If an array contains more than one element, +// or if its one element is not a number, the array converts to NaN. + +function cb() {} +assert.sameValue(f.reduce(cb, 1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-1.js index d0650cfc47ced25496253adaf394f21dc50e79c1..af872fd9257c5fdd8598b50cd549e50b90bff8cb 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-1.js @@ -7,20 +7,22 @@ es5id: 15.4.4.21-8-b-1 description: Array.prototype.reduce - no observable effects occur if 'len' is 0 ---*/ - var accessed = false; +var accessed = false; - var obj = { length: 0 }; +var obj = { + length: 0 +}; - Object.defineProperty(obj, "0", { - get: function () { - accessed = true; - return 10; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + accessed = true; + return 10; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.reduce.call(obj, function () { }); + Array.prototype.reduce.call(obj, function() {}); }); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-2.js index 84a6d4181a1b74e963a57ac0847fbffd86022b76..a3796550a8f5708a830b789e3f3641e94e277c1d 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-2.js @@ -9,18 +9,22 @@ description: > number of iterations in step 9 ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - return idx; - } +function callbackfn(prevVal, curVal, idx, obj) { + return idx; +} - var obj = { 3: 12, 4: 9, length: 4 }; +var obj = { + 3: 12, + 4: 9, + length: 4 +}; - Object.defineProperty(obj, "2", { - get: function () { - obj.length = 10; - return 11; - }, - configurable: true - }); +Object.defineProperty(obj, "2", { + get: function() { + obj.length = 10; + return 11; + }, + configurable: true +}); assert.sameValue(Array.prototype.reduce.call(obj, callbackfn), 3, 'Array.prototype.reduce.call(obj, callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-3.js index 95062f4621cc5dd1b5395f6fb5a7f5c8d67a5ddc..03fd27c09dbfc42558b1dd5e007ec2fe87fc0848 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-3.js @@ -7,37 +7,37 @@ es5id: 15.4.4.21-8-b-3 description: Array.prototype.reduce - loop is broken once 'kPresent' is true ---*/ - var called = 0; - var testResult = false; - var firstCalled = 0; - var secondCalled = 0; - - function callbackfn(prevVal, val, idx, obj) { - if (called === 0) { - testResult = (idx === 1); - } - called++; - } - - var arr = [, , ]; - - Object.defineProperty(arr, "0", { - get: function () { - firstCalled++; - return 11; - }, - configurable: true - }); - - Object.defineProperty(arr, "1", { - get: function () { - secondCalled++; - return 9; - }, - configurable: true - }); - - arr.reduce(callbackfn); +var called = 0; +var testResult = false; +var firstCalled = 0; +var secondCalled = 0; + +function callbackfn(prevVal, val, idx, obj) { + if (called === 0) { + testResult = (idx === 1); + } + called++; +} + +var arr = [, , ]; + +Object.defineProperty(arr, "0", { + get: function() { + firstCalled++; + return 11; + }, + configurable: true +}); + +Object.defineProperty(arr, "1", { + get: function() { + secondCalled++; + return 9; + }, + configurable: true +}); + +arr.reduce(callbackfn); assert(testResult, 'testResult !== true'); assert.sameValue(firstCalled, 1, 'firstCalled'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-1.js index f2369b4321c0ccb63c7ddead3a42bf07b96813ff..15b0dc2a04e2c38caa6d87746204c2e244e6d658 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-1.js @@ -9,14 +9,14 @@ description: > here ---*/ - var obj = { }; +var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - obj[1] = "accumulator"; - return 3; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + obj[1] = "accumulator"; + return 3; + }, + configurable: true +}); -assert.sameValue(Array.prototype.reduce.call(obj, function () { }), "accumulator", 'Array.prototype.reduce.call(obj, function () { })'); +assert.sameValue(Array.prototype.reduce.call(obj, function() {}), "accumulator", 'Array.prototype.reduce.call(obj, function () { })'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-2.js index 12c5e2fddf57c81615813769cfd7744b193c8831..9c51a152a76f6a5d4183fc922159c37cf0548668 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-2.js @@ -9,14 +9,17 @@ description: > here ---*/ - var obj = { 1: "accumulator", 2: "another" }; +var obj = { + 1: "accumulator", + 2: "another" +}; - Object.defineProperty(obj, "length", { - get: function () { - delete obj[1]; - return 3; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + delete obj[1]; + return 3; + }, + configurable: true +}); -assert.notSameValue(Array.prototype.reduce.call(obj, function () { }), "accumulator", 'Array.prototype.reduce.call(obj, function () { })'); +assert.notSameValue(Array.prototype.reduce.call(obj, function() {}), "accumulator", 'Array.prototype.reduce.call(obj, function () { })'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-1.js index fbba69c12cbd66188d2821ad06cb1000a5b7c757..eff2f84cf7fcc5a16294a6acbe6061c29f89cd57 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-1.js @@ -9,14 +9,20 @@ description: > property on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 0); - } - } +var testResult = false; - var obj = { 0: 0, 1: 1, 2: 2, length: 2 }; - Array.prototype.reduce.call(obj, callbackfn); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 0); + } +} + +var obj = { + 0: 0, + 1: 1, + 2: 2, + length: 2 +}; +Array.prototype.reduce.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-10.js index 67b7b3f57ba51bd1ae5636da512e18cf0e66c632..c3e9f4b4b484b5471d9c311f06e30cce21ba6704 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-10.js @@ -9,23 +9,23 @@ description: > accessor property on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 0); - } - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 0); + } +} - var arr = [, 1, 2]; +var arr = [, 1, 2]; - Object.defineProperty(arr, "0", { - get: function () { - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + return 0; + }, + configurable: true +}); - arr.reduce(callbackfn); +arr.reduce(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-11.js index e1f08e697ddd8359befe91d0fbb0bfc3a319a62c..e5c7a7b9774f816bbb20b808cedda4c672adbf5a 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-11.js @@ -10,28 +10,33 @@ description: > Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === "9"); - } - } - - var proto = { 0: 0, 1: 1, 2: 2 }; - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 3; - - Object.defineProperty(child, "0", { - get: function () { - return "9"; - }, - configurable: true - }); - - Array.prototype.reduce.call(child, callbackfn); +var testResult = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === "9"); + } +} + +var proto = { + 0: 0, + 1: 1, + 2: 2 +}; + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 3; + +Object.defineProperty(child, "0", { + get: function() { + return "9"; + }, + configurable: true +}); + +Array.prototype.reduce.call(child, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-12.js index 9d9b802d0964396a1ccad52af4ffe8a3f5cbb2b5..79eba4945157f7241d23465836a14b2ac1f09013 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-12.js @@ -9,24 +9,24 @@ description: > property that overrides an inherited data property on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === "9"); - } - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === "9"); + } +} - Array.prototype[0] = 0; - var arr = [, 1, 2]; +Array.prototype[0] = 0; +var arr = [, 1, 2]; - Object.defineProperty(arr, "0", { - get: function () { - return "9"; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + return "9"; + }, + configurable: true +}); - arr.reduce(callbackfn); +arr.reduce(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-13.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-13.js index 00f0210ab2070ebd3527e0661c2b7cf3a7b4b477..62d5da4b47563d3cc44d7ce41d364233c18b69a2 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-13.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-13.js @@ -10,36 +10,39 @@ description: > Array-like object ---*/ - var testResult = false; - - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === "9"); - } - } - - var proto = { 1: 1, 2: 2}; - - Object.defineProperty(proto, "0", { - get: function () { - return 0; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 3; - - Object.defineProperty(child, "0", { - get: function () { - return "9"; - }, - configurable: true - }); - - Array.prototype.reduce.call(child, callbackfn); +var testResult = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === "9"); + } +} + +var proto = { + 1: 1, + 2: 2 +}; + +Object.defineProperty(proto, "0", { + get: function() { + return 0; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 3; + +Object.defineProperty(child, "0", { + get: function() { + return "9"; + }, + configurable: true +}); + +Array.prototype.reduce.call(child, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-14.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-14.js index 77a1084be6c1857b3af7140f595c5aa2c7017445..0b1781550f3234df82d45f1756a02a4f2a10cbf1 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-14.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-14.js @@ -9,28 +9,29 @@ description: > property that overrides an inherited accessor property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === "9"); - } - } +var testResult = false; - Object.defineProperty(Array.prototype, "0", { - get: function () { - return 0; - }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === "9"); + } +} - var arr = [, 1, 2]; - Object.defineProperty(arr, "0", { - get: function () { - return "9"; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return 0; + }, + configurable: true +}); - arr.reduce(callbackfn); +var arr = [, 1, 2]; +Object.defineProperty(arr, "0", { + get: function() { + return "9"; + }, + configurable: true +}); + +arr.reduce(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-15.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-15.js index 5344feebd4853247e911c29f39b80ebc8743d828..6e2cc64b9d17fc568345d3d0dc86681bd25eae2c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-15.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-15.js @@ -9,28 +9,32 @@ description: > accessor property on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 0); - } - } +var testResult = false; - var proto = { 1: 1, 2: 2 }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 0); + } +} - Object.defineProperty(proto, "0", { - get: function () { - return 0; - }, - configurable: true - }); +var proto = { + 1: 1, + 2: 2 +}; - var Con = function () { }; - Con.prototype = proto; +Object.defineProperty(proto, "0", { + get: function() { + return 0; + }, + configurable: true +}); - var child = new Con(); - child.length = 3; +var Con = function() {}; +Con.prototype = proto; - Array.prototype.reduce.call(child, callbackfn); +var child = new Con(); +child.length = 3; + +Array.prototype.reduce.call(child, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-16.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-16.js index c941e4581ffe8d0c20ee10d83394aab89a82315b..2bfc2d804b196cb6c8415435138304f6a8733fcb 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-16.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-16.js @@ -9,22 +9,23 @@ description: > accessor property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 0); - } - } +var testResult = false; - Object.defineProperty(Array.prototype, "0", { - get: function () { - return 0; - }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 0); + } +} - var arr = [, 1, 2]; +Object.defineProperty(Array.prototype, "0", { + get: function() { + return 0; + }, + configurable: true +}); - arr.reduce(callbackfn); +var arr = [, 1, 2]; + +arr.reduce(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js index a411f9467e720467e33e6f8e3b8b308ff3bec11b..735d1c856e29c94d65eb9138693d575e9962412e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js @@ -9,20 +9,25 @@ description: > property without a get function on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === undefined); - } - } +var testResult = false; - var obj = { 1: 1, 2: 2, length: 3 }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === undefined); + } +} - Object.defineProperty(obj, "0", { - set: function () { }, - configurable: true - }); +var obj = { + 1: 1, + 2: 2, + length: 3 +}; - Array.prototype.reduce.call(obj, callbackfn); +Object.defineProperty(obj, "0", { + set: function() {}, + configurable: true +}); + +Array.prototype.reduce.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-18.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-18.js index fbdfb97c81472c6576626e1ce9387c1657aa5ecd..5b2a3b2f78c8369d1ad8c389366a44a0b4f01b34 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-18.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-18.js @@ -9,20 +9,21 @@ description: > property without a get function on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === undefined); - } - } +var testResult = false; - var arr = [, 1, 2]; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === undefined); + } +} - Object.defineProperty(arr, "0", { - set: function () { }, - configurable: true - }); +var arr = [, 1, 2]; - arr.reduce(callbackfn); +Object.defineProperty(arr, "0", { + set: function() {}, + configurable: true +}); + +arr.reduce(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-19.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-19.js index 1611043a21ac237250f4b012c67cdb8c5c096a91..9178b85feb2fe9f38e56a36eead61c3b713d7f29 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-19.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-19.js @@ -10,22 +10,27 @@ description: > accessor property on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === undefined); - } - } +var testResult = false; - Object.prototype[0] = 0; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === undefined); + } +} - var obj = { 1: 1, 2: 2, length: 3 }; +Object.prototype[0] = 0; - Object.defineProperty(obj, "0", { - set: function () { }, - configurable: true - }); +var obj = { + 1: 1, + 2: 2, + length: 3 +}; - Array.prototype.reduce.call(obj, callbackfn); +Object.defineProperty(obj, "0", { + set: function() {}, + configurable: true +}); + +Array.prototype.reduce.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-2.js index 06d593f567d3486badfbfa9f3bf119094fe3738d..f8ca72b6a010af7cb6d024ff0c124a607d6cd41f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-2.js @@ -9,14 +9,15 @@ description: > property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 0); - } - } +var testResult = false; - var arr = [0, 1, 2]; - arr.reduce(callbackfn); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 0); + } +} + +var arr = [0, 1, 2]; +arr.reduce(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-20.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-20.js index 2a313d786c889fd2bb0bf8e1a05df7399953d1c8..e4793560e26562e198d130f8c163b1065bf4c3a6 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-20.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-20.js @@ -10,20 +10,21 @@ description: > accessor property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === undefined); - } - } +var testResult = false; - Array.prototype[0] = 0; - var arr = [, 1, 2]; - Object.defineProperty(arr, "0", { - set: function () { }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === undefined); + } +} - arr.reduce(callbackfn); +Array.prototype[0] = 0; +var arr = [, 1, 2]; +Object.defineProperty(arr, "0", { + set: function() {}, + configurable: true +}); + +arr.reduce(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-21.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-21.js index d057b59b2714d29fca79a8ce50bc158dd552d6a4..47a9a843b8bd19e8e68c2fd8fd6c0164aa4423da 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-21.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-21.js @@ -9,26 +9,30 @@ description: > accessor property without a get function on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === undefined); - } - } +var testResult = false; - var proto = { 1: 1, 2: 2 }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === undefined); + } +} - Object.defineProperty(proto, "0", { - set: function () { }, - configurable: true - }); +var proto = { + 1: 1, + 2: 2 +}; - var Con = function () { }; - Con.prototype = proto; +Object.defineProperty(proto, "0", { + set: function() {}, + configurable: true +}); - var child = new Con(); - child.length = 3; +var Con = function() {}; +Con.prototype = proto; - Array.prototype.reduce.call(child, callbackfn); +var child = new Con(); +child.length = 3; + +Array.prototype.reduce.call(child, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-22.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-22.js index f7d6f961cd58b4b5227c46c5660261dc1f4d410b..dc05e78606ce1580a170874b07f130fb807c6ccc 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-22.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-22.js @@ -9,20 +9,21 @@ description: > accessor property without a get function on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === undefined); - } - } +var testResult = false; - Object.defineProperty(Array.prototype, "0", { - set: function () { }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === undefined); + } +} - var arr = [, 1, 2]; +Object.defineProperty(Array.prototype, "0", { + set: function() {}, + configurable: true +}); - arr.reduce(callbackfn); +var arr = [, 1, 2]; + +arr.reduce(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-25.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-25.js index 20223664507055f381d510deb19f3cb8d0d62ce8..451955fccd9084e9b2e574e2ea08c86684f19e58 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-25.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-25.js @@ -10,17 +10,18 @@ description: > less than number of parameters) ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 0); - } - } +var testResult = false; - var func = function (a, b, c) { - Array.prototype.reduce.call(arguments, callbackfn); - }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 0); + } +} - func(0, 1); +var func = function(a, b, c) { + Array.prototype.reduce.call(arguments, callbackfn); +}; + +func(0, 1); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-26.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-26.js index 887f2631538e4851fd004bfa47ec6d6011393f70..eef4cdd6eee2022bf6eb342f54e7d143d0f51384 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-26.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-26.js @@ -10,18 +10,19 @@ description: > number of parameters) ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 2) { - testResult = (prevVal === 1); - } - } +var testResult = false; - var func = function (a, b, c) { - delete arguments[0]; - Array.prototype.reduce.call(arguments, callbackfn); - }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 2) { + testResult = (prevVal === 1); + } +} - func(0, 1, 2); +var func = function(a, b, c) { + delete arguments[0]; + Array.prototype.reduce.call(arguments, callbackfn); +}; + +func(0, 1, 2); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-27.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-27.js index 3f591f26ec26f97468b2b1589480e04cfd28ea2d..fc4013d2dbf90940bcd3e57925cbac80995d4f13 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-27.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-27.js @@ -10,19 +10,20 @@ description: > greater than number of parameters) ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 3) { - testResult = (prevVal === 2); - } - } +var testResult = false; - var func = function (a, b, c) { - delete arguments[0]; - delete arguments[1]; - Array.prototype.reduce.call(arguments, callbackfn); - }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 3) { + testResult = (prevVal === 2); + } +} - func(0, 1, 2, 3); +var func = function(a, b, c) { + delete arguments[0]; + delete arguments[1]; + Array.prototype.reduce.call(arguments, callbackfn); +}; + +func(0, 1, 2, 3); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-28.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-28.js index 2a96496aa55862bedba187e20ec8d3e23d60b606..1c429e4c7b50c3c669593c12dfcaf1aa153189c1 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-28.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-28.js @@ -9,14 +9,15 @@ description: > implements its own property get method ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === "0"); - } - } +var testResult = false; - var str = new String("012"); - Array.prototype.reduce.call(str, callbackfn); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === "0"); + } +} + +var str = new String("012"); +Array.prototype.reduce.call(str, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-29.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-29.js index 8f5e18db73083a410db8a7ac41b6b8eaf56ba1f1..0fe7328fee19368195e56632aace3fb183e625a0 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-29.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-29.js @@ -9,21 +9,22 @@ description: > implements its own property get method ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 0); - } - } +var testResult = false; - var obj = function (a, b, c) { - return a + b + c; - }; - obj[0] = 0; - obj[1] = 1; - obj[2] = 2; - obj[3] = 3; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 0); + } +} - Array.prototype.reduce.call(obj, callbackfn); +var obj = function(a, b, c) { + return a + b + c; +}; +obj[0] = 0; +obj[1] = 1; +obj[2] = 2; +obj[3] = 3; + +Array.prototype.reduce.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-3.js index d77985dd3f9c94e19cdfe11b98d490a947324037..15298bc3efa3ede3289cd61d637fa140cfdca2cc 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-3.js @@ -10,22 +10,28 @@ description: > Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === "9"); - } - } +var testResult = false; - var proto = { 0: 0, 1: 1, 2: 2, length: 3 }; - var Con = function () { }; - Con.prototype = proto; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === "9"); + } +} - var child = new Con(); - child[0] = "9"; - child[1] = "1"; - child.length = 3; +var proto = { + 0: 0, + 1: 1, + 2: 2, + length: 3 +}; +var Con = function() {}; +Con.prototype = proto; - Array.prototype.reduce.call(child, callbackfn); +var child = new Con(); +child[0] = "9"; +child[1] = "1"; +child.length = 3; + +Array.prototype.reduce.call(child, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-30.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-30.js index c307ddda90603355de44ce66ffc7ad5bea1c6344..45f396f05c00f44d19425ad4f26eab410ad1c1d5 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-30.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-30.js @@ -9,35 +9,36 @@ description: > iterations is observed in subsequent iterations on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } - - var arr = [, , 2]; - var preIterVisible = false; - - Object.defineProperty(arr, "0", { - get: function () { - preIterVisible = true; - return 0; - }, - configurable: true - }); - - Object.defineProperty(arr, "1", { - get: function () { - if (preIterVisible) { - return 1; - } else { - return 100; - } - }, - configurable: true - }); - - arr.reduce(callbackfn); +var testResult = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} + +var arr = [, , 2]; +var preIterVisible = false; + +Object.defineProperty(arr, "0", { + get: function() { + preIterVisible = true; + return 0; + }, + configurable: true +}); + +Object.defineProperty(arr, "1", { + get: function() { + if (preIterVisible) { + return 1; + } else { + return 100; + } + }, + configurable: true +}); + +arr.reduce(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-31.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-31.js index e035ae8e4afc3324c193521477bf37828cbfd98c..70282ce37e17f45e5a076bf844a1744c8495e2a0 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-31.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-31.js @@ -10,35 +10,38 @@ description: > object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } - - var obj = { length: 2 }; - var preIterVisible = false; - - Object.defineProperty(obj, "0", { - get: function () { - preIterVisible = true; - return 0; - }, - configurable: true - }); - - Object.defineProperty(obj, "1", { - get: function () { - if (preIterVisible) { - return 1; - } else { - return 100; - } - }, - configurable: true - }); - - Array.prototype.reduce.call(obj, callbackfn); +var testResult = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} + +var obj = { + length: 2 +}; +var preIterVisible = false; + +Object.defineProperty(obj, "0", { + get: function() { + preIterVisible = true; + return 0; + }, + configurable: true +}); + +Object.defineProperty(obj, "1", { + get: function() { + if (preIterVisible) { + return 1; + } else { + return 100; + } + }, + configurable: true +}); + +Array.prototype.reduce.call(obj, callbackfn); assert(testResult, 'testResult !== true'); 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 1324085437bdb07276e51f9f3e6d7f5b7ce9f66e..50002a64e32b724c6f606c720eef8ffba05cbd61 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 @@ -9,24 +9,29 @@ description: > on an Array-like object ---*/ - var accessed = false; - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx >= 1) { - accessed = true; - testResult = (prevVal === 0); - } - } +var accessed = false; +var testResult = false; - var obj = { 2: 2, 1: 1, length: 3 }; - Object.defineProperty(obj, "0", { - get: function () { - throw new RangeError("unhandle exception happened in getter"); - }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx >= 1) { + accessed = true; + testResult = (prevVal === 0); + } +} + +var obj = { + 2: 2, + 1: 1, + length: 3 +}; +Object.defineProperty(obj, "0", { + get: function() { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true +}); assert.throws(RangeError, function() { - Array.prototype.reduce.call(obj, callbackfn); + Array.prototype.reduce.call(obj, callbackfn); }); 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 be7c29e8be4264eebda3901d85e03923d5909a74..9f00cb900ff38b50a032c48c0bad51fd7a3b6500 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 @@ -9,25 +9,26 @@ description: > on an Array ---*/ - var accessed = false; - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx >= 1) { - accessed = true; - testResult = (prevVal === 0); - } - } +var accessed = false; +var testResult = false; - var arr = [, 1, 2]; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx >= 1) { + accessed = true; + testResult = (prevVal === 0); + } +} - Object.defineProperty(arr, "0", { - get: function () { - throw new RangeError("unhandle exception happened in getter"); - }, - configurable: true - }); +var arr = [, 1, 2]; + +Object.defineProperty(arr, "0", { + get: function() { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true +}); assert.throws(RangeError, function() { - arr.reduce(callbackfn); + arr.reduce(callbackfn); }); 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-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-4.js index 26118b58f1a2d385577fded07e0179ff8dac67be..72a46d6c81adde9e5c0746f946bae94f55b34502 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-4.js @@ -9,14 +9,15 @@ description: > property that overrides an inherited data property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 0); - } - } +var testResult = false; - Array.prototype[0] = "9"; - [0, 1, 2].reduce(callbackfn); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 0); + } +} + +Array.prototype[0] = "9"; +[0, 1, 2].reduce(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-5.js index 0c9aeb7b8aff0d00d0ce7452e7dd33dca0d656e5..17c7e51c65aa7fdcb8f998b144299ced91a4d38b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-5.js @@ -10,33 +10,34 @@ description: > Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === "9"); - } - } - - var proto = {}; - - Object.defineProperty(proto, "0", { - get: function () { - return 0; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 2; - Object.defineProperty(child, "0", { - value: "9", - configurable: true - }); - child[1] = "1"; - - Array.prototype.reduce.call(child, callbackfn); +var testResult = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === "9"); + } +} + +var proto = {}; + +Object.defineProperty(proto, "0", { + get: function() { + return 0; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 2; +Object.defineProperty(child, "0", { + value: "9", + configurable: true +}); +child[1] = "1"; + +Array.prototype.reduce.call(child, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-6.js index 22b4af3ec58c9f1aa1962d300af4ff98fd53d9a7..2b0f847da4eb4619f89f470f74a4a590083f5544 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-6.js @@ -9,20 +9,21 @@ description: > property that overrides an inherited accessor property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 0); - } - } +var testResult = false; - Object.defineProperty(Array.prototype, "0", { - get: function () { - return "5"; - }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 0); + } +} - [0, 1, 2].reduce(callbackfn); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return "5"; + }, + configurable: true +}); + +[0, 1, 2].reduce(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-7.js index 6eaf1bac1849cbfbd014096b147bf03c58ca37cf..24fa5654ce373b03892f390e234c70416224e3a1 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-7.js @@ -9,20 +9,26 @@ description: > property on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 0); - } - } +var testResult = false; - var proto = { 0: 0, 1: 1, 2: 2, length: 3 }; - var Con = function () { }; - Con.prototype = proto; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 0); + } +} - var child = new Con(); - child.length = 3; +var proto = { + 0: 0, + 1: 1, + 2: 2, + length: 3 +}; +var Con = function() {}; +Con.prototype = proto; - Array.prototype.reduce.call(child, callbackfn); +var child = new Con(); +child.length = 3; + +Array.prototype.reduce.call(child, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-8.js index 48166b7ee40d4da835cb953eb9ad306287d20a18..0eed56363544cbc6f70c5e4d2ddf54427a4b7eca 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-8.js @@ -9,16 +9,17 @@ description: > property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 0); - } - } +var testResult = false; - Array.prototype[0] = 0; - Array.prototype[1] = 1; - Array.prototype[2] = 2; - [, , ,].reduce(callbackfn); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 0); + } +} + +Array.prototype[0] = 0; +Array.prototype[1] = 1; +Array.prototype[2] = 2; +[, , , ].reduce(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-9.js index 82a348b81ee2f6c62a09c6d4015c971f8fe94334..d61c61aea2c9a5ca7f26661a3d375a0d4098e25c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-9.js @@ -9,21 +9,26 @@ description: > property on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 0); - } - } +var testResult = false; - var obj = { 1: 1, 2: 2, length: 3 }; - Object.defineProperty(obj, "0", { - get: function () { - return 0; - }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 0); + } +} - Array.prototype.reduce.call(obj, callbackfn); +var obj = { + 1: 1, + 2: 2, + length: 3 +}; +Object.defineProperty(obj, "0", { + get: function() { + return 0; + }, + configurable: true +}); + +Array.prototype.reduce.call(obj, callbackfn); assert(testResult, 'testResult !== true'); 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 9fb6bc97cad6267cc92b4d447bf26f7b9be2ccd1..bd6232342c22756a5197236607f3a3d53eea1132 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 @@ -9,11 +9,10 @@ description: > initialValue is not present ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - } +function callbackfn(prevVal, curVal, idx, obj) +{} - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.reduce(callbackfn); + arr.reduce(callbackfn); }); 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 ae73a9a86280d0ad26c8e691af7bf344e71b0a50..f30f014b99a43b4e7786f2d008f2618fc6ecda8b 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 @@ -10,13 +10,12 @@ description: > not present ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - } +function callbackfn(prevVal, curVal, idx, obj) +{} - var arr = new Array(10); - arr[9] = 1; - arr.length = 5; +var arr = new Array(10); +arr[9] = 1; +arr.length = 5; assert.throws(TypeError, function() { - arr.reduce(callbackfn); + arr.reduce(callbackfn); }); 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 f4e87f5e0ba2406eacb108f187a72cceb02696bc..15d80dfa2aa64dfa20eef12296e355fbeadf2292 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 @@ -9,16 +9,15 @@ description: > values are deleted and initialValue is not present ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - } +function callbackfn(prevVal, curVal, idx, obj) +{} - var arr = [1,2,3,4,5]; - delete arr[0]; - delete arr[1]; - delete arr[2]; - delete arr[3]; - delete arr[4]; +var arr = [1, 2, 3, 4, 5]; +delete arr[0]; +delete arr[1]; +delete arr[2]; +delete arr[3]; +delete arr[4]; assert.throws(TypeError, function() { - arr.reduce(callbackfn); + arr.reduce(callbackfn); }); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-4.js index 3e712b86dac613a60599b09f9a1f84693e5a1e3c..db9f7aebab19f60edfa8c6dbefb67a6db840c63c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-4.js @@ -9,11 +9,11 @@ description: > properties but prototype contains a single property ---*/ - var arr = [, , , ]; +var arr = [, , , ]; - try { - Array.prototype[1] = "prototype"; - arr.reduce(function () { }); - } finally { - delete Array.prototype[1]; - } +try { + Array.prototype[1] = "prototype"; + arr.reduce(function() {}); +} finally { + delete Array.prototype[1]; +} 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 756a4e93d36f1ef8cc90b5e0ae0a263d90d28ae4..d04354342bd6389758f612ad3ba7cd2e34730158 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 @@ -9,18 +9,18 @@ description: > side-effects that might be produced by step 2 ---*/ - var obj = { }; +var obj = {}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - accessed = true; - return 2; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + accessed = true; + return 2; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.reduce.call(obj, function () { }); + Array.prototype.reduce.call(obj, function() {}); }); 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 af901dc8ef34e79b9a7e07a6a3571fa83207f6d3..687736c2bc6ae455b25456ec49927f09914f1eab 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 @@ -9,22 +9,22 @@ description: > side-effects that might be produced by step 3 ---*/ - var obj = {}; +var obj = {}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - accessed = true; - return "2"; - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + accessed = true; + return "2"; + } + }; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.reduce.call(obj, function () { }); + Array.prototype.reduce.call(obj, function() {}); }); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-7.js index adbdc526a8873c684811994055357a82484ea00e..178c34c70406e82291867ed507efa7ee0b897a7f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-7.js @@ -9,15 +9,15 @@ description: > was thrown by step 2 ---*/ - var obj = {}; +var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - throw new Test262Error(); - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + throw new Test262Error(); + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.reduce.call(obj, function () { }); + Array.prototype.reduce.call(obj, function() {}); }); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-8.js index cd677383a66fa3547a11ba2b0a84046772e29e6d..64f4b8f793fc87aedd59b2ac80908085cfb20b39 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-8.js @@ -9,19 +9,19 @@ description: > was thrown by step 3 ---*/ - var obj = {}; +var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - throw new Test262Error(); - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + throw new Test262Error(); + } + }; + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.reduce.call(obj, function () { }); + Array.prototype.reduce.call(obj, function() {}); }); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-1.js index 6076c9b1011141b4b2da74b89a09dbd999572e79..2ac5c2e7372ff4b21f7fdd8ecd9ef9d5a2a6bda8 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-1.js @@ -9,12 +9,12 @@ description: > array after it is called ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - arr[5] = 6; - arr[2] = 3; - return prevVal + curVal; - } +function callbackfn(prevVal, curVal, idx, obj) { + arr[5] = 6; + arr[2] = 3; + return prevVal + curVal; +} - var arr = [1, 2, , 4, '5']; +var arr = [1, 2, , 4, '5']; assert.sameValue(arr.reduce(callbackfn), "105", 'arr.reduce(callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-10.js index 10a0e43683d4217bf88ec0133a8c80e4d852e219..fec5a6b8d9ef66af97effa16d41880c64b516f65 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-10.js @@ -9,12 +9,12 @@ description: > consider new elements added to array after it is called ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - arr[5] = 6; - arr[2] = 3; - return prevVal + curVal; - } +function callbackfn(prevVal, curVal, idx, obj) { + arr[5] = 6; + arr[2] = 3; + return prevVal + curVal; +} - var arr = [1,2,,4,'5']; +var arr = [1, 2, , 4, '5']; assert.sameValue(arr.reduce(callbackfn, ""), "12345", 'arr.reduce(callbackfn, "")'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-2.js index 2e74efa53b3dfb9afadfa2aa48c3b27754f3b4b4..0db97121047da8a35eb17795fff22bac251f6744 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-2.js @@ -9,13 +9,13 @@ description: > after it is called ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - arr[3] = -2; - arr[4] = -1; - return prevVal + curVal; - } +function callbackfn(prevVal, curVal, idx, obj) +{ + arr[3] = -2; + arr[4] = -1; + return prevVal + curVal; +} - var arr = [1,2,3,4,5]; +var arr = [1, 2, 3, 4, 5]; assert.sameValue(arr.reduce(callbackfn), 3, 'arr.reduce(callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-3.js index e5942de1a09d0ed7adb7a3378874e40e8b5951cc..514951a74806fae3b3dff4606d39b6062a42cf41 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-3.js @@ -9,14 +9,14 @@ description: > after the call ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - delete arr[3]; - delete arr[4]; - return prevVal + curVal; - } +function callbackfn(prevVal, curVal, idx, obj) +{ + delete arr[3]; + delete arr[4]; + return prevVal + curVal; +} - var arr = ['1',2,3,4,5]; +var arr = ['1', 2, 3, 4, 5]; // two elements deleted assert.sameValue(arr.reduce(callbackfn), "123", 'arr.reduce(callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-4.js index e1d2f69fb4a67138da57b4d9db56a12fca6d4e31..6b9f7ca0366d3ba4b3e653b8cad04daa84726001 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-4.js @@ -9,12 +9,12 @@ description: > Array.length is decreased ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - arr.length = 2; - return prevVal + curVal; - } +function callbackfn(prevVal, curVal, idx, obj) +{ + arr.length = 2; + return prevVal + curVal; +} - var arr = [1,2,3,4,5]; +var arr = [1, 2, 3, 4, 5]; assert.sameValue(arr.reduce(callbackfn), 3, 'arr.reduce(callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-5.js index b07ae902000fea35d9e8690729c8d3e79b79d542..4fc56efeadee5bf97b993f4ac7d863229afe3ea1 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-5.js @@ -9,14 +9,15 @@ description: > element ---*/ - var callCnt = 0; - function callbackfn(prevVal, curVal, idx, obj) - { - callCnt++; - return 2; - } +var callCnt = 0; - var arr = [1]; +function callbackfn(prevVal, curVal, idx, obj) +{ + callCnt++; + return 2; +} + +var arr = [1]; assert.sameValue(arr.reduce(callbackfn), 1, 'arr.reduce(callbackfn)'); assert.sameValue(callCnt, 0, 'callCnt'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-6.js index a31d59a240788aea8cea588ec15a9a07a71f847b..2d05468ef256fd05789fb482372c78a7389e5a77 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-6.js @@ -9,17 +9,17 @@ description: > call when same index is also present in prototype ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - delete arr[3]; - delete arr[4]; - return prevVal + curVal; - } +function callbackfn(prevVal, curVal, idx, obj) +{ + delete arr[3]; + delete arr[4]; + return prevVal + curVal; +} - Array.prototype[4] = 5; - var arr = ['1',2,3,4,5]; - var res = arr.reduce(callbackfn); - delete Array.prototype[4]; +Array.prototype[4] = 5; +var arr = ['1', 2, 3, 4, 5]; +var res = arr.reduce(callbackfn); +delete Array.prototype[4]; //one element acually deleted assert.sameValue(res, "1235", 'res'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-7.js index 67e99779fa7b0744b33aac5d4896ea7a9be5c55c..f8c3a4b71108a21609401962e8987eaa9c14d0de 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-7.js @@ -9,13 +9,13 @@ description: > deleted during the call ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - delete o.arr; - return prevVal + curVal; - } +function callbackfn(prevVal, curVal, idx, obj) { + delete o.arr; + return prevVal + curVal; +} - var o = new Object(); - o.arr = ['1', 2, 3, 4, 5]; +var o = new Object(); +o.arr = ['1', 2, 3, 4, 5]; assert.sameValue(o.arr.reduce(callbackfn), "12345", 'o.arr.reduce(callbackfn)'); assert.sameValue(o.hasOwnProperty("arr"), false, 'o.hasOwnProperty("arr")'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-8.js index beceef98c6bbb46187515c8188f5260fead74a3a..6feccfcb357b9e2f6e023e211e1499c1230d8c74 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-8.js @@ -7,23 +7,26 @@ es5id: 15.4.4.21-9-8 description: Array.prototype.reduce - no observable effects occur if 'len' is 0 ---*/ - var accessed = false; - var callbackAccessed = false; - function callbackfn() { - callbackAccessed = true; - } +var accessed = false; +var callbackAccessed = false; - var obj = { length: 0 }; +function callbackfn() { + callbackAccessed = true; +} - Object.defineProperty(obj, "0", { - get: function () { - accessed = true; - return 10; - }, - configurable: true - }); +var obj = { + length: 0 +}; - Array.prototype.reduce.call(obj, function () { }, "initialValue"); +Object.defineProperty(obj, "0", { + get: function() { + accessed = true; + return 10; + }, + configurable: true +}); + +Array.prototype.reduce.call(obj, function() {}, "initialValue"); assert.sameValue(accessed, false, 'accessed'); assert.sameValue(callbackAccessed, false, 'callbackAccessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-9.js index aa867346f27abb4b8d12b84ab494afd8a8f79495..0a6ba82e409c433d60b2406c8118582bbd0786ab 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-9.js @@ -9,22 +9,23 @@ description: > number of iterations in step 9 ---*/ - var called = 0; - function callbackfn(accum, val, idx, obj) { - called++; - return accum + val; - } +var called = 0; - var arr = [0, 1, 2, 3]; - Object.defineProperty(arr, "0", { - get: function () { - arr.length = 2; - return 0; - }, - configurable: true - }); +function callbackfn(accum, val, idx, obj) { + called++; + return accum + val; +} - var newAccum = arr.reduce(callbackfn, "initialValue"); +var arr = [0, 1, 2, 3]; +Object.defineProperty(arr, "0", { + get: function() { + arr.length = 2; + return 0; + }, + configurable: true +}); + +var newAccum = arr.reduce(callbackfn, "initialValue"); assert.sameValue(newAccum, "initialValue01", 'newAccum'); assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-1.js index e7f18d3bdcc76ea08807c09819e62c8a67e796e4..274f1bb6eedde3040cfa83278ca7ca4c96a31d6d 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-1.js @@ -9,10 +9,9 @@ description: > and initialValue is present ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - } +function callbackfn(prevVal, curVal, idx, obj) +{} - var arr = new Array(10); +var arr = new Array(10); -assert.sameValue(arr.reduce(callbackfn,5), 5, 'arr.reduce(callbackfn,5)'); +assert.sameValue(arr.reduce(callbackfn, 5), 5, 'arr.reduce(callbackfn,5)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-10.js index 4adec3c10310dfd11948e727435803cb745f3e64..bf0d29423d004a57362d7d2886f4436a8d58c2b5 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-10.js @@ -10,28 +10,31 @@ description: > Object ---*/ - var accessed = false; - var testResult = true; +var accessed = false; +var testResult = true; - function callbackfn(accum, val, idx, obj) { - accessed = true; - if (idx === 3) { - testResult = false; - } - } +function callbackfn(accum, val, idx, obj) { + accessed = true; + if (idx === 3) { + testResult = false; + } +} - var obj = { 2: 2, length: 20 }; +var obj = { + 2: 2, + length: 20 +}; - Object.defineProperty(obj, "0", { - get: function () { - delete Object.prototype[3]; - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + delete Object.prototype[3]; + return 0; + }, + configurable: true +}); - Object.prototype[3] = 1; - Array.prototype.reduce.call(obj, callbackfn); +Object.prototype[3] = 1; +Array.prototype.reduce.call(obj, callbackfn); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-11.js index b2f71de95f25d7632488d1e7372d5ef5fd5bba6e..4636bd54a21d6ec5d2ad47e61d6e851358b985db 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-11.js @@ -9,27 +9,27 @@ description: > causes deleted index property not to be visited on an Array ---*/ - var accessed = false; - var testResult = true; +var accessed = false; +var testResult = true; - function callbackfn(accum, val, idx, obj) { - accessed = true; - if (idx === 1) { - testResult = false; - } - } +function callbackfn(accum, val, idx, obj) { + accessed = true; + if (idx === 1) { + testResult = false; + } +} - var arr = [, , , 3]; - Object.defineProperty(arr, "0", { - get: function () { - delete Array.prototype[1]; - return 0; - }, - configurable: true - }); +var arr = [, , , 3]; +Object.defineProperty(arr, "0", { + get: function() { + delete Array.prototype[1]; + return 0; + }, + configurable: true +}); - Array.prototype[1] = 1; - arr.reduce(callbackfn); +Array.prototype[1] = 1; +arr.reduce(callbackfn); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-12.js index c82150f241e816667898ac9dc6f6b563048c3379..7605c7ebee80bd86b2a8e05a102383c1a933b8e9 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-12.js @@ -10,25 +10,30 @@ description: > on an Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(accum, val, idx, obj) { - if (idx === 1 && val === 1) { - testResult = true; - } - } +function callbackfn(accum, val, idx, obj) { + if (idx === 1 && val === 1) { + testResult = true; + } +} - var obj = { 0: 0, 1: 111, 4: 10, length: 10 }; +var obj = { + 0: 0, + 1: 111, + 4: 10, + length: 10 +}; - Object.defineProperty(obj, "0", { - get: function () { - delete obj[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + delete obj[1]; + return 0; + }, + configurable: true +}); - Object.prototype[1] = 1; - Array.prototype.reduce.call(obj, callbackfn); +Object.prototype[1] = 1; +Array.prototype.reduce.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-13.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-13.js index fa7a8f54d975cb86e9ca2d9a13cbc61890e5c007..4960d60e65f8c6859377efe3c7cd75234ec62490 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-13.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-13.js @@ -10,24 +10,24 @@ description: > on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(accum, val, idx, obj) { - if (idx === 1 && val === 1) { - testResult = true; - } - } - var arr = [0, 111]; +function callbackfn(accum, val, idx, obj) { + if (idx === 1 && val === 1) { + testResult = true; + } +} +var arr = [0, 111]; - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); - Array.prototype[1] = 1; - arr.reduce(callbackfn); +Array.prototype[1] = 1; +arr.reduce(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-14.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-14.js index 590122b87ed2a7375f8195adb302ba36c1d4609b..0d00a323168ef8d22ede06b713e8011c3cdba864 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-14.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-14.js @@ -9,27 +9,27 @@ description: > causes deleted index property not to be visited ---*/ - var accessed = false; - var testResult = true; +var accessed = false; +var testResult = true; - function callbackfn(accum, val, idx, obj) { - accessed = true; - if (idx === 2) { - testResult = false; - } - } +function callbackfn(accum, val, idx, obj) { + accessed = true; + if (idx === 2) { + testResult = false; + } +} - var arr = [0, 1, 2, 3]; +var arr = [0, 1, 2, 3]; - Object.defineProperty(arr, "0", { - get: function () { - arr.length = 2; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + arr.length = 2; + return 0; + }, + configurable: true +}); - arr.reduce(callbackfn); +arr.reduce(callbackfn); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-15.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-15.js index 18cc65818682a7a6447badd43ff7244aca19bf3b..4d42c2ca7865f02d092580550a99dd4b46eae74b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-15.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-15.js @@ -9,30 +9,30 @@ description: > property in step 8 causes prototype index property to be visited ---*/ - var testResult = false; +var testResult = false; - function callbackfn(accum, val, idx, obj) { - if (idx === 2 && val === "prototype") { - testResult = true; - } - } - var arr = [0, 1, 2, 3]; +function callbackfn(accum, val, idx, obj) { + if (idx === 2 && val === "prototype") { + testResult = true; + } +} +var arr = [0, 1, 2, 3]; - Object.defineProperty(Array.prototype, "2", { - get: function () { - return "prototype"; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "2", { + get: function() { + return "prototype"; + }, + configurable: true +}); - Object.defineProperty(arr, "0", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); - arr.reduce(callbackfn); +arr.reduce(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-16.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-16.js index 29c1d4f8e8020a760d569b85f050ab7b9269f3b4..047fc4db91c74c7d9d0374c1c3da363d12a27db6 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-16.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-16.js @@ -10,31 +10,31 @@ description: > flags: [noStrict] ---*/ - var testResult = false; - - function callbackfn(accum, val, idx, obj) { - if (idx === 2 && val === "unconfigurable") { - testResult = true; - } - } - - var arr = [0, 1, 2, 3]; - - Object.defineProperty(arr, "2", { - get: function () { - return "unconfigurable"; - }, - configurable: false - }); - - Object.defineProperty(arr, "0", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); - - arr.reduce(callbackfn); +var testResult = false; + +function callbackfn(accum, val, idx, obj) { + if (idx === 2 && val === "unconfigurable") { + testResult = true; + } +} + +var arr = [0, 1, 2, 3]; + +Object.defineProperty(arr, "2", { + get: function() { + return "unconfigurable"; + }, + configurable: false +}); + +Object.defineProperty(arr, "0", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); + +arr.reduce(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-17.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-17.js index 34cbe86514a2aa3ba6994e371d21cc450dd6b46d..2364819b98f331abb34b263ec334974da52541b8 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-17.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-17.js @@ -9,29 +9,31 @@ description: > visited on an Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(accum, val, idx, obj) { - if (idx === 3 && val === 3) { - testResult = true; - } - } +function callbackfn(accum, val, idx, obj) { + if (idx === 3 && val === 3) { + testResult = true; + } +} - var obj = { length: 5 }; +var obj = { + length: 5 +}; - Object.defineProperty(obj, "1", { - get: function () { - Object.defineProperty(obj, "3", { - get: function () { - return 3; - }, - configurable: true - }); - return 1; - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + Object.defineProperty(obj, "3", { + get: function() { + return 3; + }, + configurable: true + }); + return 1; + }, + configurable: true +}); - Array.prototype.reduce.call(obj, callbackfn, "initialValue"); +Array.prototype.reduce.call(obj, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-18.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-18.js index 9cede28d0738611620d85b6f6990d723c0f289da..94cdebfc31ad860680f85a966b6fca295f5ad81e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-18.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-18.js @@ -9,29 +9,29 @@ description: > visited on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(accum, val, idx, obj) { - if (idx === 1 && val === 1) { - testResult = true; - } - } +function callbackfn(accum, val, idx, obj) { + if (idx === 1 && val === 1) { + testResult = true; + } +} - var arr = [0, , 2]; +var arr = [0, , 2]; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(arr, "1", { - get: function () { - return 1; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(arr, "1", { + get: function() { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - arr.reduce(callbackfn, "initialValue"); +arr.reduce(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-19.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-19.js index 76fb7a81765ea0d8e22830e339b90ac4eaf47917..719447c92e0c1d0d20cfcb75e86abd26fd6a75ea 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-19.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-19.js @@ -9,29 +9,31 @@ description: > on an Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(accum, val, idx, obj) { - if (idx === 1 && val === 6.99) { - testResult = true; - } - } +function callbackfn(accum, val, idx, obj) { + if (idx === 1 && val === 6.99) { + testResult = true; + } +} - var obj = { length: 6 }; +var obj = { + length: 6 +}; - Object.defineProperty(obj, "0", { - get: function () { - Object.defineProperty(Object.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + Object.defineProperty(Object.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - Array.prototype.reduce.call(obj, callbackfn, "initialValue"); +Array.prototype.reduce.call(obj, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-2.js index 42f76e8faea417906ee7b1fe1f654a85b7754bf8..eabeeb5eb14845777c8b66dea31b8e09afe5a91b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-2.js @@ -9,24 +9,24 @@ description: > here ---*/ - var testResult = false; +var testResult = false; - function callbackfn(accum, val, idx, obj) { - if (idx === 2 && val === "2") { - testResult = true; - } - } +function callbackfn(accum, val, idx, obj) { + if (idx === 2 && val === "2") { + testResult = true; + } +} - var obj = {}; +var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - obj[2] = "2"; - return 3; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + obj[2] = "2"; + return 3; + }, + configurable: true +}); - Array.prototype.reduce.call(obj, callbackfn, "initialValue"); +Array.prototype.reduce.call(obj, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-20.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-20.js index 2d52994db6ef1248573bd5d92f64c4ce71263af2..935e8ca3108ee9518f793f05ee6c3ed197d02b9a 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-20.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-20.js @@ -9,29 +9,29 @@ description: > visited on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(accum, val, idx, obj) { - if (idx === 1 && val === 6.99) { - testResult = true; - } - } +function callbackfn(accum, val, idx, obj) { + if (idx === 1 && val === 6.99) { + testResult = true; + } +} - var arr = [0, , 2]; +var arr = [0, , 2]; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(Array.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(Array.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - arr.reduce(callbackfn, "initialValue"); +arr.reduce(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-21.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-21.js index f5ae4f380e97d57054cb9814d378d2bbabeba2e5..200ac1c68e1d6c3340aab418135e69bc48f9c30a 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-21.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-21.js @@ -9,34 +9,37 @@ description: > index property not to be visited on an Array-like object ---*/ - var accessed = false; - var testResult = true; - - function callbackfn(accum, val, idx, obj) { - accessed = true; - if (idx === 1) { - testResult = false; - } - } - - var obj = { 5: 10, length: 10 }; - - Object.defineProperty(obj, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - - Object.defineProperty(obj, "0", { - get: function () { - delete obj[1]; - return 0; - }, - configurable: true - }); - - Array.prototype.reduce.call(obj, callbackfn, "initialValue"); +var accessed = false; +var testResult = true; + +function callbackfn(accum, val, idx, obj) { + accessed = true; + if (idx === 1) { + testResult = false; + } +} + +var obj = { + 5: 10, + length: 10 +}; + +Object.defineProperty(obj, "1", { + get: function() { + return 6.99; + }, + configurable: true +}); + +Object.defineProperty(obj, "0", { + get: function() { + delete obj[1]; + return 0; + }, + configurable: true +}); + +Array.prototype.reduce.call(obj, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-22.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-22.js index f824832cb269e3cf5dad25c3a73e2de3e4b7770e..64402e07c937cbad2deae480aa613f22ad0c0567 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-22.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-22.js @@ -9,34 +9,34 @@ description: > index property not to be visited on an Array ---*/ - var accessed = false; - var testResult = true; - - function callbackfn(accum, val, idx, obj) { - accessed = true; - if (idx === 1) { - testResult = false; - } - } - - var arr = [1, 2, 4]; - - Object.defineProperty(arr, "1", { - get: function () { - return "6.99"; - }, - configurable: true - }); - - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); - - arr.reduce(callbackfn, "initialValue"); +var accessed = false; +var testResult = true; + +function callbackfn(accum, val, idx, obj) { + accessed = true; + if (idx === 1) { + testResult = false; + } +} + +var arr = [1, 2, 4]; + +Object.defineProperty(arr, "1", { + get: function() { + return "6.99"; + }, + configurable: true +}); + +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); + +arr.reduce(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-23.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-23.js index 3ee4365ed61d4924d72ba57e5b96848f8475bd0a..236167f7ed350cd02eb6572593976f3f317e3aed 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-23.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-23.js @@ -9,28 +9,31 @@ description: > deleted index property not to be visited on an Array-like Object ---*/ - var accessed = false; - var testResult = true; +var accessed = false; +var testResult = true; - function callbackfn(accum, val, idx, obj) { - accessed = true; - if (idx === 3) { - testResult = false; - } - } +function callbackfn(accum, val, idx, obj) { + accessed = true; + if (idx === 3) { + testResult = false; + } +} - var obj = { 2: 2, length: 20 }; +var obj = { + 2: 2, + length: 20 +}; - Object.defineProperty(obj, "0", { - get: function () { - delete Object.prototype[3]; - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + delete Object.prototype[3]; + return 0; + }, + configurable: true +}); - Object.prototype[3] = 1; - Array.prototype.reduce.call(obj, callbackfn, "initialValue"); +Object.prototype[3] = 1; +Array.prototype.reduce.call(obj, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-24.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-24.js index 18d1e20694253831afe36a87c3e43286860d619c..7a2cbcd165b3b0840b064cc6520bd496c9eab342 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-24.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-24.js @@ -9,27 +9,27 @@ description: > deleted index property not to be visited on an Array ---*/ - var accessed = false; - var testResult = true; +var accessed = false; +var testResult = true; - function callbackfn(accum, val, idx, obj) { - accessed = true; - if (idx === 1) { - testResult = false; - } - } +function callbackfn(accum, val, idx, obj) { + accessed = true; + if (idx === 1) { + testResult = false; + } +} - var arr = [0, , , 3]; - Object.defineProperty(arr, "0", { - get: function () { - delete Array.prototype[1]; - return 0; - }, - configurable: true - }); +var arr = [0, , , 3]; +Object.defineProperty(arr, "0", { + get: function() { + delete Array.prototype[1]; + return 0; + }, + configurable: true +}); - Array.prototype[1] = 1; - arr.reduce(callbackfn, "initialValue"); +Array.prototype[1] = 1; +arr.reduce(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-25.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-25.js index 83c1b449e9f6fc654afb8321d1fc90916c6c42df..311f9f21f0bda2d32069b9210ddcb4ed2bfde46c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-25.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-25.js @@ -10,25 +10,30 @@ description: > Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(accum, val, idx, obj) { - if (idx === 1 && val === 1) { - testResult = true; - } - } +function callbackfn(accum, val, idx, obj) { + if (idx === 1 && val === 1) { + testResult = true; + } +} - var obj = { 0: 0, 1: 111, 4: 10, length: 10 }; +var obj = { + 0: 0, + 1: 111, + 4: 10, + length: 10 +}; - Object.defineProperty(obj, "0", { - get: function () { - delete obj[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + delete obj[1]; + return 0; + }, + configurable: true +}); - Object.prototype[1] = 1; - Array.prototype.reduce.call(obj, callbackfn, "initialValue"); +Object.prototype[1] = 1; +Array.prototype.reduce.call(obj, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-26.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-26.js index c5b22131b127d87e83a5ed3e68dc307aef3dcf58..8a570c25eea5261d6d378e015d247363e85ee990 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-26.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-26.js @@ -9,24 +9,24 @@ description: > property causes prototype index property to be visited on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(accum, val, idx, obj) { - if (idx === 1 && val === 1) { - testResult = true; - } - } - var arr = [0, 111]; +function callbackfn(accum, val, idx, obj) { + if (idx === 1 && val === 1) { + testResult = true; + } +} +var arr = [0, 111]; - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); - Array.prototype[1] = 1; - arr.reduce(callbackfn, "initialValue"); +Array.prototype[1] = 1; +arr.reduce(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-27.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-27.js index a20faec87f6f3caf3a3a5ca700193e7ac3930317..bfbf66fbf4298b9a1920043d3ad0d58f7c67921d 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-27.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-27.js @@ -9,27 +9,27 @@ description: > index property not to be visited ---*/ - var accessed = false; - var testResult = true; +var accessed = false; +var testResult = true; - function callbackfn(accum, val, idx, obj) { - accessed = true; - if (idx === 2) { - testResult = false; - } - } +function callbackfn(accum, val, idx, obj) { + accessed = true; + if (idx === 2) { + testResult = false; + } +} - var arr = [0, 1, 2, 3]; +var arr = [0, 1, 2, 3]; - Object.defineProperty(arr, "0", { - get: function () { - arr.length = 2; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + arr.length = 2; + return 0; + }, + configurable: true +}); - arr.reduce(callbackfn, "initialValue"); +arr.reduce(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-28.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-28.js index 44bdb414cf9f3694c771b6d586ddcc0397236295..ba16dafa85b5b2f53386cd910ffee32875b63f66 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-28.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-28.js @@ -9,30 +9,30 @@ description: > property causes prototype index property to be visited ---*/ - var testResult = false; +var testResult = false; - function callbackfn(accum, val, idx, obj) { - if (idx === 2 && val === "prototype") { - testResult = true; - } - } - var arr = [0, 1, 2, 3]; +function callbackfn(accum, val, idx, obj) { + if (idx === 2 && val === "prototype") { + testResult = true; + } +} +var arr = [0, 1, 2, 3]; - Object.defineProperty(Array.prototype, "2", { - get: function () { - return "prototype"; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "2", { + get: function() { + return "prototype"; + }, + configurable: true +}); - Object.defineProperty(arr, "0", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); - arr.reduce(callbackfn, "initialValue"); +arr.reduce(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-29.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-29.js index a4f5167437b1843cc105f2208ffff37049f094cf..1c872c518c81123c77eb61977ad4504a3274d4cb 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-29.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-29.js @@ -10,31 +10,31 @@ description: > flags: [noStrict] ---*/ - var testResult = false; - - function callbackfn(accum, val, idx, obj) { - if (idx === 2 && val === "unconfigurable") { - testResult = true; - } - } - - var arr = [0, 1, 2, 3]; - - Object.defineProperty(arr, "2", { - get: function () { - return "unconfigurable"; - }, - configurable: false - }); - - Object.defineProperty(arr, "0", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); - - arr.reduce(callbackfn, "initialValue"); +var testResult = false; + +function callbackfn(accum, val, idx, obj) { + if (idx === 2 && val === "unconfigurable") { + testResult = true; + } +} + +var arr = [0, 1, 2, 3]; + +Object.defineProperty(arr, "2", { + get: function() { + return "unconfigurable"; + }, + configurable: false +}); + +Object.defineProperty(arr, "0", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); + +arr.reduce(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-3.js index 8f8382931eb071cb83c74ddc3f8f444fb8eaece2..2f72b891a42faa5e57ce1df299e7ec23a52124e5 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-3.js @@ -9,27 +9,30 @@ description: > here ---*/ - var accessed = false; - var testResult = true; +var accessed = false; +var testResult = true; - function callbackfn(accum, val, idx, obj) { - accessed = true; - if (idx === 2) { - testResult = false; - } - } +function callbackfn(accum, val, idx, obj) { + accessed = true; + if (idx === 2) { + testResult = false; + } +} - var obj = { 2: "2", 3: 10 }; +var obj = { + 2: "2", + 3: 10 +}; - Object.defineProperty(obj, "length", { - get: function () { - delete obj[2]; - return 5; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + delete obj[2]; + return 5; + }, + configurable: true +}); - Array.prototype.reduce.call(obj, callbackfn, "initialValue"); +Array.prototype.reduce.call(obj, callbackfn, "initialValue"); assert(accessed, 'accessed !== true'); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-4.js index 249f49a291b1d7ddceb2bab201424ddfd491479e..208fd04f221621ef06b0a35d26c7dfc7a3ef9333 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-4.js @@ -9,29 +9,31 @@ description: > 8 are visited on an Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(accum, val, idx, obj) { - if (idx === 3 && val === 3) { - testResult = true; - } - } +function callbackfn(accum, val, idx, obj) { + if (idx === 3 && val === 3) { + testResult = true; + } +} - var obj = { length: 5 }; +var obj = { + length: 5 +}; - Object.defineProperty(obj, "1", { - get: function () { - Object.defineProperty(obj, "3", { - get: function () { - return 3; - }, - configurable: true - }); - return 1; - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + Object.defineProperty(obj, "3", { + get: function() { + return 3; + }, + configurable: true + }); + return 1; + }, + configurable: true +}); - Array.prototype.reduce.call(obj, callbackfn); +Array.prototype.reduce.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-5.js index 43b8766cd20675a0d7cd8ca04985b5793699f748..872321367ddf90348b1072a4a956fc3f8b95de6d 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-5.js @@ -9,29 +9,29 @@ description: > 8 are visited on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(accum, val, idx, obj) { - if (idx === 1 && val === 1) { - testResult = true; - } - } +function callbackfn(accum, val, idx, obj) { + if (idx === 1 && val === 1) { + testResult = true; + } +} - var arr = [0, , 2]; +var arr = [0, , 2]; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(arr, "1", { - get: function () { - return 1; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(arr, "1", { + get: function() { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - arr.reduce(callbackfn); +arr.reduce(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-6.js index 85e075d8525e102566102c27863e543694211da3..6002cbd912cdd966cff7ddadc0c366cd5c5d876e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-6.js @@ -9,29 +9,31 @@ description: > are visited on an Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(accum, val, idx, obj) { - if (idx === 1 && val === 6.99) { - testResult = true; - } - } +function callbackfn(accum, val, idx, obj) { + if (idx === 1 && val === 6.99) { + testResult = true; + } +} - var obj = { length: 6 }; +var obj = { + length: 6 +}; - Object.defineProperty(obj, "0", { - get: function () { - Object.defineProperty(Object.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + Object.defineProperty(Object.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - Array.prototype.reduce.call(obj, callbackfn); +Array.prototype.reduce.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-7.js index 67e1fc135d2febde3a4e64b31fc2c8db0ceb1ec7..b41a6c1378aa04080e3d2eaf09f0065c54dfa4fa 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-7.js @@ -9,29 +9,29 @@ description: > are visited on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(accum, val, idx, obj) { - if (idx === 1 && val === 6.99) { - testResult = true; - } - } +function callbackfn(accum, val, idx, obj) { + if (idx === 1 && val === 6.99) { + testResult = true; + } +} - var arr = [0, , 2]; +var arr = [0, , 2]; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(Array.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(Array.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - arr.reduce(callbackfn); +arr.reduce(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-8.js index 219d2df5605d3110fe549b245e8a87d59a9419c4..4386fa4a4834ca9f376713986cec7d26f6ec84d8 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-8.js @@ -9,34 +9,37 @@ description: > deleted index property not to be visited on an Array-like object ---*/ - var accessed = false; - var testResult = true; - - function callbackfn(accum, val, idx, obj) { - accessed = true; - if (idx === 1) { - testResult = false; - } - } - - var obj = { 5: 10, length: 10 }; - - Object.defineProperty(obj, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - - Object.defineProperty(obj, "0", { - get: function () { - delete obj[1]; - return 0; - }, - configurable: true - }); - - Array.prototype.reduce.call(obj, callbackfn); +var accessed = false; +var testResult = true; + +function callbackfn(accum, val, idx, obj) { + accessed = true; + if (idx === 1) { + testResult = false; + } +} + +var obj = { + 5: 10, + length: 10 +}; + +Object.defineProperty(obj, "1", { + get: function() { + return 6.99; + }, + configurable: true +}); + +Object.defineProperty(obj, "0", { + get: function() { + delete obj[1]; + return 0; + }, + configurable: true +}); + +Array.prototype.reduce.call(obj, callbackfn); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-9.js index ab402f336741e0f3b5d0a926b85033a2398864f7..2f9739a3d16d6a373fa768597298c865bb179470 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-9.js @@ -9,27 +9,27 @@ description: > deleted index property not to be visited on an Array ---*/ - var accessed = false; - var testResult = true; +var accessed = false; +var testResult = true; - function callbackfn(accum, val, idx, obj) { - accessed = true; - if (idx === 1) { - testResult = false; - } - } +function callbackfn(accum, val, idx, obj) { + accessed = true; + if (idx === 1) { + testResult = false; + } +} - var arr = [1, 2, 4]; +var arr = [1, 2, 4]; - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); - arr.reduce(callbackfn); +arr.reduce(callbackfn); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-1.js index 9f22078b8b5df90bd4ce21312e63d7d0e5bab7d1..82bb1fd5fddc5c8e2da8562a5ef14ed394a5b0a4 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-1.js @@ -9,15 +9,16 @@ description: > been assigned values ---*/ - var callCnt = 0; - function callbackfn(prevVal, curVal, idx, obj) - { - callCnt++; - return curVal; - } +var callCnt = 0; - var arr = new Array(10); - arr[0] = arr[1] = undefined; //explicitly assigning a value +function callbackfn(prevVal, curVal, idx, obj) +{ + callCnt++; + return curVal; +} + +var arr = new Array(10); +arr[0] = arr[1] = undefined; //explicitly assigning a value assert.sameValue(arr.reduce(callbackfn), undefined, 'arr.reduce(callbackfn)'); assert.sameValue(callCnt, 1, 'callCnt'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-1.js index 8e4385ae23ae861531b7eeb0673b330a1b87b924..83910eb3550540e16fd7d298e229279f829ba79f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-1.js @@ -9,15 +9,21 @@ description: > property on an Array-like object ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; +var initialValue = 0; - var obj = { 0: 0, 1: 1, 2: 2, length: 2 }; - Array.prototype.reduce.call(obj, callbackfn, initialValue); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} + +var obj = { + 0: 0, + 1: 1, + 2: 2, + length: 2 +}; +Array.prototype.reduce.call(obj, callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-10.js index 35db68b11f84fd1f12cf8f7ca000b9b40a17b4c4..a297b03616b170666d11634b98d54071c53d4a73 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-10.js @@ -9,23 +9,24 @@ description: > property on an Array ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; +var initialValue = 0; - var arr = [0, , 2]; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} - Object.defineProperty(arr, "1", { - get: function () { - return 1; - }, - configurable: true - }); +var arr = [0, , 2]; - arr.reduce(callbackfn, initialValue); +Object.defineProperty(arr, "1", { + get: function() { + return 1; + }, + configurable: true +}); + +arr.reduce(callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-11.js index 3468f85edc188475a0830b1461ae3293b5ecf319..b5cc2ad9b2056f970bf0d5b1ec0346a3bb3c84ff 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-11.js @@ -10,29 +10,34 @@ description: > Array-like object ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === "11"); - } - } - - var proto = { 0: 0, 1: 1, 2: 2 }; - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 3; - - Object.defineProperty(child, "1", { - get: function () { - return "11"; - }, - configurable: true - }); - - Array.prototype.reduce.call(child, callbackfn, initialValue); +var testResult = false; +var initialValue = 0; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === "11"); + } +} + +var proto = { + 0: 0, + 1: 1, + 2: 2 +}; + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 3; + +Object.defineProperty(child, "1", { + get: function() { + return "11"; + }, + configurable: true +}); + +Array.prototype.reduce.call(child, callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-12.js index 85072151e39c57c8b0954a04f0a38fbbe8eb1076..de4c3f77b59218143573d2e0adc946a5541ba088 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-12.js @@ -9,24 +9,25 @@ description: > property that overrides an inherited data property on an Array ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === "11"); - } - } +var testResult = false; +var initialValue = 0; - Array.prototype[1] = 1; - var arr = [0, ,2]; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === "11"); + } +} - Object.defineProperty(arr, "1", { - get: function () { - return "11"; - }, - configurable: true - }); +Array.prototype[1] = 1; +var arr = [0, , 2]; - arr.reduce(callbackfn, initialValue); +Object.defineProperty(arr, "1", { + get: function() { + return "11"; + }, + configurable: true +}); + +arr.reduce(callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-13.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-13.js index 49d727d7a5107acc68faf20223e3cb23d32e7292..c29ed6061a2d168f3fa791f1fa1bb1842c849af5 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-13.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-13.js @@ -10,36 +10,40 @@ description: > Array-like object ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === "11"); - } - } - - var proto = { 0: 0, 2: 2}; - - Object.defineProperty(proto, "1", { - get: function () { - return 1; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 3; - - Object.defineProperty(child, "1", { - get: function () { - return "11"; - }, - configurable: true - }); - - Array.prototype.reduce.call(child, callbackfn, initialValue); +var testResult = false; +var initialValue = 0; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === "11"); + } +} + +var proto = { + 0: 0, + 2: 2 +}; + +Object.defineProperty(proto, "1", { + get: function() { + return 1; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 3; + +Object.defineProperty(child, "1", { + get: function() { + return "11"; + }, + configurable: true +}); + +Array.prototype.reduce.call(child, callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-14.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-14.js index 439002290c9a808257ce33dad1710b7cde59cfaf..5d2ea3e9cc2b2c97c0f67ff829cc08216464ce58 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-14.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-14.js @@ -9,29 +9,30 @@ description: > property that overrides an inherited accessor property on an Array ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === "11"); - } - } +var testResult = false; +var initialValue = 0; - Object.defineProperty(Array.prototype, "1", { - get: function () { - return 1; - }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === "11"); + } +} - var arr = [0, ,2]; +Object.defineProperty(Array.prototype, "1", { + get: function() { + return 1; + }, + configurable: true +}); - Object.defineProperty(arr, "1", { - get: function () { - return "11"; - }, - configurable: true - }); - arr.reduce(callbackfn, initialValue); +var arr = [0, , 2]; + +Object.defineProperty(arr, "1", { + get: function() { + return "11"; + }, + configurable: true +}); +arr.reduce(callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-15.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-15.js index 8a48197782b3a285c33e1e02215b979ee81e62ac..fb6f4b4307ac239985a2e1f727f531a5944f8056 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-15.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-15.js @@ -9,29 +9,33 @@ description: > accessor property on an Array-like object ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } - - var proto = { 0: 0, 2: 2 }; - - Object.defineProperty(proto, "1", { - get: function () { - return 1; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 3; - - Array.prototype.reduce.call(child, callbackfn, initialValue); +var testResult = false; +var initialValue = 0; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} + +var proto = { + 0: 0, + 2: 2 +}; + +Object.defineProperty(proto, "1", { + get: function() { + return 1; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 3; + +Array.prototype.reduce.call(child, callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-16.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-16.js index 0b26a82315cfc018bc3b16239da91644f7ae3ea7..ea5b70bf7eab4e4c34189e296586deaa5d730c04 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-16.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-16.js @@ -9,23 +9,24 @@ description: > accessor property on an Array ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; +var initialValue = 0; - Object.defineProperty(Array.prototype, "1", { - get: function () { - return 1; - }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} - var arr = [0, , 2, ]; +Object.defineProperty(Array.prototype, "1", { + get: function() { + return 1; + }, + configurable: true +}); - arr.reduce(callbackfn, initialValue); +var arr = [0, , 2, ]; + +arr.reduce(callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-17.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-17.js index 72e9c9c3e12ccbd85b7b8104880c8b84123b943d..2612938851a4a4aa93fb2a38a22128052fa7389f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-17.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-17.js @@ -9,21 +9,26 @@ description: > property without a get function on an Array-like object ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === undefined); - } - } +var testResult = false; +var initialValue = 0; - var obj = { 0: 0, 2: 2, length: 3 }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === undefined); + } +} - Object.defineProperty(obj, "1", { - set: function () { }, - configurable: true - }); +var obj = { + 0: 0, + 2: 2, + length: 3 +}; - Array.prototype.reduce.call(obj, callbackfn, initialValue); +Object.defineProperty(obj, "1", { + set: function() {}, + configurable: true +}); + +Array.prototype.reduce.call(obj, callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-18.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-18.js index e5e1c98e3e383db2580352606a9e7d23ab43d05f..8b1b27917f6049ab17de5c1357123c197bcd475a 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-18.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-18.js @@ -9,21 +9,22 @@ description: > property without a get function on an Array ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === undefined); - } - } +var testResult = false; +var initialValue = 0; - var arr = [0, , 2]; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === undefined); + } +} - Object.defineProperty(arr, "1", { - set: function () { }, - configurable: true - }); +var arr = [0, , 2]; - arr.reduce(callbackfn, initialValue); +Object.defineProperty(arr, "1", { + set: function() {}, + configurable: true +}); + +arr.reduce(callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-19.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-19.js index a8ab13f94b3eec3e5b05eb9d072628c3c5e729a7..d385edd5831b3ce023e6a4ea82687f6b34c6748a 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-19.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-19.js @@ -10,28 +10,33 @@ description: > accessor property on an Array-like object ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === undefined); - } - } - - Object.defineProperty(Object.prototype, "1", { - get: function () { - return 1; - }, - configurable: true - }); - - var obj = { 0: 0, 2: 2, length: 3 }; - - Object.defineProperty(obj, "1", { - set: function () { }, - configurable: true - }); - - Array.prototype.reduce.call(obj, callbackfn, initialValue); +var testResult = false; +var initialValue = 0; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === undefined); + } +} + +Object.defineProperty(Object.prototype, "1", { + get: function() { + return 1; + }, + configurable: true +}); + +var obj = { + 0: 0, + 2: 2, + length: 3 +}; + +Object.defineProperty(obj, "1", { + set: function() {}, + configurable: true +}); + +Array.prototype.reduce.call(obj, callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-2.js index cbabbcf459daa28ae749325ffd1077a124fe7263..bec49675d69d8ce703479fea426d60ac2ebe033f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-2.js @@ -9,15 +9,16 @@ description: > property on an Array ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; +var initialValue = 0; - var arr = [0, 1]; - arr.reduce(callbackfn, initialValue); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} + +var arr = [0, 1]; +arr.reduce(callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-20.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-20.js index 5596e002fc274f023ba125a00aa05a95aa6197bf..96d6089f473799da94b5b9867f6ded53792e650b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-20.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-20.js @@ -10,27 +10,28 @@ description: > accessor property on an Array ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === undefined); - } - } +var testResult = false; +var initialValue = 0; - Object.defineProperty(Array.prototype, "1", { - get: function () { - return 11; - }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === undefined); + } +} - var arr = [0, , 2]; - Object.defineProperty(arr, "1", { - set: function () { }, - configurable: true - }); +Object.defineProperty(Array.prototype, "1", { + get: function() { + return 11; + }, + configurable: true +}); - arr.reduce(callbackfn, initialValue); +var arr = [0, , 2]; +Object.defineProperty(arr, "1", { + set: function() {}, + configurable: true +}); + +arr.reduce(callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-21.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-21.js index 160a4ea8e13cb29e7a70cae73e99907f70b67465..4994164fdd4e8fdcb6a1c675f9923fe8c8704e82 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-21.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-21.js @@ -9,27 +9,31 @@ description: > accessor property without a get function on an Array-like object ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === undefined); - } - } +var testResult = false; +var initialValue = 0; - var proto = { 0: 0, 2: 2 }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === undefined); + } +} - Object.defineProperty(proto, "1", { - set: function () { }, - configurable: true - }); +var proto = { + 0: 0, + 2: 2 +}; - var Con = function () { }; - Con.prototype = proto; +Object.defineProperty(proto, "1", { + set: function() {}, + configurable: true +}); - var child = new Con(); - child.length = 3; +var Con = function() {}; +Con.prototype = proto; - Array.prototype.reduce.call(child, callbackfn, initialValue); +var child = new Con(); +child.length = 3; + +Array.prototype.reduce.call(child, callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-22.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-22.js index e6a171d69368e423719a9ab9470a6fc5342d1f33..b906e19e77cd54afd357bdc4f771c0645e9ad1d8 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-22.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-22.js @@ -9,21 +9,22 @@ description: > accessor property without a get function on an Array ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === undefined); - } - } +var testResult = false; +var initialValue = 0; - Object.defineProperty(Array.prototype, "1", { - set: function () { }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === undefined); + } +} - var arr = [0, , 2]; +Object.defineProperty(Array.prototype, "1", { + set: function() {}, + configurable: true +}); - arr.reduce(callbackfn, initialValue); +var arr = [0, , 2]; + +arr.reduce(callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-25.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-25.js index dc5a6a969b4b177efaa49b4574b837a3ab82a05a..08713388f0ee1a328e37eca2faf3774e3f394a7e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-25.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-25.js @@ -10,18 +10,19 @@ description: > less than number of parameters) ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; +var initialValue = 0; - var func = function (a, b, c) { - Array.prototype.reduce.call(arguments, callbackfn, initialValue); - }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} - func(0, 1); +var func = function(a, b, c) { + Array.prototype.reduce.call(arguments, callbackfn, initialValue); +}; + +func(0, 1); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-26.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-26.js index a941dc65f60d9c80c88711bcf3066d6035cb9c92..d8ce4350b2d430d243c5c5d003c312e423080399 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-26.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-26.js @@ -10,18 +10,19 @@ description: > number of parameters) ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 2) { - testResult = (curVal === 2); - } - } +var testResult = false; +var initialValue = 0; - var func = function (a, b, c) { - Array.prototype.reduce.call(arguments, callbackfn, initialValue); - }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 2) { + testResult = (curVal === 2); + } +} - func(0, 1, 2); +var func = function(a, b, c) { + Array.prototype.reduce.call(arguments, callbackfn, initialValue); +}; + +func(0, 1, 2); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-27.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-27.js index 2907f2210f7240b9c8132f6d552d2b862ac473ee..40b63f98772a6fb2cabe18d13291eee600dc7e80 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-27.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-27.js @@ -10,18 +10,19 @@ description: > greater than number of parameters) ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 3) { - testResult = (curVal === 3); - } - } +var testResult = false; +var initialValue = 0; - var func = function (a, b, c) { - Array.prototype.reduce.call(arguments, callbackfn, initialValue); - }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 3) { + testResult = (curVal === 3); + } +} - func(0, 1, 2, 3); +var func = function(a, b, c) { + Array.prototype.reduce.call(arguments, callbackfn, initialValue); +}; + +func(0, 1, 2, 3); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-28.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-28.js index 9422c48fcd19914249c1b7b1ef5eeed478acfa6d..92981a4a9fffe5b053cba4bedf4a6fa274b543a4 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-28.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-28.js @@ -9,16 +9,17 @@ description: > implements its own property get method ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === "1"); - } - } +var testResult = false; +var initialValue = 0; - var str = new String("012"); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === "1"); + } +} - Array.prototype.reduce.call(str, callbackfn, initialValue); +var str = new String("012"); + +Array.prototype.reduce.call(str, callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-29.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-29.js index 9003db41a2dec10ac30c30650913c46c68e02d2e..270742aa9c4eb8dbaf45f598eb847586eff6a3ae 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-29.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-29.js @@ -9,22 +9,23 @@ description: > implements its own property get method ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; +var initialValue = 0; - var obj = function (a, b, c) { - return a + b + c; - }; - obj[0] = 0; - obj[1] = 1; - obj[2] = 2; - obj[3] = 3; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} - Array.prototype.reduce.call(obj, callbackfn, initialValue); +var obj = function(a, b, c) { + return a + b + c; +}; +obj[0] = 0; +obj[1] = 1; +obj[2] = 2; +obj[3] = 3; + +Array.prototype.reduce.call(obj, callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-3.js index 19a4e19a09c66f9c258a0799a098d2d7affd0cca..0a23d5c010c011c256d14b1dcf0259bb9552f4ca 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-3.js @@ -10,23 +10,29 @@ description: > Array-like object ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === "11"); - } - } +var testResult = false; +var initialValue = 0; - var proto = { 0: 0, 1: 1, 2: 2, length: 2 }; - var Con = function () { }; - Con.prototype = proto; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === "11"); + } +} - var child = new Con(); - child[1] = "11"; - child[2] = "22"; - child.length = 3; +var proto = { + 0: 0, + 1: 1, + 2: 2, + length: 2 +}; +var Con = function() {}; +Con.prototype = proto; - Array.prototype.reduce.call(child, callbackfn, initialValue); +var child = new Con(); +child[1] = "11"; +child[2] = "22"; +child.length = 3; + +Array.prototype.reduce.call(child, callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-30.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-30.js index 49c26b0e6fdf5fd794d45115f6abf978033ddd1e..46dfa9febf251e383c985353122322783eb9e3c8 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-30.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-30.js @@ -9,36 +9,37 @@ description: > iterations is observed on an Array ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } - - var arr = [, , 2]; - var preIterVisible = false; - - Object.defineProperty(arr, "0", { - get: function () { - preIterVisible = true; - return 0; - }, - configurable: true - }); - - Object.defineProperty(arr, "1", { - get: function () { - if (preIterVisible) { - return 1; - } else { - return 100; - } - }, - configurable: true - }); - - arr.reduce(callbackfn, initialValue); +var testResult = false; +var initialValue = 0; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} + +var arr = [, , 2]; +var preIterVisible = false; + +Object.defineProperty(arr, "0", { + get: function() { + preIterVisible = true; + return 0; + }, + configurable: true +}); + +Object.defineProperty(arr, "1", { + get: function() { + if (preIterVisible) { + return 1; + } else { + return 100; + } + }, + configurable: true +}); + +arr.reduce(callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-31.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-31.js index f948d29786ea02f1a6287d9ff6a4a4435796215b..db862cce1758b9c1af9236b6ada4d6a511db50bd 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-31.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-31.js @@ -9,36 +9,40 @@ description: > iterations is observed on an Array-like object ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } - - var obj = { 2: 2, length: 3 }; - var preIterVisible = false; - - Object.defineProperty(obj, "0", { - get: function () { - preIterVisible = true; - return 0; - }, - configurable: true - }); - - Object.defineProperty(obj, "1", { - get: function () { - if (preIterVisible) { - return 1; - } else { - return "11"; - } - }, - configurable: true - }); - - Array.prototype.reduce.call(obj, callbackfn, initialValue); +var testResult = false; +var initialValue = 0; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} + +var obj = { + 2: 2, + length: 3 +}; +var preIterVisible = false; + +Object.defineProperty(obj, "0", { + get: function() { + preIterVisible = true; + return 0; + }, + configurable: true +}); + +Object.defineProperty(obj, "1", { + get: function() { + if (preIterVisible) { + return 1; + } else { + return "11"; + } + }, + configurable: true +}); + +Array.prototype.reduce.call(obj, callbackfn, initialValue); assert(testResult, 'testResult !== 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 3654543c5ec4526da8163507cc558a69143174f3..787d0261c9cd829faaccc0a08575e1493cb92334 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 @@ -9,25 +9,30 @@ description: > terminate iteration on an Array-like object ---*/ - var accessed = false; - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx >= 1) { - accessed = true; - testResult = (curVal >= 1); - } - } +var accessed = false; +var testResult = false; +var initialValue = 0; - var obj = { 0: 0, 2: 2, length: 3 }; - Object.defineProperty(obj, "1", { - get: function () { - throw new RangeError("unhandle exception happened in getter"); - }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx >= 1) { + accessed = true; + testResult = (curVal >= 1); + } +} + +var obj = { + 0: 0, + 2: 2, + length: 3 +}; +Object.defineProperty(obj, "1", { + get: function() { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true +}); assert.throws(RangeError, function() { - Array.prototype.reduce.call(obj, callbackfn, initialValue); + Array.prototype.reduce.call(obj, callbackfn, initialValue); }); 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 45c8487f924a58978be75623885ca001868117bc..eb596116ae30cd8cf309631c0a228c18c08ad825 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 @@ -9,26 +9,27 @@ description: > terminate iteration on an Array ---*/ - var accessed = false; - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx >= 1) { - accessed = true; - testResult = (curVal >= 1); - } - } +var accessed = false; +var testResult = false; +var initialValue = 0; - var arr = [0, , 2]; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx >= 1) { + accessed = true; + testResult = (curVal >= 1); + } +} - Object.defineProperty(arr, "1", { - get: function () { - throw new RangeError("unhandle exception happened in getter"); - }, - configurable: true - }); +var arr = [0, , 2]; + +Object.defineProperty(arr, "1", { + get: function() { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true +}); assert.throws(RangeError, function() { - arr.reduce(callbackfn, initialValue); + arr.reduce(callbackfn, initialValue); }); 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-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-4.js index 5be0e63fc6dfbefae9613b7846f2f4474c25da63..0f26cabfefee3748b53a2abddae6928bc0d19021 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-4.js @@ -9,15 +9,16 @@ description: > property that overrides an inherited data property on an Array ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; +var initialValue = 0; - Array.prototype[1] = "3"; - [0, 1, 2].reduce(callbackfn, initialValue); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} + +Array.prototype[1] = "3"; +[0, 1, 2].reduce(callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-5.js index fc93b44d16a904017a13c4f1aef525cd757e1b8a..44cb554c708be3e676e0ea9eea35b6e8b9be6dde 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-5.js @@ -10,36 +10,37 @@ description: > Array-like object ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 0) { - testResult = (curVal === "9"); - } - } +var testResult = false; +var initialValue = 0; - var proto = {}; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 0) { + testResult = (curVal === "9"); + } +} - Object.defineProperty(proto, "0", { - get: function () { - return 0; - }, - configurable: true - }); +var proto = {}; - var Con = function () { }; - Con.prototype = proto; +Object.defineProperty(proto, "0", { + get: function() { + return 0; + }, + configurable: true +}); - var child = new Con(); - child.length = 2; +var Con = function() {}; +Con.prototype = proto; - Object.defineProperty(child, "0", { - value: "9", - configurable: true - }); +var child = new Con(); +child.length = 2; - child[1] = "1"; +Object.defineProperty(child, "0", { + value: "9", + configurable: true +}); - Array.prototype.reduce.call(child, callbackfn, initialValue); +child[1] = "1"; + +Array.prototype.reduce.call(child, callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-6.js index ee27f62425f09e2256a05dd6163ccbfd6eda46d9..d3aca565c0e71946080c2ab75e00864fc2b381df 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-6.js @@ -9,20 +9,21 @@ description: > property that overrides an inherited accessor property on an Array ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; +var initialValue = 0; - Object.defineProperty(Array.prototype, "1", { - get: function () { - return "9"; - }, - configurable: true - }); - [0, 1, 2].reduce(callbackfn, initialValue); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} + +Object.defineProperty(Array.prototype, "1", { + get: function() { + return "9"; + }, + configurable: true +}); +[0, 1, 2].reduce(callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-7.js index b20d880b3b2f055c22556dae81d91d9456f21c17..49844b47d87433e8662b32ec7a5a61e6d5a4be64 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-7.js @@ -9,21 +9,27 @@ description: > property on an Array-like object ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; +var initialValue = 0; - var proto = { 0: 0, 1: 1, 2: 2, length: 3 }; - var Con = function () { }; - Con.prototype = proto; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} - var child = new Con(); - child.length = 3; +var proto = { + 0: 0, + 1: 1, + 2: 2, + length: 3 +}; +var Con = function() {}; +Con.prototype = proto; - Array.prototype.reduce.call(child, callbackfn, initialValue); +var child = new Con(); +child.length = 3; + +Array.prototype.reduce.call(child, callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-8.js index 5906f0d472a4fc7c16396c975c578d3753d70039..08a408abd6676b494fcdecac695e6d82b886b156 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-8.js @@ -9,17 +9,18 @@ description: > property on an Array ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; +var initialValue = 0; - Array.prototype[0] = 0; - Array.prototype[1] = 1; - Array.prototype[2] = 2; - [, , , ].reduce(callbackfn, initialValue); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} + +Array.prototype[0] = 0; +Array.prototype[1] = 1; +Array.prototype[2] = 2; +[, , , ].reduce(callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-9.js index 8dcce90a16a457714f3372caf9c5743165df7d67..5188213e3e4e5a4307e0d67e8ed6ac7840e103f7 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-9.js @@ -9,22 +9,27 @@ description: > property on an Array-like object ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; +var initialValue = 0; - var obj = { 0: 0, 2: 2, length: 3 }; - Object.defineProperty(obj, "1", { - get: function () { - return 1; - }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} - Array.prototype.reduce.call(obj, callbackfn, initialValue); +var obj = { + 0: 0, + 2: 2, + length: 3 +}; +Object.defineProperty(obj, "1", { + get: function() { + return 1; + }, + configurable: true +}); + +Array.prototype.reduce.call(obj, callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-1.js index 0b5a92f7636985e35f3586e809ee27b07b158fe5..af3c3074e985bbbbe8dbcb30b9bdbf7b4b37e707 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-1.js @@ -9,14 +9,14 @@ description: > (initialvalue not passed) ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - if(idx > 0 && obj[idx] === curVal && obj[idx-1] === prevVal) - return curVal; - else - return false; - } +function callbackfn(prevVal, curVal, idx, obj) +{ + if (idx > 0 && obj[idx] === curVal && obj[idx - 1] === prevVal) + return curVal; + else + return false; +} - var arr = [0,1,true,null,new Object(),"five"]; +var arr = [0, 1, true, null, new Object(), "five"]; assert.sameValue(arr.reduce(callbackfn), "five", 'arr.reduce(callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-10.js index 6492c1d4b6882f6738df00e5dd5eab4e8b3b4c66..9a9a5567d5ebbe8bbd576242a100114c9424ba90 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-10.js @@ -9,11 +9,12 @@ description: > parameter ---*/ - var result = false; - function callbackfn(prevVal) { - result = (prevVal === 1); - } +var result = false; - [11].reduce(callbackfn, 1); +function callbackfn(prevVal) { + result = (prevVal === 1); +} + +[11].reduce(callbackfn, 1); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-11.js index fe374ad09af090382d7eb8ffd6e5271df1a3a8ed..503028a433bef3f43f0c9821cecdd74e287200fb 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-11.js @@ -9,11 +9,12 @@ description: > parameter ---*/ - var result = false; - function callbackfn(prevVal, curVal) { - result = (curVal > 10 && 1 === prevVal); - } +var result = false; - [11].reduce(callbackfn, 1); +function callbackfn(prevVal, curVal) { + result = (curVal > 10 && 1 === prevVal); +} + +[11].reduce(callbackfn, 1); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-12.js index 282d5ccc55d51eab6731e89a4829fffe3ceffcd2..58b12b3d205bcd4a409a8204fb61c329ff5ce979 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-12.js @@ -9,11 +9,12 @@ description: > parameter ---*/ - var result = false; - function callbackfn(prevVal, curVal, idx) { - result = (prevVal === 1 && arguments[3][idx] === curVal); - } +var result = false; - [11].reduce(callbackfn, 1); +function callbackfn(prevVal, curVal, idx) { + result = (prevVal === 1 && arguments[3][idx] === curVal); +} + +[11].reduce(callbackfn, 1); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-13.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-13.js index 24cb3df068491821196bc789d612ffbf5cb440d3..170366208a05595bdc66721ce2de6e313fc71197 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-13.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-13.js @@ -9,11 +9,12 @@ description: > parameter ---*/ - var result = false; - function callbackfn(prevVal, curVal, idx, obj) { - result = (prevVal === 1 && obj[idx] === curVal); - } +var result = false; - [11].reduce(callbackfn, 1); +function callbackfn(prevVal, curVal, idx, obj) { + result = (prevVal === 1 && obj[idx] === curVal); +} + +[11].reduce(callbackfn, 1); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-14.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-14.js index 170de856dc32a95d4aa9a132ccde48b308e5db2f..12cf2c4288ef966099d0b9f9452ba7c0f5824725 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-14.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-14.js @@ -7,11 +7,12 @@ es5id: 15.4.4.21-9-c-ii-14 description: Array.prototype.reduce - callbackfn that uses arguments ---*/ - var result = false; - function callbackfn() { - result = (arguments[0] === 1 && arguments[3][arguments[2]] === arguments[1]); - } +var result = false; - [11].reduce(callbackfn, 1); +function callbackfn() { + result = (arguments[0] === 1 && arguments[3][arguments[2]] === arguments[1]); +} + +[11].reduce(callbackfn, 1); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-16.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-16.js index 3dcd208df089d4356ad3e2f4aed45af126e43dec..976b1a2696e45879f31081c91cf2d8af76408db5 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-16.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-16.js @@ -7,24 +7,29 @@ es5id: 15.4.4.21-9-c-ii-16 description: Array.prototype.reduce - non-indexed properties are not called ---*/ - var accessed = false; - var result1 = true; - var result2 = true; +var accessed = false; +var result1 = true; +var result2 = true; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - if (curVal === 8) { - result1 = false; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + if (curVal === 8) { + result1 = false; + } - if (prevVal === 8) { - result2 = false; - } - } + if (prevVal === 8) { + result2 = false; + } +} - var obj = { 0: 11, 10: 12, non_index_property: 8, length: 20 }; +var obj = { + 0: 11, + 10: 12, + non_index_property: 8, + length: 20 +}; - Array.prototype.reduce.call(obj, callbackfn, 1); +Array.prototype.reduce.call(obj, callbackfn, 1); assert(result1, 'result1 !== true'); assert(result2, 'result2 !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-17.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-17.js index 0c97041580800fb48b9b7a82112c43914064b701..1179c4e145bb15b8d61ce3ffeffd743aa4a774d0 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-17.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-17.js @@ -9,19 +9,20 @@ description: > is the result of previous iteration on an Array ---*/ - var result = true; - var accessed = false; - var preIteration = 1; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - if (preIteration !== prevVal) { - result = false; - } - preIteration = curVal; - return curVal; - } +var result = true; +var accessed = false; +var preIteration = 1; - [11, 12, 13].reduce(callbackfn, 1); +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + if (preIteration !== prevVal) { + result = false; + } + preIteration = curVal; + return curVal; +} + +[11, 12, 13].reduce(callbackfn, 1); assert(result, 'result !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-18.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-18.js index 52d3f41d393939d62d1a97869042a3a121e1b9d4..acb90c345ae33026ccd33ed5af646c1aaec59135 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-18.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-18.js @@ -10,15 +10,20 @@ description: > Array-like object ---*/ - var result = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 0) { - result = (arguments[0] === 1); - } - } +var result = false; - var obj = { 0: 11, 1: 9, length: 2 }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 0) { + result = (arguments[0] === 1); + } +} - Array.prototype.reduce.call(obj, callbackfn, 1); +var obj = { + 0: 11, + 1: 9, + length: 2 +}; + +Array.prototype.reduce.call(obj, callbackfn, 1); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-19.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-19.js index b423857024af0d6d183c69340762deec6a85fcb8..9f6c78aef47443f087168435a8252de7cb00e894 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-19.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-19.js @@ -10,16 +10,17 @@ description: > undefined when 'initialValue' is not present on an Array ---*/ - var called = 0; - var result = false; - function callbackfn(prevVal, curVal, idx, obj) { - called++; - if (idx === 1) { - result = (prevVal === 11) && curVal === 9; - } - } +var called = 0; +var result = false; - [11, 9].reduce(callbackfn); +function callbackfn(prevVal, curVal, idx, obj) { + called++; + if (idx === 1) { + result = (prevVal === 11) && curVal === 9; + } +} + +[11, 9].reduce(callbackfn); assert(result, 'result !== true'); assert.sameValue(called, 1, 'called'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-2.js index 88c46fffc7ce4a8566ed69199cf0a91aa087ba25..024016564ad20c773a56823d92c95e9abfa9d5dc 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-2.js @@ -9,18 +9,19 @@ description: > (initialvalue passed) ---*/ - var bParCorrect = false; - function callbackfn(prevVal, curVal, idx, obj) - { - if(idx === 0 && obj[idx] === curVal && prevVal === initialValue) - return curVal; - else if(idx > 0 && obj[idx] === curVal && obj[idx-1] === prevVal) - return curVal; - else - return false; - } +var bParCorrect = false; - var arr = [0,1,true,null,new Object(),"five"]; - var initialValue = 5.5; +function callbackfn(prevVal, curVal, idx, obj) +{ + if (idx === 0 && obj[idx] === curVal && prevVal === initialValue) + return curVal; + else if (idx > 0 && obj[idx] === curVal && obj[idx - 1] === prevVal) + return curVal; + else + return false; +} -assert.sameValue(arr.reduce(callbackfn,initialValue), "five", 'arr.reduce(callbackfn,initialValue)'); +var arr = [0, 1, true, null, new Object(), "five"]; +var initialValue = 5.5; + +assert.sameValue(arr.reduce(callbackfn, initialValue), "five", 'arr.reduce(callbackfn,initialValue)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-20.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-20.js index 7b7cffb199ec7c77ed80028c3f8fa5e67ec91022..2e75523561c4e8846aa02cf3485c9ac8925c8b84 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-20.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-20.js @@ -7,13 +7,17 @@ es5id: 15.4.4.21-9-c-ii-20 description: Array.prototype.reduce - undefined can be used as accumulator ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return typeof prevVal === "undefined"; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return typeof prevVal === "undefined"; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, undefined), true, 'Array.prototype.reduce.call(obj, callbackfn, undefined)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-21.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-21.js index 1b2799701857be6a0cccd4fc2daf5ee717c4ffe1..1864d08fac2b25eac4988e81e6837e00d0b07dfc 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-21.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-21.js @@ -7,13 +7,17 @@ es5id: 15.4.4.21-9-c-ii-21 description: Array.prototype.reduce - null can be used as accumulator ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === null; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === null; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, null), true, 'Array.prototype.reduce.call(obj, callbackfn, null)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-22.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-22.js index 7a7f286fc07ff85941bb6cfad04663d9166bfc61..272db1b9676e633d1c4ef5c6b3838d113f0a73c0 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-22.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-22.js @@ -9,13 +9,17 @@ description: > accumulator ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === false; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === false; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, false), true, 'Array.prototype.reduce.call(obj, callbackfn, false)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-23.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-23.js index 0ccff0d30986814842614a3089e36b7ad9e87d98..41fbfeb16867065e611ae80326d6fb18c845bf08 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-23.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-23.js @@ -9,13 +9,17 @@ description: > accumulator ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === 12; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === 12; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 12), true, 'Array.prototype.reduce.call(obj, callbackfn, 12)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-24.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-24.js index 5c3b4c73d74496e64e2b1aede7c28477195f1f82..64fbb4eb37beab16a0f6e3942c10b57198d902be 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-24.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-24.js @@ -9,13 +9,17 @@ description: > accumulator ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === "hello_"; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === "hello_"; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, "hello_"), true, 'Array.prototype.reduce.call(obj, callbackfn, "hello_")'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-25.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-25.js index fe4c9a0a0caa66d13ba4b34e1b895b535d5af33f..7a20725f1f627933a93a77eb994a0b70502483b7 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-25.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-25.js @@ -7,15 +7,19 @@ es5id: 15.4.4.21-9-c-ii-25 description: Array.prototype.reduce - Function object can be used as accumulator ---*/ - var objFunction = function () { }; +var objFunction = function() {}; - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === objFunction; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === objFunction; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, objFunction), true, 'Array.prototype.reduce.call(obj, callbackfn, objFunction)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-26.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-26.js index 8402e82fa6eedfa0742b9f55a3cf8645ad5ea893..44cd75abd683f26ea6fae42bab1f7bcccc6acdc1 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-26.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-26.js @@ -7,15 +7,19 @@ es5id: 15.4.4.21-9-c-ii-26 description: Array.prototype.reduce - Array object can be used as accumulator ---*/ - var objArray = new Array(10); +var objArray = new Array(10); - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === objArray; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === objArray; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, objArray), true, 'Array.prototype.reduce.call(obj, callbackfn, objArray)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-27.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-27.js index 951df7bd95cfe6153225ae2263eb170cf0b87662..decc22588bc45cd4e5b97ab3cd862b9ad8b3f380 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-27.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-27.js @@ -7,15 +7,19 @@ es5id: 15.4.4.21-9-c-ii-27 description: Array.prototype.reduce - String object can be used as accumulator ---*/ - var objString = new String(); +var objString = new String(); - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === objString; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === objString; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, objString), true, 'Array.prototype.reduce.call(obj, callbackfn, objString)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-28.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-28.js index ca6c358b3558da2bae6a7483d123ae67df3eff21..2eca0b849d9b1677981cae8ec4ab38122bd71204 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-28.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-28.js @@ -7,15 +7,19 @@ es5id: 15.4.4.21-9-c-ii-28 description: Array.prototype.reduce - Boolean object can be used as accumulator ---*/ - var objBoolean = new Boolean(); +var objBoolean = new Boolean(); - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === objBoolean; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === objBoolean; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, objBoolean), true, 'Array.prototype.reduce.call(obj, callbackfn, objBoolean)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-29.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-29.js index 251e405a9ba74e4e60bb895348ce8d210f126e4c..03ed7c189f71948dd4f3c292595cb06d62abf904 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-29.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-29.js @@ -7,15 +7,19 @@ es5id: 15.4.4.21-9-c-ii-29 description: Array.prototype.reduce - Number object can be used as accumulator ---*/ - var objNumber = new Number(); +var objNumber = new Number(); - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === objNumber; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === objNumber; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, objNumber), true, 'Array.prototype.reduce.call(obj, callbackfn, objNumber)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-3.js index 1f93af90c5f5d090a5c9232035ab041c70007adc..dfd7391271511773bf2d7a8632ec60231f4e2d84 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-3.js @@ -7,16 +7,17 @@ es5id: 15.4.4.21-9-c-ii-3 description: Array.prototype.reduce - callbackfn takes 4 arguments ---*/ - var bCalled = false; - function callbackfn(prevVal, curVal, idx, obj) - { - bCalled = true; - if(prevVal === true && arguments.length === 4) - return true; - else - return false; - } - var arr = [0,1,2,3,4,5,6,7,8,9]; +var bCalled = false; -assert.sameValue(arr.reduce(callbackfn,true), true, 'arr.reduce(callbackfn,true)'); +function callbackfn(prevVal, curVal, idx, obj) +{ + bCalled = true; + if (prevVal === true && arguments.length === 4) + return true; + else + return false; +} +var arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + +assert.sameValue(arr.reduce(callbackfn, true), true, 'arr.reduce(callbackfn,true)'); assert.sameValue(bCalled, true, 'bCalled'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-30.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-30.js index 0b3202e74811db2a2895414d622f371d01d5cc9c..2cc426a8d2e250d521cf9a9b3b874eedd6a2975b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-30.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-30.js @@ -7,13 +7,17 @@ es5id: 15.4.4.21-9-c-ii-30 description: Array.prototype.reduce - the Math object can be used as accumulator ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === Math; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === Math; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, Math), true, 'Array.prototype.reduce.call(obj, callbackfn, Math)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-31.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-31.js index 6e4c92b939b5e42b81b39ed8b3d689e233509dc0..4bf720831faf6add603616380ab88f2f1fdb7591 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-31.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-31.js @@ -7,15 +7,19 @@ es5id: 15.4.4.21-9-c-ii-31 description: Array.prototype.reduce - Date object can be used as accumulator ---*/ - var objDate = new Date(); +var objDate = new Date(); - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === objDate; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === objDate; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, objDate), true, 'Array.prototype.reduce.call(obj, callbackfn, objDate)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-32.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-32.js index 8a0f61496f771851324584f1951ac38b7ac8caf6..de51b59f3ef376e43e106f97d7257eb5f1dbe801 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-32.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-32.js @@ -7,15 +7,19 @@ es5id: 15.4.4.21-9-c-ii-32 description: Array.prototype.reduce - RegExp object can be used as accumulator ---*/ - var objRegExp = new RegExp(); +var objRegExp = new RegExp(); - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === objRegExp; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === objRegExp; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, objRegExp), true, 'Array.prototype.reduce.call(obj, callbackfn, objRegExp)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-33.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-33.js index c010c39ff1f8de6d2b0b2324e754efbc92c47256..b5cdc3cc8694bb93c642466a3096fdefe112033b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-33.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-33.js @@ -7,13 +7,17 @@ es5id: 15.4.4.21-9-c-ii-33 description: Array.prototype.reduce - the JSON can be used as accumulator ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === JSON; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === JSON; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, JSON), true, 'Array.prototype.reduce.call(obj, callbackfn, JSON)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-34.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-34.js index 8f6dbd88857cabb0636783abbccb4c71aba816b5..9df298c155a3a91dcab360458a8942fc311c96fe 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-34.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-34.js @@ -7,15 +7,19 @@ es5id: 15.4.4.21-9-c-ii-34 description: Array.prototype.reduce - Error object can be used as accumulator ---*/ - var objError = new RangeError(); +var objError = new RangeError(); - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === objError; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === objError; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, objError), true, 'Array.prototype.reduce.call(obj, callbackfn, objError)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-35.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-35.js index 30daec0a866f5c58f993b420ba84cd92aa479923..8d01e4e831cea7e02c0621ad576c3b4122cdf0e2 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-35.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-35.js @@ -9,19 +9,22 @@ description: > accumulator ---*/ - var accessed = false; - var arg; +var accessed = false; +var arg; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === arg; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === arg; +} - var obj = { 0: 11, length: 1 }; +var obj = { + 0: 11, + length: 1 +}; - (function fun() { - arg = arguments; - }(10, 11, 12, 13)); +(function fun() { + arg = arguments; +}(10, 11, 12, 13)); assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, arg), true, 'Array.prototype.reduce.call(obj, callbackfn, arg)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-37.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-37.js index a0a46fa90b2e9abf0409c3af3c1d5f9ac5e96eb9..bb97f5f54bf46e4d3cf2978198154bb0a4a5b539 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-37.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-37.js @@ -10,13 +10,17 @@ description: > ---*/ var global = this; - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === global; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === global; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, this), true, 'Array.prototype.reduce.call(obj, callbackfn, this)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-4-s.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-4-s.js index 1d1517917c1414e73a029064f09c340a93479072..89872b12790579a1f1dc3d3241cbc297ea771c9c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-4-s.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-4-s.js @@ -10,13 +10,14 @@ description: > flags: [noStrict] ---*/ - var innerThisCorrect = false; - function callbackfn(prevVal, curVal, idx, obj) - { - "use strict"; - innerThisCorrect = this===undefined; - return true; - } - [0].reduce(callbackfn,true); +var innerThisCorrect = false; + +function callbackfn(prevVal, curVal, idx, obj) +{ + "use strict"; + innerThisCorrect = this === undefined; + return true; +} +[0].reduce(callbackfn, true); assert(innerThisCorrect, 'innerThisCorrect !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-4.js index 5b70ba2204e95fc258358b86c5a36b88edf65153..f0982335e1c968b33fb1392ddc0f47a307c71593 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-4.js @@ -9,21 +9,21 @@ description: > order on an Array ---*/ - var arr = [0, 1, 2]; - var lastIdx = 0; - var result = true; - var accessed = false; +var arr = [0, 1, 2]; +var lastIdx = 0; +var result = true; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - if (lastIdx !== idx) { - result = false; - } else { - lastIdx++; - } - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + if (lastIdx !== idx) { + result = false; + } else { + lastIdx++; + } +} - arr.reduce(callbackfn, 11); +arr.reduce(callbackfn, 11); assert(result, 'result !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-5.js index 4476ea3d032e3882f7bcd02b950309cf0ce1355d..2a7ad3a6a83b87c3c0b8e78f02203d931fac80e4 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-5.js @@ -9,26 +9,26 @@ description: > iteration and not prior to starting the loop on an Array ---*/ - var result = true; - var kIndex = []; - var called = 0; +var result = true; +var kIndex = []; +var called = 0; - //By below way, we could verify that k would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time. - function callbackfn(prevVal, curVal, idx, obj) { - //Each position should be visited one time, which means k is accessed one time during iterations. - called++; - if (typeof kIndex[idx] === "undefined") { - //when current position is visited, its previous index should has been visited. - if (idx !== 0 && typeof kIndex[idx - 1] === "undefined") { - result = false; - } - kIndex[idx] = 1; - } else { - result = false; - } - } +//By below way, we could verify that k would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time. +function callbackfn(prevVal, curVal, idx, obj) { + //Each position should be visited one time, which means k is accessed one time during iterations. + called++; + if (typeof kIndex[idx] === "undefined") { + //when current position is visited, its previous index should has been visited. + if (idx !== 0 && typeof kIndex[idx - 1] === "undefined") { + result = false; + } + kIndex[idx] = 1; + } else { + result = false; + } +} - [11, 12, 13, 14].reduce(callbackfn, 1); +[11, 12, 13, 14].reduce(callbackfn, 1); assert(result, 'result !== true'); assert.sameValue(called, 4, 'called'); 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 9f76afad69293789ae8707a3bb64a7cb6286a9e4..31c3a8c588faaca4d100d5338ec00b47a8279e4b 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 @@ -9,19 +9,24 @@ description: > callbackfn terminate iteration ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx > 0) { - accessed = true; - } - if (idx === 0) { - throw new Error("Exception occurred in callbackfn"); - } - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx > 0) { + accessed = true; + } + if (idx === 0) { + throw new Error("Exception occurred in callbackfn"); + } +} - var obj = { 0: 11, 4: 10, 10: 8, length: 20 }; +var obj = { + 0: 11, + 4: 10, + 10: 8, + length: 20 +}; assert.throws(Error, function() { - Array.prototype.reduce.call(obj, callbackfn, 1); + Array.prototype.reduce.call(obj, callbackfn, 1); }); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-8.js index b3395afcceaaeb9c0a8e2e015e1dd412a91308af..e3ed219e68be198afe2e90229c1de1fa41b74af7 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-8.js @@ -9,19 +9,24 @@ description: > iterations is observed ---*/ - var result = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 0) { - obj[idx + 1] = 8; - } +var result = false; - if (idx === 1) { - result = (curVal === 8); - } - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 0) { + obj[idx + 1] = 8; + } - var obj = { 0: 11, 1: 12, length: 2 }; + if (idx === 1) { + result = (curVal === 8); + } +} - Array.prototype.reduce.call(obj, callbackfn, 1); +var obj = { + 0: 11, + 1: 12, + length: 2 +}; + +Array.prototype.reduce.call(obj, callbackfn, 1); assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-9.js index a8f5758d3f8f45572f6a8470556e43b510b1b38c..c9d0ae895b8498b9c92bc363b8f74413f8acc78d 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-9.js @@ -9,11 +9,12 @@ description: > parameter ---*/ - var called = 0; - function callbackfn() { - called++; - } +var called = 0; - [11, 12].reduce(callbackfn, 1); +function callbackfn() { + called++; +} + +[11, 12].reduce(callbackfn, 1); assert.sameValue(called, 2, 'called'); 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 7650b6531b9e8ec65e45aa5c875fadc10cc996b4..5a64f1472eb7d7ff03d633b987f74801a61dcf42 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 @@ -9,5 +9,5 @@ description: Array.prototype.reduceRight applied to undefined throws a TypeError assert.throws(TypeError, function() { - Array.prototype.reduceRight.call(undefined); + Array.prototype.reduceRight.call(undefined); }); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-10.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-10.js index 341dac72957ae900fbc1a6d784c97959eeeaeff7..fb0a1f9f89e7d88120162e98e71131d59e8c3f06 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-10.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-10.js @@ -7,15 +7,15 @@ es5id: 15.4.4.22-1-10 description: Array.prototype.reduceRight applied to the Math object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return '[object Math]' === Object.prototype.toString.call(obj); - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return '[object Math]' === Object.prototype.toString.call(obj); +} - Math.length = 1; - Math[0] = 1; +Math.length = 1; +Math[0] = 1; assert(Array.prototype.reduceRight.call(Math, callbackfn, 1), 'Array.prototype.reduceRight.call(Math, callbackfn, 1) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-11.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-11.js index 447771e6edb10f719e883371d3a124b40b017a42..610b41291261829e88859666f71c74a6ca7ddeac 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-11.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-11.js @@ -7,15 +7,15 @@ es5id: 15.4.4.22-1-11 description: Array.prototype.reduceRight applied to Date object ---*/ - var obj = new Date(); - obj.length = 1; - obj[0] = 1; - var accessed = false; +var obj = new Date(); +obj.length = 1; +obj[0] = 1; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return obj instanceof Date; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return obj instanceof Date; +} assert(Array.prototype.reduceRight.call(obj, callbackfn, 1), 'Array.prototype.reduceRight.call(obj, callbackfn, 1) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-12.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-12.js index 06834d39e4e48603b5d99c164849c30ef0d56b25..efc9fa2e3a2eb89adfd7884992ad469199f0dcd4 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-12.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-12.js @@ -7,15 +7,15 @@ es5id: 15.4.4.22-1-12 description: Array.prototype.reduceRight applied to RegExp object ---*/ - var obj = new RegExp(); - obj.length = 1; - obj[0] = 1; - var accessed = false; +var obj = new RegExp(); +obj.length = 1; +obj[0] = 1; +var accessed = false; - function callbackfn(prevVal, curVal, idx, o) { - accessed = true; - return o instanceof RegExp; - } +function callbackfn(prevVal, curVal, idx, o) { + accessed = true; + return o instanceof RegExp; +} assert(Array.prototype.reduceRight.call(obj, callbackfn, 1), 'Array.prototype.reduceRight.call(obj, callbackfn, 1) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-13.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-13.js index 9d6b8f83cb8b7352c687976a2d12463be1339140..822d57425df9d19797a960869aed163e64a09af9 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-13.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-13.js @@ -7,15 +7,15 @@ es5id: 15.4.4.22-1-13 description: Array.prototype.reduceRight applied to the JSON object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return ('[object JSON]' === Object.prototype.toString.call(obj)); - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return ('[object JSON]' === Object.prototype.toString.call(obj)); +} - JSON.length = 1; - JSON[0] = 1; +JSON.length = 1; +JSON[0] = 1; assert(Array.prototype.reduceRight.call(JSON, callbackfn, 1), 'Array.prototype.reduceRight.call(JSON, callbackfn, 1) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-14.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-14.js index 6b7e76ea42f565646fed706417ba1cd55592c251..4d8557c59b7e644bd5457759113a4b49e867a129 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-14.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-14.js @@ -7,15 +7,15 @@ es5id: 15.4.4.22-1-14 description: Array.prototype.reduceRight applied to Error object ---*/ - var obj = new Error(); - obj.length = 1; - obj[0] = 1; - var accessed = false; +var obj = new Error(); +obj.length = 1; +obj[0] = 1; +var accessed = false; - function callbackfn(prevVal, curVal, idx, o) { - accessed = true; - return o instanceof Error; - } +function callbackfn(prevVal, curVal, idx, o) { + accessed = true; + return o instanceof Error; +} assert(Array.prototype.reduceRight.call(obj, callbackfn, 1), 'Array.prototype.reduceRight.call(obj, callbackfn, 1) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-15.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-15.js index 8e739dfaba0100cf6c1a5daccd1f5c8436d0403d..a2bb8a9ffcd1b75cc55ff476fec990ef54208903 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-15.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-15.js @@ -7,16 +7,16 @@ es5id: 15.4.4.22-1-15 description: Array.prototype.reduceRight applied to the Arguments object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return '[object Arguments]' === Object.prototype.toString.call(obj); - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return '[object Arguments]' === Object.prototype.toString.call(obj); +} - var obj = (function () { - return arguments; - }("a", "b")); +var obj = (function() { + return arguments; +}("a", "b")); assert(Array.prototype.reduceRight.call(obj, callbackfn, "a"), 'Array.prototype.reduceRight.call(obj, callbackfn, "a") !== true'); assert(accessed, 'accessed !== true'); 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 602cef5da838e0e3c1b7af840f99c6826bc216f4..cf08c68a5a4a1a0eb9534450b98a5b329dd12502 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 @@ -9,5 +9,5 @@ description: Array.prototype.reduceRight applied to null throws a TypeError assert.throws(TypeError, function() { - Array.prototype.reduceRight.call(null); + Array.prototype.reduceRight.call(null); }); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-3.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-3.js index 54f2c207a66abcb307ef5bfb02585e987cbdd2e5..6fca6c30406d6435a6b80bda2c5e2170bc999b14 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-3.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-3.js @@ -7,15 +7,15 @@ es5id: 15.4.4.22-1-3 description: Array.prototype.reduceRight applied to boolean primitive ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return obj instanceof Boolean; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return obj instanceof Boolean; +} - Boolean.prototype[0] = 1; - Boolean.prototype.length = 1; +Boolean.prototype[0] = 1; +Boolean.prototype.length = 1; assert(Array.prototype.reduceRight.call(false, callbackfn, 1), 'Array.prototype.reduceRight.call(false, callbackfn, 1) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-4.js index 77427f29cdd1fae1c1e61cf60b5fce4234fb07c2..d782446858d46a56fe102d4fcdd4da0f874f6a5c 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-4.js @@ -7,16 +7,16 @@ es5id: 15.4.4.22-1-4 description: Array.prototype.reduceRight applied to Boolean object ---*/ - var obj = new Boolean(true); - obj.length = 2; - obj[0] = 11; - obj[1] = 12; - var accessed = false; +var obj = new Boolean(true); +obj.length = 2; +obj[0] = 11; +obj[1] = 12; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return obj instanceof Boolean; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return obj instanceof Boolean; +} assert(Array.prototype.reduceRight.call(obj, callbackfn, 11), 'Array.prototype.reduceRight.call(obj, callbackfn, 11) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-5.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-5.js index 59244bbe9093237ce0284e0fa99bcf1a038403e3..c83b156f044079e82aa80d5ec27b6d9fa730abad 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-5.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-5.js @@ -7,15 +7,15 @@ es5id: 15.4.4.22-1-5 description: Array.prototype.reduceRight applied to number primitive ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return obj instanceof Number; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return obj instanceof Number; +} - Number.prototype[0] = 1; - Number.prototype.length = 1; +Number.prototype[0] = 1; +Number.prototype.length = 1; assert(Array.prototype.reduceRight.call(2.5, callbackfn, 1), 'Array.prototype.reduceRight.call(2.5, callbackfn, 1) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-6.js index a0c2df0e81d1ab2c0b5f7cb780238d162f524881..9d1c2792a39cf02461142a6bfda39c241f24645b 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-6.js @@ -7,16 +7,16 @@ es5id: 15.4.4.22-1-6 description: Array.prototype.reduceRight applied to Number object ---*/ - var obj = new Number(-128); - obj.length = 2; - obj[0] = 11; - obj[1] = 12; - var accessed = false; +var obj = new Number(-128); +obj.length = 2; +obj[0] = 11; +obj[1] = 12; +var accessed = false; - function callbackfn(prevVal, curVal, idx, o) { - accessed = true; - return o instanceof Number; - } +function callbackfn(prevVal, curVal, idx, o) { + accessed = true; + return o instanceof Number; +} assert(Array.prototype.reduceRight.call(obj, callbackfn, 11), 'Array.prototype.reduceRight.call(obj, callbackfn, 11) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-7.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-7.js index 6e368cfffd3a6d1e132e66ef574b5f3fe32a876d..7c3dabefe406fa91b7f90b9e5b68d52a44ff571c 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-7.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-7.js @@ -7,12 +7,12 @@ es5id: 15.4.4.22-1-7 description: Array.prototype.reduceRight applied to string primitive ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return obj instanceof String; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return obj instanceof String; +} assert(Array.prototype.reduceRight.call("hello\nworld\\!", callbackfn, "h"), 'Array.prototype.reduceRight.call("hello\nworld\\!", callbackfn, "h") !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-8.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-8.js index d034b48b39b7589c46bc9c4c758f2047655fe6fa..9f6ee35dbc3b12684402f6888bcd90afcd309f47 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-8.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-8.js @@ -7,13 +7,13 @@ es5id: 15.4.4.22-1-8 description: Array.prototype.reduceRight applied to String object ---*/ - var obj = new String("hello\nworld\\!"); - var accessed = false; +var obj = new String("hello\nworld\\!"); +var accessed = false; - function callbackfn(prevVal, curVal, idx, o) { - accessed = true; - return o instanceof String; - } +function callbackfn(prevVal, curVal, idx, o) { + accessed = true; + return o instanceof String; +} assert(Array.prototype.reduceRight.call(obj, callbackfn, "h"), 'Array.prototype.reduceRight.call(obj, callbackfn, "h") !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-9.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-9.js index 1820f546c1b4360eddb8fd62f6e1868685a08807..42e6c8ca6b1ba1531fca74e63260f94d56ed77e1 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-9.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-9.js @@ -7,17 +7,17 @@ es5id: 15.4.4.22-1-9 description: Array.prototype.reduceRight applied to Function object ---*/ - var obj = function (a, b) { - return a + b; - }; - obj[0] = 11; - obj[1] = 9; - var accessed = false; +var obj = function(a, b) { + return a + b; +}; +obj[0] = 11; +obj[1] = 9; +var accessed = false; - function callbackfn(prevVal, curVal, idx, o) { - accessed = true; - return o instanceof Function; - } +function callbackfn(prevVal, curVal, idx, o) { + accessed = true; + return o instanceof Function; +} assert(Array.prototype.reduceRight.call(obj, callbackfn, 11), 'Array.prototype.reduceRight.call(obj, callbackfn, 11) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-1.js index d9b0c874d842ea03bb391576e21d87fad16ae2a4..eaaca4897c1e5b9c20d1034607a49085d7094b37 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-1.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-1.js @@ -9,12 +9,12 @@ description: > is called on ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - return 1; - } - var srcArr = [1,2,3,4,5]; - srcArr.reduceRight(callbackfn); +function callbackfn(prevVal, curVal, idx, obj) +{ + return 1; +} +var srcArr = [1, 2, 3, 4, 5]; +srcArr.reduceRight(callbackfn); assert.sameValue(srcArr[0], 1, 'srcArr[0]'); assert.sameValue(srcArr[1], 2, 'srcArr[1]'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-2.js index 1b34162cfacea546931fe2b626914a181b22e2cc..cffd5e08e18eca6b502bd12798047f3358012890 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-2.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-2.js @@ -9,10 +9,10 @@ description: > indices ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - return prevVal + curVal; - } - var srcArr = ['1','2','3','4','5']; +function callbackfn(prevVal, curVal, idx, obj) +{ + return prevVal + curVal; +} +var srcArr = ['1', '2', '3', '4', '5']; assert.sameValue(srcArr.reduceRight(callbackfn), '54321', 'srcArr.reduceRight(callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-3.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-3.js index 6e47fd87154c6f164595676afce7bc55ecc6a83b..de4a59b0c2c78c2d88cbfb145c00e6098f6b9c16 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-3.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-3.js @@ -7,10 +7,11 @@ es5id: 15.4.4.22-10-3 description: Array.prototype.reduceRight - subclassed array with length 1 ---*/ - foo.prototype = [1]; - function foo() {} - var f = new foo(); +foo.prototype = [1]; - function cb(){} +function foo() {} +var f = new foo(); + +function cb() {} assert.sameValue(f.reduceRight(cb), 1, 'f.reduceRight(cb)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-4.js index 76afe602969398aaecc66b6147aad581465208e5..7726d9fde8d0b6c09dafe84233be7e37a03fd154 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-4.js @@ -9,10 +9,13 @@ description: > than 1 ---*/ - foo.prototype = new Array(0, 1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(0, 1, 2, 3); - function cb(prevVal, curVal, idx, obj){return prevVal + curVal;} +function foo() {} +var f = new foo(); + +function cb(prevVal, curVal, idx, obj) { + return prevVal + curVal; +} assert.sameValue(f.reduceRight(cb), 6, 'f.reduceRight(cb)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-5.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-5.js index 78e6d744fa5c7454d170d7ab30824c2d1bd17811..c5c29eb025632fed96b59c4343ea83ce48fc8de1 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-5.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-5.js @@ -9,10 +9,10 @@ description: > indices(initialvalue present) ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - return prevVal + curVal; - } - var srcArr = ['1','2','3','4','5']; +function callbackfn(prevVal, curVal, idx, obj) +{ + return prevVal + curVal; +} +var srcArr = ['1', '2', '3', '4', '5']; -assert.sameValue(srcArr.reduceRight(callbackfn,'6'), '654321', 'srcArr.reduceRight(callbackfn,"6")'); +assert.sameValue(srcArr.reduceRight(callbackfn, '6'), '654321', 'srcArr.reduceRight(callbackfn,"6")'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-6.js index 1ce24519cafa6afaca0b851f733545e893637181..37cb4705e41569b8b8f014c49179998218b1daf1 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-6.js @@ -9,10 +9,13 @@ description: > provided ---*/ - foo.prototype = new Array(0, 1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(0, 1, 2, 3); - function cb(prevVal, curVal, idx, obj){return prevVal + curVal;} +function foo() {} +var f = new foo(); -assert.sameValue(f.reduceRight(cb,"4"), "43210", 'f.reduceRight(cb,"4")'); +function cb(prevVal, curVal, idx, obj) { + return prevVal + curVal; +} + +assert.sameValue(f.reduceRight(cb, "4"), "43210", 'f.reduceRight(cb,"4")'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-7.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-7.js index 27be976b4b910bd9c0a0c67e79e535002443ad5c..813179ec751c6796154210d59d48681adbf5b372 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-7.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-7.js @@ -9,10 +9,13 @@ description: > and initialvalue provided ---*/ - foo.prototype = [1]; - function foo() {} - var f = new foo(); +foo.prototype = [1]; - function cb(prevVal, curVal, idx, obj){return prevVal + curVal;} +function foo() {} +var f = new foo(); -assert.sameValue(f.reduceRight(cb,"4"), "41", 'f.reduceRight(cb,"4")'); +function cb(prevVal, curVal, idx, obj) { + return prevVal + curVal; +} + +assert.sameValue(f.reduceRight(cb, "4"), "41", 'f.reduceRight(cb,"4")'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-8.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-8.js index 8a9eb81650872fa25385e2e50251828f46228328..a9aa6974077a5b61911281284b226deaa17e499b 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-8.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-10-8.js @@ -7,15 +7,16 @@ es5id: 15.4.4.22-10-8 description: Array.prototype.reduceRight doesn't visit expandos ---*/ - var callCnt = 0; - function callbackfn(prevVal, curVal, idx, obj) - { - callCnt++; - } - var srcArr = ['1','2','3','4','5']; - srcArr["i"] = 10; - srcArr[true] = 11; +var callCnt = 0; - srcArr.reduceRight(callbackfn); +function callbackfn(prevVal, curVal, idx, obj) +{ + callCnt++; +} +var srcArr = ['1', '2', '3', '4', '5']; +srcArr["i"] = 10; +srcArr[true] = 11; + +srcArr.reduceRight(callbackfn); assert.sameValue(callCnt, 4, 'callCnt'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-1.js index 5da45ad9da4e7e3bcf80b3c6f0a4c0ba5eecc266..5a7a0af52767c8649025caa446e5c466d2614037 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-1.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-1.js @@ -9,18 +9,18 @@ description: > is an own data property ---*/ - var accessed = false; - var obj = { - 0: 12, - 1: 11, - 2: 9, - length: 2 - }; +var accessed = false; +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: 2 +}; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return obj.length === 2; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return obj.length === 2; +} assert(Array.prototype.reduceRight.call(obj, callbackfn, 11), 'Array.prototype.reduceRight.call(obj, callbackfn, 11) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-10.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-10.js index ad204a77ba14286fec6a08520464e6237fb509fb..035cc1c822cb3451e2cb69012f357963fabff25d 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-10.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-10.js @@ -9,30 +9,30 @@ description: > is an inherited accessor property ---*/ - var accessed = false; - var Con = function () { }; +var accessed = false; +var Con = function() {}; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return obj.length === 2; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return obj.length === 2; +} - var proto = {}; +var proto = {}; - Object.defineProperty(proto, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(proto, "length", { + get: function() { + return 2; + }, + configurable: true +}); - Con.prototype = proto; +Con.prototype = proto; - var child = new Con(); - child[0] = 12; - child[1] = 11; - child[2] = 9; +var child = new Con(); +child[0] = 12; +child[1] = 11; +child[2] = 9; assert(Array.prototype.reduceRight.call(child, callbackfn, 11), 'Array.prototype.reduceRight.call(child, callbackfn, 11) !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-11.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-11.js index dc8d017bd677a5f23f5db40e547dfef0c7aed269..ffd66953e464d483bec2599757c6bbe45fe04a6d 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-11.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-11.js @@ -9,21 +9,21 @@ description: > is an own accessor property without a get function ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return typeof obj.length === "undefined"; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return typeof obj.length === "undefined"; +} - var obj = { - 0: 11, - 1: 12 - }; - Object.defineProperty(obj, "length", { - set: function () { }, - configurable: true - }); +var obj = { + 0: 11, + 1: 12 +}; +Object.defineProperty(obj, "length", { + set: function() {}, + configurable: true +}); assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 111), 111, 'Array.prototype.reduceRight.call(obj, callbackfn, 111)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-12.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-12.js index c162760d000d5c8bbaf0f29dce1c45a7dda78414..b685810f9a18a0ab89439393a5c17d1093448b22 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-12.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-12.js @@ -10,25 +10,28 @@ description: > property ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return typeof obj.length === "undefined"; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return typeof obj.length === "undefined"; +} - Object.defineProperty(Object.prototype, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(Object.prototype, "length", { + get: function() { + return 2; + }, + configurable: true +}); - var obj = { 0: 12, 1: 13 }; - Object.defineProperty(obj, "length", { - set: function () { }, - configurable: true - }); +var obj = { + 0: 12, + 1: 13 +}; +Object.defineProperty(obj, "length", { + set: function() {}, + configurable: true +}); assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 11), 11, 'Array.prototype.reduceRight.call(obj, callbackfn, 11)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-13.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-13.js index 56f37873fa2b87bc3cb12b58d6c453e502686910..7cdaf568c685046d0e5a3f9c0ec48740827a2ba4 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-13.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-13.js @@ -9,25 +9,25 @@ description: > 'length' is inherited accessor property without a get function ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return curVal > 10; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return curVal > 10; +} - var proto = {}; - Object.defineProperty(proto, "length", { - set: function () { }, - configurable: true - }); +var proto = {}; +Object.defineProperty(proto, "length", { + set: function() {}, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[0] = 11; - child[1] = 12; +var child = new Con(); +child[0] = 11; +child[1] = 12; assert.sameValue(Array.prototype.reduceRight.call(child, callbackfn, 111), 111, 'Array.prototype.reduceRight.call(child, callbackfn, 111)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-14.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-14.js index 26f6a9d37db935b8c9978ac453b155c6cccaf53a..75d312923bb7b015d3f5cf1dfbf6576e3941e499 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-14.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-14.js @@ -9,13 +9,16 @@ description: > 'length' property doesn't exist ---*/ - var obj = { 0: 11, 1: 12 }; - var accessed = false; +var obj = { + 0: 11, + 1: 12 +}; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return curVal > 10; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return curVal > 10; +} assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 111), 111, 'Array.prototype.reduceRight.call(obj, callbackfn, 111)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-17.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-17.js index 41f7352af62ddc9a0524f34ad47754f578f5a872..b888b562e2e2a4d310016e97bee7c54e4d7a5609 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-17.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-17.js @@ -9,18 +9,18 @@ description: > implements its own property get method ---*/ - var arg; - var accessed = false; +var arg; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return obj.length === 2; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return obj.length === 2; +} - var func = function (a, b) { - arg = arguments; - return Array.prototype.reduceRight.call(arguments, callbackfn, 11); - }; +var func = function(a, b) { + arg = arguments; + return Array.prototype.reduceRight.call(arguments, callbackfn, 11); +}; assert(func(12, 11), 'func(12, 11) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-18.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-18.js index 89f7a89fa6967514eb5dc00f7f7290e552454c63..bc036bf4888cbf35b69b371f194b1ec2580e99cc 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-18.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-18.js @@ -9,15 +9,15 @@ description: > implements its own property get method ---*/ - var accessed = false; - var str = new String("432"); +var accessed = false; +var str = new String("432"); - function callbackfn(preVal, curVal, idx, obj) { - accessed = true; - return obj.length === 3; - } +function callbackfn(preVal, curVal, idx, obj) { + accessed = true; + return obj.length === 3; +} - String.prototype[3] = "1"; +String.prototype[3] = "1"; assert(Array.prototype.reduceRight.call(str, callbackfn, 111), 'Array.prototype.reduceRight.call(str, callbackfn, 111) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-19.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-19.js index 08bdd46df1b0e278b985ef8b71103a266532c447..f76fdf22398e9a22e5709f4024150c58f96ca677 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-19.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-19.js @@ -9,18 +9,18 @@ description: > implements its own property get method ---*/ - var accessed = false; - var fun = function (a, b) { - return a + b; - }; - fun[0] = 12; - fun[1] = 11; - fun[2] = 9; +var accessed = false; +var fun = function(a, b) { + return a + b; +}; +fun[0] = 12; +fun[1] = 11; +fun[2] = 9; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return obj.length === 2; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return obj.length === 2; +} assert(Array.prototype.reduceRight.call(fun, callbackfn, 11), 'Array.prototype.reduceRight.call(fun, callbackfn, 11) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-2.js index c56d545b43bad3e01379172c4f40cbadc9abf45a..b2b8335e1c99a84b72cf7d193dd298608e4e81c4 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-2.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-2.js @@ -9,12 +9,12 @@ description: > Array ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return obj.length === 2; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return obj.length === 2; +} assert([12, 11].reduceRight(callbackfn, 11), '[12, 11].reduceRight(callbackfn, 11) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-3.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-3.js index feff6998df3e59148892f94711e001af373c9aa5..ef1d83a5d7956e4a0adde264326f0782b3d46654 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-3.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-3.js @@ -9,23 +9,25 @@ description: > is an own data property that overrides an inherited data property ---*/ - var accessed = true; +var accessed = true; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return obj.length === 2; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return obj.length === 2; +} - var proto = { length: 3 }; +var proto = { + length: 3 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 2; - child[0] = 12; - child[1] = 11; - child[2] = 9; +var child = new Con(); +child.length = 2; +child[0] = 12; +child[1] = 11; +child[2] = 9; assert(Array.prototype.reduceRight.call(child, callbackfn), 'Array.prototype.reduceRight.call(child, callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-4.js index 0a1b81254bb4db6d40c335b2b8e318bc8cf748f2..4335394fa0b60d300553fdc776bc291a6c1a5e20 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-4.js @@ -9,15 +9,16 @@ description: > overrides an inherited data property on an Array ---*/ - var accessed = false; - var arrProtoLen; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return obj.length === 2; - } +var accessed = false; +var arrProtoLen; - arrProtoLen = Array.prototype.length; - Array.prototype.length = 0; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return obj.length === 2; +} + +arrProtoLen = Array.prototype.length; +Array.prototype.length = 0; assert([12, 11].reduceRight(callbackfn, 11), '[12, 11].reduceRight(callbackfn, 11) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-5.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-5.js index 3fcf425de90171bc7ed0dcc94c3b718da2e91999..50e35c3b48e394d6ff658303f2974dd49e6b166a 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-5.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-5.js @@ -10,32 +10,32 @@ description: > property ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return obj.length === 2; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return obj.length === 2; +} - var proto = {}; - Object.defineProperty(proto, "length", { - get: function () { - return 3; - }, - configurable: true - }); +var proto = {}; +Object.defineProperty(proto, "length", { + get: function() { + return 3; + }, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - Object.defineProperty(child, "length", { - value: 2, - configurable: true - }); - child[0] = 12; - child[1] = 11; - child[2] = 9; +var child = new Con(); +Object.defineProperty(child, "length", { + value: 2, + configurable: true +}); +child[0] = 12; +child[1] = 11; +child[2] = 9; assert(Array.prototype.reduceRight.call(child, callbackfn), 'Array.prototype.reduceRight.call(child, callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-6.js index b31b796cbdecda7c23f05f94ed0dcd815cc0f7f5..d41b9630ae28af3d13fa99ba7856cf2aa05e8b3a 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-6.js @@ -9,20 +9,22 @@ description: > is an inherited data property ---*/ - var accessed = false; - var proto = { length: 2 }; - var Con = function () { }; - Con.prototype = proto; +var accessed = false; +var proto = { + length: 2 +}; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[0] = 12; - child[1] = 11; - child[2] = 9; +var child = new Con(); +child[0] = 12; +child[1] = 11; +child[2] = 9; - function callbackfn1(prevVal, curVal, idx, obj) { - accessed = true; - return obj.length === 2; - } +function callbackfn1(prevVal, curVal, idx, obj) { + accessed = true; + return obj.length === 2; +} assert(Array.prototype.reduceRight.call(child, callbackfn1, 11), 'Array.prototype.reduceRight.call(child, callbackfn1, 11) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-7.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-7.js index 1400c9e8eb1721baf71181d720cb332faa8cf17b..836ed95e1f0cd8d74cb2f833ea4cf56b51d063a7 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-7.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-7.js @@ -9,23 +9,23 @@ description: > is an own accessor property ---*/ - var accessed = true; - var obj = {}; - obj[0] = 12; - obj[1] = 11; - obj[2] = 9; +var accessed = true; +var obj = {}; +obj[0] = 12; +obj[1] = 11; +obj[2] = 9; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return obj.length === 2; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return obj.length === 2; +} - Object.defineProperty(obj, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return 2; + }, + configurable: true +}); assert(Array.prototype.reduceRight.call(obj, callbackfn, 11), 'Array.prototype.reduceRight.call(obj, callbackfn, 11) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-8.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-8.js index 85912235a34200a1e90c905915c150fc37dc4d4b..f867632c02e84ecaf68dcc9353d423ba3618a2f9 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-8.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-8.js @@ -10,30 +10,32 @@ description: > property ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return obj.length === 2; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return obj.length === 2; +} - var proto = { length: 3 }; +var proto = { + length: 3 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); +var child = new Con(); - Object.defineProperty(child, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(child, "length", { + get: function() { + return 2; + }, + configurable: true +}); - child[0] = 12; - child[1] = 11; - child[2] = 9; +child[0] = 12; +child[1] = 11; +child[2] = 9; assert(Array.prototype.reduceRight.call(child, callbackfn, 11), 'Array.prototype.reduceRight.call(child, callbackfn, 11) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-9.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-9.js index 139b4d17515e69e1f271d8b099dcb3e5edf4c412..d47f6150fb9692ef7f7d30df49205ec3b28a6363 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-9.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-9.js @@ -10,34 +10,34 @@ description: > property ---*/ - var accessed = false; +var accessed = false; - function callbackfn1(prevVal, curVal, idx, obj) { - accessed = true; - return obj.length === 2; - } +function callbackfn1(prevVal, curVal, idx, obj) { + accessed = true; + return obj.length === 2; +} - var proto = {}; - Object.defineProperty(proto, "length", { - get: function () { - return 3; - }, - configurable: true - }); +var proto = {}; +Object.defineProperty(proto, "length", { + get: function() { + return 3; + }, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - Object.defineProperty(child, "length", { - get: function () { - return 2; - }, - configurable: true - }); - child[0] = 12; - child[1] = 11; - child[2] = 9; +var child = new Con(); +Object.defineProperty(child, "length", { + get: function() { + return 2; + }, + configurable: true +}); +child[0] = 12; +child[1] = 11; +child[2] = 9; assert(Array.prototype.reduceRight.call(child, callbackfn1, 111), 'Array.prototype.reduceRight.call(child, callbackfn1, 111) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-1.js index d309b78ac3e9f31d99a42517d8816a90a6cdcdc5..7ce837aeb6904a8d34fec1f7d180b8f8f67048e0 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-1.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-1.js @@ -7,13 +7,16 @@ es5id: 15.4.4.22-3-1 description: Array.prototype.reduceRight - value of 'length' is undefined ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; +} - var obj = { 0: 9, length: undefined }; +var obj = { + 0: 9, + length: undefined +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 1), 1, 'Array.prototype.reduceRight.call(obj, callbackfn, 1)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-10.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-10.js index be485e4db8ec4263d5ea224396e713f9be30909d..938371d98659f4d85be61fcc37293f7b82bf943b 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-10.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-10.js @@ -9,13 +9,16 @@ description: > is NaN) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; +} - var obj = { 0: 9, length: NaN }; +var obj = { + 0: 9, + length: NaN +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 1), 1, 'Array.prototype.reduceRight.call(obj, callbackfn, 1)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-11.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-11.js index c5d9cb5abc7a1955cbb7d028286b0ca0b0736751..63f6e5712192f6ef6a467eb28df3c85a9c023b22 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-11.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-11.js @@ -9,22 +9,28 @@ description: > containing a positive number ---*/ - var testResult1 = true; - var testResult2 = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx > 1) { - testResult1 = false; - } +var testResult1 = true; +var testResult2 = false; - if (idx === 1) { - testResult2 = true; - } - return false; - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx > 1) { + testResult1 = false; + } - var obj = { 0: 12, 1: 11, 2: 9, length: "2" }; + if (idx === 1) { + testResult2 = true; + } + return false; +} - Array.prototype.reduceRight.call(obj, callbackfn, 1); +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: "2" +}; + +Array.prototype.reduceRight.call(obj, callbackfn, 1); assert(testResult1, 'testResult1 !== true'); assert(testResult2, 'testResult2 !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-12.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-12.js index f81ce7b4c972bb963f3159d9a12eaca7cd4417d4..3a209ff400ce6ee94f60b727ed00533ac1f84a05 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-12.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-12.js @@ -9,22 +9,28 @@ description: > containing a negative number ---*/ - var testResult1 = true; - var testResult2 = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx > 1) { - testResult1 = false; - } +var testResult1 = true; +var testResult2 = false; - if (idx === 1) { - testResult2 = true; - } - return false; - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx > 1) { + testResult1 = false; + } - var obj = { 0: 11, 1: 12, 2: 9, length: "-4294967294" }; + if (idx === 1) { + testResult2 = true; + } + return false; +} - Array.prototype.reduceRight.call(obj, callbackfn, 1); +var obj = { + 0: 11, + 1: 12, + 2: 9, + length: "-4294967294" +}; + +Array.prototype.reduceRight.call(obj, callbackfn, 1); assert(testResult1, 'testResult1 !== true'); assert.sameValue(testResult2, false, 'testResult2'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-13.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-13.js index 054d4cf94c314986cdfe62f4fc5115b9ee49ebcf..6fb47ffde728c9fd4855556c63a95972a798cc63 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-13.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-13.js @@ -9,22 +9,28 @@ description: > containing a decimal number ---*/ - var testResult1 = true; - var testResult2 = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx > 1) { - testResult1 = false; - } +var testResult1 = true; +var testResult2 = false; - if (idx === 1) { - testResult2 = true; - } - return false; - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx > 1) { + testResult1 = false; + } - var obj = { 0: 12, 1: 11, 2: 9, length: "2.5" }; + if (idx === 1) { + testResult2 = true; + } + return false; +} - Array.prototype.reduceRight.call(obj, callbackfn, 1); +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: "2.5" +}; + +Array.prototype.reduceRight.call(obj, callbackfn, 1); assert(testResult1, 'testResult1 !== true'); assert(testResult2, 'testResult2 !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-14.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-14.js index 8f7aeeb38202cdc81a0edbe621499e8c7246c5d5..8fc2ef112aa3c4ec252d61b2a832f32473794d95 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-14.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-14.js @@ -9,13 +9,16 @@ description: > containing -Infinity ---*/ - var accessed2 = false; +var accessed2 = false; - function callbackfn2(prevVal, curVal, idx, obj) { - accessed2 = true; - } +function callbackfn2(prevVal, curVal, idx, obj) { + accessed2 = true; +} - var obj2 = { 0: 9, length: "-Infinity" }; +var obj2 = { + 0: 9, + length: "-Infinity" +}; assert.sameValue(Array.prototype.reduceRight.call(obj2, callbackfn2, 2), 2, 'Array.prototype.reduceRight.call(obj2, callbackfn2, 2)'); assert.sameValue(accessed2, false, 'accessed2'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-15.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-15.js index a77e817bd37b647fccda4bbac00f6fe58970a3e3..dc7937f7762b9beef3468c645ad1340328ce5aa2 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-15.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-15.js @@ -9,22 +9,28 @@ description: > containing an exponential number ---*/ - var testResult1 = true; - var testResult2 = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx > 1) { - testResult1 = false; - } +var testResult1 = true; +var testResult2 = false; - if (idx === 1) { - testResult2 = true; - } - return false; - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx > 1) { + testResult1 = false; + } - var obj = { 0: 12, 1: 11, 2: 9, length: "2E0" }; + if (idx === 1) { + testResult2 = true; + } + return false; +} - Array.prototype.reduceRight.call(obj, callbackfn, 1); +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: "2E0" +}; + +Array.prototype.reduceRight.call(obj, callbackfn, 1); assert(testResult1, 'testResult1 !== true'); assert(testResult2, 'testResult2 !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-16.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-16.js index 6d75ccf2e61f6498eaebd4b50872660cda194a87..ac8deb3c9052d98be8421c25823b0ec92a7dc015 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-16.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-16.js @@ -9,22 +9,28 @@ description: > containing a hex number ---*/ - var testResult1 = true; - var testResult2 = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx > 1) { - testResult1 = false; - } +var testResult1 = true; +var testResult2 = false; - if (idx === 1) { - testResult2 = true; - } - return false; - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx > 1) { + testResult1 = false; + } - var obj = { 0: 12, 1: 11, 2: 9, length: "0x0002" }; + if (idx === 1) { + testResult2 = true; + } + return false; +} - Array.prototype.reduceRight.call(obj, callbackfn, 1); +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: "0x0002" +}; + +Array.prototype.reduceRight.call(obj, callbackfn, 1); assert(testResult1, 'testResult1 !== true'); assert(testResult2, 'testResult2 !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-17.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-17.js index ace3561654ae968124d000de4c568e89feb8c7cf..5da8f8d4faff6e1e25b997b4959fc63c0265e0ce 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-17.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-17.js @@ -9,22 +9,28 @@ description: > containing a number with leading zeros ---*/ - var testResult1 = true; - var testResult2 = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx > 1) { - testResult1 = false; - } +var testResult1 = true; +var testResult2 = false; - if (idx === 1) { - testResult2 = true; - } - return false; - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx > 1) { + testResult1 = false; + } - var obj = { 0: 12, 1: 11, 2: 9, length: "0002.00" }; + if (idx === 1) { + testResult2 = true; + } + return false; +} - Array.prototype.reduceRight.call(obj, callbackfn, 1); +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: "0002.00" +}; + +Array.prototype.reduceRight.call(obj, callbackfn, 1); assert(testResult1, 'testResult1 !== true'); assert(testResult2, 'testResult2 !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-18.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-18.js index 1ae0c97f9a07815b7485ac7917faf99f36376344..bd2586f98929c618e25af015f824880c3d922bc6 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-18.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-18.js @@ -9,13 +9,17 @@ description: > can't convert to a number ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; +} - var obj = { 0: 9, 1: 8, length: "two" }; +var obj = { + 0: 9, + 1: 8, + length: "two" +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 11), 11, 'Array.prototype.reduceRight.call(obj, callbackfn, 11)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-19.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-19.js index 4f314ad517aefd09b8ff8bce5dd9b5d6aeb38e83..1e2f2e395bccfaa3ccea9f54b7dbe45df3ec06f6 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-19.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-19.js @@ -9,39 +9,40 @@ description: > has an own toString method ---*/ - var testResult1 = true; - var testResult2 = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx > 1) { - testResult1 = false; - } - - if (idx === 1) { - testResult2 = true; - } - return false; - } - - var toStringAccessed = false; - var obj = { - 0: 12, - 1: 11, - 2: 9, - length: { - toString: function () { - toStringAccessed = true; - return '2'; - } - } - }; - - // objects inherit the default valueOf() method from Object - // that simply returns itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - - Array.prototype.reduceRight.call(obj, callbackfn, 1); +var testResult1 = true; +var testResult2 = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx > 1) { + testResult1 = false; + } + + if (idx === 1) { + testResult2 = true; + } + return false; +} + +var toStringAccessed = false; +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: { + toString: function() { + toStringAccessed = true; + return '2'; + } + } +}; + +// objects inherit the default valueOf() method from Object +// that simply returns itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. + +Array.prototype.reduceRight.call(obj, callbackfn, 1); assert(testResult1, 'testResult1 !== true'); assert(testResult2, 'testResult2 !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-2.js index 80ddaeaa9c40881d2917bad515f1f101f24d5ee9..77c0abd1b4a0bf5d00378b7620622a28efbd62ab 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-2.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-2.js @@ -9,13 +9,16 @@ description: > 'length' is 0 (length overridden to false(type conversion)) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(preVal, curVal, idx, obj) { - accessed = true; - } +function callbackfn(preVal, curVal, idx, obj) { + accessed = true; +} - var obj = { 0: 9, length: false }; +var obj = { + 0: 9, + length: false +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 1), 1, 'Array.prototype.reduceRight.call(obj, callbackfn, 1)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-20.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-20.js index f277c7fa84e1b20f6ae601becfb63ef1b284bea9..5b8cf1cbd6ec342631678ede1505ee4dcd7f5f40 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-20.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-20.js @@ -9,34 +9,35 @@ description: > has an own valueOf method ---*/ - var testResult1 = true; - var testResult2 = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx > 1) { - testResult1 = false; - } - - if (idx === 1) { - testResult2 = true; - } - return false; - } - - var valueOfAccessed = false; - - var obj = { - 0: 12, - 1: 11, - 2: 9, - length: { - valueOf: function () { - valueOfAccessed = true; - return 2; - } - } - }; - - Array.prototype.reduceRight.call(obj, callbackfn, 1); +var testResult1 = true; +var testResult2 = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx > 1) { + testResult1 = false; + } + + if (idx === 1) { + testResult2 = true; + } + return false; +} + +var valueOfAccessed = false; + +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: { + valueOf: function() { + valueOfAccessed = true; + return 2; + } + } +}; + +Array.prototype.reduceRight.call(obj, callbackfn, 1); assert(testResult1, 'testResult1 !== true'); assert(testResult2, 'testResult2 !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-21.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-21.js index 1f7f478cd64ce4c0a94229017efaebdba9ad8231..31024633a681f37f75282626b20d7e5270cda216 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-21.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-21.js @@ -10,39 +10,40 @@ description: > returns a string ---*/ - var testResult1 = true; - var testResult2 = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx > 1) { - testResult1 = false; - } - - if (idx === 1) { - testResult2 = true; - } - return false; - } - - var toStringAccessed = false; - var valueOfAccessed = false; - - var obj = { - 0: 12, - 1: 11, - 2: 9, - length: { - valueOf: function () { - valueOfAccessed = true; - return {}; - }, - toString: function () { - toStringAccessed = true; - return '2'; - } - } - }; - - Array.prototype.reduceRight.call(obj, callbackfn, 1); +var testResult1 = true; +var testResult2 = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx > 1) { + testResult1 = false; + } + + if (idx === 1) { + testResult2 = true; + } + return false; +} + +var toStringAccessed = false; +var valueOfAccessed = false; + +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: { + valueOf: function() { + valueOfAccessed = true; + return {}; + }, + toString: function() { + toStringAccessed = true; + return '2'; + } + } +}; + +Array.prototype.reduceRight.call(obj, callbackfn, 1); assert(testResult1, 'testResult1 !== true'); assert(testResult2, 'testResult2 !== true'); 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 717f2c2db1f4f0195c5188084672151c25f17ec9..488f1808f2f335a0a48bc197969249f00f23709f 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 @@ -10,31 +10,31 @@ description: > return primitive values ---*/ - var accessed = false; - var toStringAccessed = false; - var valueOfAccessed = false; +var accessed = false; +var toStringAccessed = false; +var valueOfAccessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; +} - var obj = { - 0: 11, - 1: 12, +var obj = { + 0: 11, + 1: 12, - length: { - valueOf: function () { - valueOfAccessed = true; - return {}; - }, - toString: function () { - toStringAccessed = true; - return {}; - } - } - }; + length: { + valueOf: function() { + valueOfAccessed = true; + return {}; + }, + toString: function() { + toStringAccessed = true; + return {}; + } + } +}; assert.throws(TypeError, function() { - Array.prototype.reduceRight.call(obj, callbackfn, 1); + Array.prototype.reduceRight.call(obj, callbackfn, 1); }); assert(toStringAccessed, 'toStringAccessed !== true'); assert(valueOfAccessed, 'valueOfAccessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-23.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-23.js index 4a3951bcfc758706f9b40582f8809ac56008c47b..f9f5fa105dff257535d284cc5c0510afc854cfb6 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-23.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-23.js @@ -10,45 +10,45 @@ description: > methods ---*/ - var testResult1 = true; - var testResult2 = false; - var valueOfAccessed = false; - var toStringAccessed = false; - - var proto = { - valueOf: function () { - valueOfAccessed = true; - return 2; - } - }; - var Con = function () { }; - Con.prototype = proto; - var child = new Con(); - - function callbackfn(prevVal, curVal, idx, obj) { - if (idx > 1) { - testResult1 = false; - } - - if (idx === 1) { - testResult2 = true; - } - return false; - } - - child.toString = function () { - toStringAccessed = true; - return '1'; - }; - - var obj = { - 0: 12, - 1: 11, - 2: 9, - length: child - }; - - Array.prototype.reduceRight.call(obj, callbackfn, 1); +var testResult1 = true; +var testResult2 = false; +var valueOfAccessed = false; +var toStringAccessed = false; + +var proto = { + valueOf: function() { + valueOfAccessed = true; + return 2; + } +}; +var Con = function() {}; +Con.prototype = proto; +var child = new Con(); + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx > 1) { + testResult1 = false; + } + + if (idx === 1) { + testResult2 = true; + } + return false; +} + +child.toString = function() { + toStringAccessed = true; + return '1'; +}; + +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: child +}; + +Array.prototype.reduceRight.call(obj, callbackfn, 1); assert(testResult1, 'testResult1 !== true'); assert(testResult2, 'testResult2 !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-24.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-24.js index 33ffe0951aeababcb3d3502f33f702de44df639f..db317c993b3ea98be547b89bb377522a0e347af6 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-24.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-24.js @@ -9,22 +9,28 @@ description: > non-integer, ensure truncation occurs in the proper direction ---*/ - var testResult1 = true; - var testResult2 = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx > 1) { - testResult1 = false; - } +var testResult1 = true; +var testResult2 = false; - if (idx === 1) { - testResult2 = true; - } - return false; - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx > 1) { + testResult1 = false; + } - var obj = { 0: 12, 1: 11, 2: 9, length: 2.685 }; + if (idx === 1) { + testResult2 = true; + } + return false; +} - Array.prototype.reduceRight.call(obj, callbackfn, 1); +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: 2.685 +}; + +Array.prototype.reduceRight.call(obj, callbackfn, 1); assert(testResult1, 'testResult1 !== true'); assert(testResult2, 'testResult2 !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-25.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-25.js index 4895baa710780266c507affe071f0d4a15d195c0..eb311aa6fdc796c80468f615cbe27d9be1dc970c 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-25.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-25.js @@ -9,27 +9,28 @@ description: > non-integer ---*/ - var testResult1 = true; - var testResult2 = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx > 1) { - testResult1 = false; - } +var testResult1 = true; +var testResult2 = false; - if (idx === 1) { - testResult2 = true; - } - return false; - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx > 1) { + testResult1 = false; + } - var obj = { - 0: 12, - 1: 11, - 2: 9, - length: -4294967294.5 - }; + if (idx === 1) { + testResult2 = true; + } + return false; +} - Array.prototype.reduceRight.call(obj, callbackfn, 1); +var obj = { + 0: 12, + 1: 11, + 2: 9, + length: -4294967294.5 +}; + +Array.prototype.reduceRight.call(obj, callbackfn, 1); assert(testResult1, 'testResult1 !== true'); assert.sameValue(testResult2, false, 'testResult2'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-3.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-3.js index 5eb75122181d33c7c5f6ab9a9be82a2042295a8e..b651dc45ecc5964296120e4ce6ef21a0bc024484 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-3.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-3.js @@ -9,13 +9,16 @@ description: > is 0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; +} - var obj = { 0: 9, length: 0 }; +var obj = { + 0: 9, + length: 0 +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 1), 1, 'Array.prototype.reduceRight.call(obj, callbackfn, 1)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-4.js index 8317bd611c550aef0590bdf5b800128b5e3d90e4..9b7f07bd4856d412ca1bffb1ac6e8fef6df92bde 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-4.js @@ -9,13 +9,16 @@ description: > is +0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; +} - var obj = { 0: 9, length: +0 }; +var obj = { + 0: 9, + length: +0 +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 1), 1, 'Array.prototype.reduceRight.call(obj, callbackfn, 1)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-5.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-5.js index d41f2f0db0803a953546684f080cf2e047ab74bb..9a8919e54fb9ad4dc4d9fb36ad91d241e9db0207 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-5.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-5.js @@ -9,13 +9,16 @@ description: > is -0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(preVal, curVal, idx, obj) { - accessed = true; - } +function callbackfn(preVal, curVal, idx, obj) { + accessed = true; +} - var obj = { 0: 9, length: -0 }; +var obj = { + 0: 9, + length: -0 +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 1), 1, 'Array.prototype.reduceRight.call(obj, callbackfn, 1)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-6.js index 4caab36e8a1318ddf7d5bad02a023de7be409fb6..69ed877c29e1c80513f80a91650a8501b2cb484b 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-6.js @@ -9,22 +9,27 @@ description: > is positive) ---*/ - var testResult1 = true; - var testResult2 = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx > 1) { - testResult1 = false; - } +var testResult1 = true; +var testResult2 = false; - if (idx === 1) { - testResult2 = true; - } - return false; - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx > 1) { + testResult1 = false; + } - var obj = { 1: 11, 2: 9, length: 2 }; + if (idx === 1) { + testResult2 = true; + } + return false; +} - Array.prototype.reduceRight.call(obj, callbackfn, 1); +var obj = { + 1: 11, + 2: 9, + length: 2 +}; + +Array.prototype.reduceRight.call(obj, callbackfn, 1); assert(testResult1, 'testResult1 !== true'); assert(testResult2, 'testResult2 !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-7.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-7.js index 53556d6bdd1de6b23056349a6f7c277eb81db091..a8da6c075f61bfb190c7b7b8601aacc410a54ef2 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-7.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-7.js @@ -9,22 +9,27 @@ description: > is negative) ---*/ - var testResult1 = true; - var testResult2 = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx > 1) { - testResult1 = false; - } +var testResult1 = true; +var testResult2 = false; - if (idx === 1) { - testResult2 = true; - } - return false; - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx > 1) { + testResult1 = false; + } - var obj = { 1: 11, 2: 9, length: -4294967294 }; + if (idx === 1) { + testResult2 = true; + } + return false; +} - Array.prototype.reduceRight.call(obj, callbackfn, 1); +var obj = { + 1: 11, + 2: 9, + length: -4294967294 +}; + +Array.prototype.reduceRight.call(obj, callbackfn, 1); assert(testResult1, 'testResult1 !== true'); assert.sameValue(testResult2, false, 'testResult2'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-9.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-9.js index b9a895999b5173f7def76f46c51ce90e6c652d5a..7ecc600aab4685e52d4f10d5e92a8ef79c9b9ae0 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-9.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-9.js @@ -9,13 +9,16 @@ description: > is -Infinity) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; +} - var obj = { 0: 9, length: -Infinity }; +var obj = { + 0: 9, + length: -Infinity +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 1), 1, 'Array.prototype.reduceRight.call(obj, callbackfn, 1)'); 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 dc3e1659103a117eaece23c80b8d3629fcc17f50..04017e990ab0f67e3021e64c7b7b528bf25549bc 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 @@ -9,7 +9,7 @@ description: > undefined ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.reduceRight(); + arr.reduceRight(); }); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-10.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-10.js index 78a88e9b867749868af4080a5de3c6b684902063..b6a599910a51c3a98c8f53a128ddb76858606d55 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-10.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-10.js @@ -9,15 +9,18 @@ description: > exception was thrown by step 2 ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - Object.defineProperty(obj, "length", { - get: function () { - throw new Test262Error(); - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + throw new Test262Error(); + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.reduceRight.call(obj, undefined); + Array.prototype.reduceRight.call(obj, undefined); }); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-11.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-11.js index cfb99f9c3b60547a98a1d3d88e3db3cd7e49e4e2..34885bde341b3d61ff046d5767f28787c45a5eb0 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-11.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-11.js @@ -9,19 +9,22 @@ description: > exception was thrown by step 3 ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - throw new Test262Error(); - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + throw new Test262Error(); + } + }; + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.reduceRight.call(obj, undefined); + Array.prototype.reduceRight.call(obj, undefined); }); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-12.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-12.js index 8f83394758aadf68312cf607c8ccc33e22d4eb4a..f4e76497f7568082c9996ec53209d5c6f73cb660 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-12.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-12.js @@ -7,10 +7,11 @@ es5id: 15.4.4.22-4-12 description: Array.prototype.reduceRight - 'callbackfn' is a function ---*/ - var initialValue = 0; - function callbackfn(accum, val, idx, obj) { - accum += val; - return accum; - } +var initialValue = 0; + +function callbackfn(accum, val, idx, obj) { + accum += val; + return accum; +} assert.sameValue([11, 9].reduceRight(callbackfn, initialValue), 20, '[11, 9].reduceRight(callbackfn, initialValue)'); 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 38d8e3f06e6eb7ced3ce513c2b4ea75d0c9bb343..cdef077c69bd25e43ed898dbf1fc67804d18f8d6 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 @@ -9,26 +9,28 @@ description: > same as passing undefined for callbackfn ---*/ - var obj = { 10: 10 }; - var lengthAccessed = false; - var loopAccessed = false; +var obj = { + 10: 10 +}; +var lengthAccessed = false; +var loopAccessed = false; - Object.defineProperty(obj, "length", { - get: function () { - lengthAccessed = true; - return 20; - }, - configurable: true - }); - Object.defineProperty(obj, "0", { - get: function () { - loopAccessed = true; - return 10; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + lengthAccessed = true; + return 20; + }, + configurable: true +}); +Object.defineProperty(obj, "0", { + get: function() { + loopAccessed = true; + return 10; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.reduceRight.call(obj, undefined); + Array.prototype.reduceRight.call(obj, undefined); }); 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 51c148dce6bfd39d560c3a902a5919c66e7da18b..40ea5d53ca84554e47ee2db5ce769b7a8238211b 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 @@ -9,7 +9,7 @@ description: > unreferenced ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(ReferenceError, function() { - arr.reduceRight(foo); + 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 129cfc44ce2bb2bd72b02a7d6c195b6fb1305396..76b084c2badaef3c80afac4a8412e39d32fdbd1a 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.22-4-3 description: Array.prototype.reduceRight throws TypeError if callbackfn is null ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.reduceRight(null); + 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 d4dc6d1f2d8f232a30b3a8dad91baef21f491615..9f0043f12a938cf404f303994bedcbba0d451a91 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 @@ -9,7 +9,7 @@ description: > boolean ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.reduceRight(true); + 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 a20e6ccb38f685ce0a3426dfcda3e05c075db081..e22ed218356a35674476d8b1c1a8ef2072801a24 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 @@ -9,7 +9,7 @@ description: > number ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.reduceRight(5); + 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 f32324399446545a570397bcf4f65b93c6e6971a..e6437a1b334789e9ca837e2ccbdc53ef9faf3db8 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 @@ -9,7 +9,7 @@ description: > string ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.reduceRight("abc"); + 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 86a86b8c97095994e99c5ba265fd92079a2437f1..c6104250dab1083fb7b856656eccf8d2e6c280e2 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 @@ -9,7 +9,7 @@ description: > Object without [[Call]] internal method ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.reduceRight(new Object()); + 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 2b7468f541ba5b926323491c94e011afecb84144..d76239982f5bb7a5d9c591db0182e00138ac55d2 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 @@ -9,18 +9,21 @@ description: > visible when an exception occurs ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - accessed = true; - return 2; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + accessed = true; + return 2; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.reduceRight.call(obj, null); + Array.prototype.reduceRight.call(obj, null); }); 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 dac9e41fa3bff21535e17c80094d4dad7ce31170..0da73eb44d3d7d9412a0f637cee7ee913ed5be6f 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 @@ -9,22 +9,25 @@ description: > visible when an exception occurs ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - accessed = true; - return "2"; - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + accessed = true; + return "2"; + } + }; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.reduceRight.call(obj, null); + Array.prototype.reduceRight.call(obj, null); }); 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 7aca869816ad907800a2229a25bd63cd87fb9942..562903de4251ace1958e3c48c0cab782be0dd890 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 @@ -9,7 +9,7 @@ description: > (empty array), no initVal ---*/ - function cb(){} +function cb() {} assert.throws(TypeError, function() { - [].reduceRight(cb); + [].reduceRight(cb); }); 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 ede41e29f6d7e2b264b37e5bb04a356d8fd9c01f..f70a3062d04a0d8e102fae3905a5194219118ae6 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 @@ -9,18 +9,21 @@ description: > an exception occurs ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - accessed = true; - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + accessed = true; + return 0; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.reduceRight.call(obj, function () { }); + Array.prototype.reduceRight.call(obj, function() {}); }); 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 627bebe3000bbcb7c1afa491543e62f9e387b0f7..a0d148aacf14eb88fb491d0e1740498007988b3e 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 @@ -9,22 +9,25 @@ description: > an exception occurs ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - accessed = true; - return "0"; - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + accessed = true; + return "0"; + } + }; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.reduceRight.call(obj, function () { }); + Array.prototype.reduceRight.call(obj, function() {}); }); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-12.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-12.js index 7115439f2734a710b49640bc92f1ee0edd9d936f..5a8f4909671d3956ddb62aa7889701d9957410df 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-12.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-12.js @@ -9,15 +9,18 @@ description: > exception was thrown by step 2 ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - Object.defineProperty(obj, "length", { - get: function () { - throw new Test262Error(); - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + throw new Test262Error(); + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.reduceRight.call(obj, function () { }); + Array.prototype.reduceRight.call(obj, function() {}); }); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-13.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-13.js index 8ff17da58e39e55d4a37c441a4048e5fd3fedc8f..f3a658dbdf7329232da94dcd7cfd0227641544ce 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-13.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-13.js @@ -9,19 +9,22 @@ description: > exception was thrown by step 3 ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - throw new Test262Error(); - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + throw new Test262Error(); + } + }; + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.reduceRight.call(obj, function () { }); + Array.prototype.reduceRight.call(obj, function() {}); }); 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 4f74f4fb56efbb0666ac600d0d1bce0d1ab1bc6b..e2ea6c0a1d3f6da9c5052b451d1b7e601d08c3ba 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 @@ -10,12 +10,13 @@ description: > no initVal ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = null; +foo.prototype = new Array(1, 2, 3); - function cb(){} +function foo() {} +var f = new foo(); +f.length = null; + +function cb() {} assert.throws(TypeError, function() { - f.reduceRight(cb); + f.reduceRight(cb); }); 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 a19e73e2b10d19e24cf11b8b57ee02dd3a0acb1b..1256ed66879d88b032e291dc18d5a657919c6cc9 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 @@ -10,12 +10,13 @@ description: > no initVal ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = false; +foo.prototype = new Array(1, 2, 3); - function cb(){} +function foo() {} +var f = new foo(); +f.length = false; + +function cb() {} assert.throws(TypeError, function() { - f.reduceRight(cb); + f.reduceRight(cb); }); 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 31a202f5ecff0c0769a5b490e5b0088465d4440f..ec024658ff36d890283e69ea74f98eec79cb8a4f 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 @@ -10,12 +10,13 @@ description: > initVal ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = 0; +foo.prototype = new Array(1, 2, 3); - function cb(){} +function foo() {} +var f = new foo(); +f.length = 0; + +function cb() {} assert.throws(TypeError, function() { - f.reduceRight(cb); + f.reduceRight(cb); }); 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 db633c21424bebe2709543df3d67ea3570ac69f1..ddf90e92e9d35b824ebd17e21ca913262583ff99 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 @@ -10,12 +10,13 @@ description: > initVal ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = '0'; +foo.prototype = new Array(1, 2, 3); - function cb(){} +function foo() {} +var f = new foo(); +f.length = '0'; + +function cb() {} assert.throws(TypeError, function() { - f.reduceRight(cb); + f.reduceRight(cb); }); 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 cea6793e0bb10bdb30f7f546b32776b662778d53..76d34aed035fea9c5924ebb11e5c32c8413266b5 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 @@ -10,14 +10,19 @@ description: > initVal ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - var o = { valueOf: function () { return 0;}}; - f.length = o; +function foo() {} +var f = new foo(); - function cb(){} +var o = { + valueOf: function() { + return 0; + } +}; +f.length = o; + +function cb() {} assert.throws(TypeError, function() { - f.reduceRight(cb); + f.reduceRight(cb); }); 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 6fac3bfd8dc8aba8151140bcab32da657fc0b0b7..bd392b80038d43145d43ddc1ed6dd09e71a49e61 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 @@ -10,20 +10,25 @@ description: > (toString)), no initVal ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - var o = { toString: function () { return '0';}}; - f.length = o; +function foo() {} +var f = new foo(); - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. +var o = { + toString: function() { + return '0'; + } +}; +f.length = o; - function cb(){} +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. + +function cb() {} assert.throws(TypeError, function() { - f.reduceRight(cb); + f.reduceRight(cb); }); 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 10631cf823d7230f24887c18d77fbad20783a07b..93ce902f0ba6e4b0e4feeb0fefbdb599c93ae2dc 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 @@ -9,27 +9,28 @@ description: > (subclassed Array, length overridden with []), no initVal ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - f.length = []; +function foo() {} +var f = new foo(); - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - // - // The toString( ) method on Array converts the array elements to strings, - // then returns the result of concatenating these strings, with commas in - // between. An array with no elements converts to the empty string, which - // converts to the number 0. If an array has a single element that is a - // number n, the array converts to a string representation of n, which is - // then converted back to n itself. If an array contains more than one element, - // or if its one element is not a number, the array converts to NaN. +f.length = []; - function cb(){} +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +// +// The toString( ) method on Array converts the array elements to strings, +// then returns the result of concatenating these strings, with commas in +// between. An array with no elements converts to the empty string, which +// converts to the number 0. If an array has a single element that is a +// number n, the array converts to a string representation of n, which is +// then converted back to n itself. If an array contains more than one element, +// or if its one element is not a number, the array converts to NaN. + +function cb() {} assert.throws(TypeError, function() { - f.reduceRight(cb); + f.reduceRight(cb); }); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-9.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-9.js index ce3fe68446dccd28da74569c655b198b3986b253..8c9053cdb44a4ae0b717d5a5f70130a32a8f363c 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-9.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-9.js @@ -9,6 +9,6 @@ description: > is 0 and 'initialValue' is present ---*/ - var initialValue = 10; +var initialValue = 10; -assert.sameValue([].reduceRight(function () { }, initialValue), initialValue, '[].reduceRight(function () { }, initialValue)'); +assert.sameValue([].reduceRight(function() {}, initialValue), initialValue, '[].reduceRight(function () { }, initialValue)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-1.js index cd191ee0eaf5d27821667a475b07a06e1af9cf2a..76cec3316eb3f3c8d7493cef1fdc21f446ac6041 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-1.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-1.js @@ -9,5 +9,5 @@ description: > and initialValue is present (empty array) ---*/ - function cb(){} -assert.sameValue([].reduceRight(cb,1), 1, '[].reduceRight(cb,1)'); +function cb() {} +assert.sameValue([].reduceRight(cb, 1), 1, '[].reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-10.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-10.js index ca80beabf5c1674792f0c9450be86fe8cb784d93..c50c734da44f66e29dd782b19ff44513c7284f49 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-10.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-10.js @@ -7,6 +7,6 @@ es5id: 15.4.4.22-7-10 description: Array.prototype.reduceRight - 'initialValue' is present ---*/ - var str = "initialValue is present"; +var str = "initialValue is present"; -assert.sameValue([].reduceRight(function () { }, str), str, '[].reduceRight(function () { }, str)'); +assert.sameValue([].reduceRight(function() {}, str), str, '[].reduceRight(function () { }, str)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-11.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-11.js index c7c2a92a6ddad3515dc4a5d8e8a134c1296799f1..466105ad620b20350109204452d8c7b23244d439 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-11.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-11.js @@ -7,6 +7,6 @@ es5id: 15.4.4.22-7-11 description: Array.prototype.reduceRight - 'initialValue' is not present ---*/ - var str = "initialValue is not present"; +var str = "initialValue is not present"; -assert.sameValue([str].reduceRight(function () { }), str, '[str].reduceRight(function () { })'); +assert.sameValue([str].reduceRight(function() {}), str, '[str].reduceRight(function () { })'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-2.js index d6bbe8e4db337ee0df041110ec681bd7e02cedec..226fe2e53b94e35486d2ef80a4fbf575dbcb1fb0 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-2.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-2.js @@ -10,10 +10,11 @@ description: > to null (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = null; +foo.prototype = new Array(1, 2, 3); - function cb(){} -assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); +function foo() {} +var f = new foo(); +f.length = null; + +function cb() {} +assert.sameValue(f.reduceRight(cb, 1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-3.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-3.js index f06d61ae53b2a09a9c0bd6ce29485cd3dadc0156..07b39a3cce8d929d1e4b9fb988837c66b7dbe30a 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-3.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-3.js @@ -10,10 +10,11 @@ description: > to false (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = false; +foo.prototype = new Array(1, 2, 3); - function cb(){} -assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); +function foo() {} +var f = new foo(); +f.length = false; + +function cb() {} +assert.sameValue(f.reduceRight(cb, 1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-4.js index 5cc4058fe4001e9fc9ec80305a1d34cf1b3f1ffe..6006a08c351e147025545587e8c123a096cfebf1 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-4.js @@ -10,10 +10,11 @@ description: > to 0 (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = 0; +foo.prototype = new Array(1, 2, 3); - function cb(){} -assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); +function foo() {} +var f = new foo(); +f.length = 0; + +function cb() {} +assert.sameValue(f.reduceRight(cb, 1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-5.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-5.js index 1a7b538fdc90d28adbd5c11a96c710aadcdfe45d..e91ba162767488c32417c0696ee2db5421805802 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-5.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-5.js @@ -10,10 +10,11 @@ description: > to '0' (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = '0'; +foo.prototype = new Array(1, 2, 3); - function cb(){} -assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); +function foo() {} +var f = new foo(); +f.length = '0'; + +function cb() {} +assert.sameValue(f.reduceRight(cb, 1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-6.js index 7d7f0356d04a4332683a4946085423215d35754e..5fda998754d12087c34e5e2c9c2c3f6516d6a5bd 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-6.js @@ -10,12 +10,17 @@ description: > with obj with valueOf) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - var o = { valueOf: function () { return 0;}}; - f.length = o; +function foo() {} +var f = new foo(); - function cb(){} -assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); +var o = { + valueOf: function() { + return 0; + } +}; +f.length = o; + +function cb() {} +assert.sameValue(f.reduceRight(cb, 1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-7.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-7.js index a2fdb76eb079cf51313f6bd6c3a9e02fcab24543..80819a2b4c03c2b72b1d677af34cfcbac766125e 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-7.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-7.js @@ -10,18 +10,23 @@ description: > with obj w/o valueOf (toString)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - var o = { toString: function () { return '0';}}; - f.length = o; +function foo() {} +var f = new foo(); - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. +var o = { + toString: function() { + return '0'; + } +}; +f.length = o; - function cb(){} -assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. + +function cb() {} +assert.sameValue(f.reduceRight(cb, 1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-8.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-8.js index 88fd551cf1ca0186ac617f25e9daaf985b79e3fb..d2db08ed909c648361114853501799b675ff7f0a 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-8.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-8.js @@ -10,25 +10,26 @@ description: > with []) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - f.length = []; +function foo() {} +var f = new foo(); - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - // - // The toString( ) method on Array converts the array elements to strings, - // then returns the result of concatenating these strings, with commas in - // between. An array with no elements converts to the empty string, which - // converts to the number 0. If an array has a single element that is a - // number n, the array converts to a string representation of n, which is - // then converted back to n itself. If an array contains more than one element, - // or if its one element is not a number, the array converts to NaN. +f.length = []; - function cb(){} -assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +// +// The toString( ) method on Array converts the array elements to strings, +// then returns the result of concatenating these strings, with commas in +// between. An array with no elements converts to the empty string, which +// converts to the number 0. If an array has a single element that is a +// number n, the array converts to a string representation of n, which is +// then converted back to n itself. If an array contains more than one element, +// or if its one element is not a number, the array converts to NaN. + +function cb() {} +assert.sameValue(f.reduceRight(cb, 1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-9.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-9.js index b7d1567e270ad226987c12962720706f62be9d82..9903f299bfb04a51ecd5bcf982f097a429987e3f 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-9.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-9.js @@ -10,25 +10,26 @@ description: > with [0]) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - f.length = [0]; +function foo() {} +var f = new foo(); - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - // - // The toString( ) method on Array converts the array elements to strings, - // then returns the result of concatenating these strings, with commas in - // between. An array with no elements converts to the empty string, which - // converts to the number 0. If an array has a single element that is a - // number n, the array converts to a string representation of n, which is - // then converted back to n itself. If an array contains more than one element, - // or if its one element is not a number, the array converts to NaN. +f.length = [0]; - function cb(){} -assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +// +// The toString( ) method on Array converts the array elements to strings, +// then returns the result of concatenating these strings, with commas in +// between. An array with no elements converts to the empty string, which +// converts to the number 0. If an array has a single element that is a +// number n, the array converts to a string representation of n, which is +// then converted back to n itself. If an array contains more than one element, +// or if its one element is not a number, the array converts to NaN. + +function cb() {} +assert.sameValue(f.reduceRight(cb, 1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-1.js index 2763dde2e588bea595f8a9419f67f83ec98b494f..de85b84e2c403823a302338ca0242ea27a9915b7 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-1.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-1.js @@ -9,20 +9,22 @@ description: > is 0 ---*/ - var accessed = false; +var accessed = false; - var obj = { length: 0 }; +var obj = { + length: 0 +}; - Object.defineProperty(obj, "0", { - get: function () { - accessed = true; - return 10; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + accessed = true; + return 10; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.reduceRight.call(obj, function () { }); + Array.prototype.reduceRight.call(obj, function() {}); }); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-2.js index c2c0b4e857058fb8cdda1dfa9a76561c00691a54..96e4d9109a8acad7dcdac525ecd40a4778e9c8a3 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-2.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-2.js @@ -9,22 +9,23 @@ description: > number of iterations in step 9 ---*/ - var called = 0; - function callbackfn(prevVal, curVal, idx, obj) { - called++; - return prevVal + curVal; - } +var called = 0; - var arr = [0, 1, 2, 3]; - Object.defineProperty(arr, "4", { - get: function () { - arr.length = 2; - return 10; - }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + called++; + return prevVal + curVal; +} - var preVal = arr.reduceRight(callbackfn); +var arr = [0, 1, 2, 3]; +Object.defineProperty(arr, "4", { + get: function() { + arr.length = 2; + return 10; + }, + configurable: true +}); + +var preVal = arr.reduceRight(callbackfn); assert.sameValue(preVal, 11, 'preVal'); assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-3.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-3.js index cfa839663c63e916e52a1ae9d75fe1bf8e95198d..0c9292f9760409487c6775a5e03253bf56a727af 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-3.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-3.js @@ -9,37 +9,37 @@ description: > 'kPresent' is true ---*/ - var called = 0; - var testResult = false; - var firstCalled = 0; - var secondCalled = 0; - - function callbackfn(prevVal, val, idx, obj) { - if (called === 0) { - testResult = (idx === 1); - } - called++; - } - - var arr = [, , , ]; - - Object.defineProperty(arr, "1", { - get: function () { - firstCalled++; - return 9; - }, - configurable: true - }); - - Object.defineProperty(arr, "2", { - get: function () { - secondCalled++; - return 11; - }, - configurable: true - }); - - arr.reduceRight(callbackfn); +var called = 0; +var testResult = false; +var firstCalled = 0; +var secondCalled = 0; + +function callbackfn(prevVal, val, idx, obj) { + if (called === 0) { + testResult = (idx === 1); + } + called++; +} + +var arr = [, , , ]; + +Object.defineProperty(arr, "1", { + get: function() { + firstCalled++; + return 9; + }, + configurable: true +}); + +Object.defineProperty(arr, "2", { + get: function() { + secondCalled++; + return 11; + }, + configurable: true +}); + +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); assert.sameValue(firstCalled, 1, 'firstCalled'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-ii-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-ii-1.js index 41ea823dc7e60d431d1cdedfb253cff9d6317291..cbd57020ed9f2d41f0089a1819b19b56762bf1e0 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-ii-1.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-ii-1.js @@ -9,16 +9,16 @@ description: > visible here ---*/ - var obj = {}; +var obj = {}; - function callbackfn(prevVal, curVal, idx, obj) { } +function callbackfn(prevVal, curVal, idx, obj) {} - Object.defineProperty(obj, "length", { - get: function () { - obj[2] = "accumulator"; - return 3; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + obj[2] = "accumulator"; + return 3; + }, + configurable: true +}); assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn), "accumulator", 'Array.prototype.reduceRight.call(obj, callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-ii-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-ii-2.js index 4afeb3bb757bb4c39bbdfc80f6c2105cbedcd1ec..8da273e0c227ee8c13d8d014f613f0d48fd45163 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-ii-2.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-ii-2.js @@ -9,14 +9,17 @@ description: > visible here ---*/ - var obj = { 2: "accumulator", 3: "another" }; +var obj = { + 2: "accumulator", + 3: "another" +}; - Object.defineProperty(obj, "length", { - get: function () { - delete obj[2]; - return 5; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + delete obj[2]; + return 5; + }, + configurable: true +}); -assert.notSameValue(Array.prototype.reduceRight.call(obj, function () { }), "accumulator", 'Array.prototype.reduceRight.call(obj, function () { })'); +assert.notSameValue(Array.prototype.reduceRight.call(obj, function() {}), "accumulator", 'Array.prototype.reduceRight.call(obj, function () { })'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-1.js index d3421ebb5c5a06467d06e7ea3f8d6d2db61fb6dd..3edc44785362d676f9701b64f4db47c50cdab2fc 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-1.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-1.js @@ -9,15 +9,20 @@ description: > property on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 0) { - testResult = (prevVal === 1); - } - } +var testResult = false; - var obj = { 0: 0, 1: 1, length: 2 }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 0) { + testResult = (prevVal === 1); + } +} - Array.prototype.reduceRight.call(obj, callbackfn); +var obj = { + 0: 0, + 1: 1, + length: 2 +}; + +Array.prototype.reduceRight.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-10.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-10.js index 2f82c12890537e62fa62ac156c34a5d2fb1247d9..d76cbfc0264fee3618565113548a0643fe8b9465 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-10.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-10.js @@ -9,22 +9,23 @@ description: > accessor property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 2) { - testResult = (curVal === 2); - } - } +var testResult = false; - var arr = [0, 1, , 3]; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 2) { + testResult = (curVal === 2); + } +} - Object.defineProperty(arr, "2", { - get: function () { - return 2; - }, - configurable: true - }); +var arr = [0, 1, , 3]; - arr.reduceRight(callbackfn); +Object.defineProperty(arr, "2", { + get: function() { + return 2; + }, + configurable: true +}); + +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-11.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-11.js index 62c9245a9a908109fd448b7f7cb0988e8e9f8145..98aea64ef52c4d75fb20041cf9f867e2a80bd5a7 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-11.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-11.js @@ -10,28 +10,33 @@ description: > Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === "20"); - } - } - - var proto = { 0: 0, 1: 1, 2: 2 }; - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 3; - - Object.defineProperty(child, "2", { - get: function () { - return "20"; - }, - configurable: true - }); - - Array.prototype.reduceRight.call(child, callbackfn); +var testResult = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === "20"); + } +} + +var proto = { + 0: 0, + 1: 1, + 2: 2 +}; + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 3; + +Object.defineProperty(child, "2", { + get: function() { + return "20"; + }, + configurable: true +}); + +Array.prototype.reduceRight.call(child, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-12.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-12.js index ee042baaecb930c409b61d07a23c595f508d443e..d322bc64d9e6dd0c446c76a651a5ea0e58a66dad 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-12.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-12.js @@ -10,23 +10,24 @@ description: > Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === "20"); - } - } +var testResult = false; - Array.prototype[2] = 2; - var arr = [0, 1]; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === "20"); + } +} - Object.defineProperty(arr, "2", { - get: function () { - return "20"; - }, - configurable: true - }); +Array.prototype[2] = 2; +var arr = [0, 1]; - arr.reduceRight(callbackfn); +Object.defineProperty(arr, "2", { + get: function() { + return "20"; + }, + configurable: true +}); + +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-13.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-13.js index 0d3c40e0ab86d281c97eea790257c1f45526a58a..f2e27dc4edc6c4e81bc421e5df2d227c835eae23 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-13.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-13.js @@ -10,35 +10,39 @@ description: > an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === "20"); - } - } - - var proto = { 0: 0, 1: 1 }; - - Object.defineProperty(proto, "2", { - get: function () { - return 2; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 3; - - Object.defineProperty(child, "2", { - get: function () { - return "20"; - }, - configurable: true - }); - - Array.prototype.reduceRight.call(child, callbackfn); +var testResult = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === "20"); + } +} + +var proto = { + 0: 0, + 1: 1 +}; + +Object.defineProperty(proto, "2", { + get: function() { + return 2; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 3; + +Object.defineProperty(child, "2", { + get: function() { + return "20"; + }, + configurable: true +}); + +Array.prototype.reduceRight.call(child, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-14.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-14.js index 3973a35930171e2314431b3d7c77f6a7d0e449a6..74613a0782c6df19e573a04a708fcb7163e71b11 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-14.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-14.js @@ -10,29 +10,30 @@ description: > an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === "20"); - } - } - - Object.defineProperty(Array.prototype, "2", { - get: function () { - return 2; - }, - configurable: true - }); - - var arr = [0, 1, , ]; - - Object.defineProperty(arr, "2", { - get: function () { - return "20"; - }, - configurable: true - }); - - arr.reduceRight(callbackfn); +var testResult = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === "20"); + } +} + +Object.defineProperty(Array.prototype, "2", { + get: function() { + return 2; + }, + configurable: true +}); + +var arr = [0, 1, , ]; + +Object.defineProperty(arr, "2", { + get: function() { + return "20"; + }, + configurable: true +}); + +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-15.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-15.js index 5ed456fb15b675bf1c5318f9df21520033a65b33..4a484444e301c70eb598e432451c27f1e857702e 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-15.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-15.js @@ -9,28 +9,32 @@ description: > accessor property on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 2); - } - } +var testResult = false; - var proto = { 0: 0, 1: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 2); + } +} - Object.defineProperty(proto, "2", { - get: function () { - return 2; - }, - configurable: true - }); +var proto = { + 0: 0, + 1: 1 +}; - var Con = function () { }; - Con.prototype = proto; +Object.defineProperty(proto, "2", { + get: function() { + return 2; + }, + configurable: true +}); - var child = new Con(); - child.length = 3; +var Con = function() {}; +Con.prototype = proto; - Array.prototype.reduceRight.call(child, callbackfn); +var child = new Con(); +child.length = 3; + +Array.prototype.reduceRight.call(child, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-16.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-16.js index b2cc5cbb2fcfd09e6638aa65d71f20ff12cad411..8d473225bef1d2e3efce545d2621184d142b17f3 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-16.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-16.js @@ -9,22 +9,23 @@ description: > accessor property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 2); - } - } +var testResult = false; - Object.defineProperty(Array.prototype, "2", { - get: function () { - return 2; - }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 2); + } +} - var arr = [0, 1, , ]; +Object.defineProperty(Array.prototype, "2", { + get: function() { + return 2; + }, + configurable: true +}); - arr.reduceRight(callbackfn); +var arr = [0, 1, , ]; + +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-17.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-17.js index 754f25206eadbb242549f656114769a6b947d3c0..00cb060697f6848bfd265cfb45fffbe4d951705a 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-17.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-17.js @@ -9,20 +9,25 @@ description: > accessor property without a get function on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (typeof prevVal === "undefined"); - } - } +var testResult = false; - var obj = { 0: 0, 1: 1, length: 3 }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (typeof prevVal === "undefined"); + } +} - Object.defineProperty(obj, "2", { - set: function () { }, - configurable: true - }); +var obj = { + 0: 0, + 1: 1, + length: 3 +}; - Array.prototype.reduceRight.call(obj, callbackfn); +Object.defineProperty(obj, "2", { + set: function() {}, + configurable: true +}); + +Array.prototype.reduceRight.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-18.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-18.js index 7413e3140f4f9b1cfb4a17f696cd978fe13279c4..4be07578a852774562a0358057c47e180c91ecd0 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-18.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-18.js @@ -9,20 +9,21 @@ description: > accessor property without a get function on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (typeof prevVal === "undefined"); - } - } +var testResult = false; - var arr = [0, 1]; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (typeof prevVal === "undefined"); + } +} - Object.defineProperty(arr, "2", { - set: function () { }, - configurable: true - }); +var arr = [0, 1]; - arr.reduceRight(callbackfn); +Object.defineProperty(arr, "2", { + set: function() {}, + configurable: true +}); + +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-19.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-19.js index 55df142cb210190b91fe910fdefcd31b6cf74180..65b0ec395f1dd7715504b0973a2a0fa42c9611e7 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-19.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-19.js @@ -10,21 +10,26 @@ description: > inherited accessor property on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (typeof prevVal === "undefined"); - } - } +var testResult = false; - Object.prototype[2] = 2; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (typeof prevVal === "undefined"); + } +} - var obj = { 0: 0, 1: 1, length: 3 }; - Object.defineProperty(obj, "2", { - set: function () { }, - configurable: true - }); +Object.prototype[2] = 2; - Array.prototype.reduceRight.call(obj, callbackfn); +var obj = { + 0: 0, + 1: 1, + length: 3 +}; +Object.defineProperty(obj, "2", { + set: function() {}, + configurable: true +}); + +Array.prototype.reduceRight.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-2.js index e7dfce50ce87e96a52203d6c36021b708226c560..6b68c4259f7854c4af1010b94e0ec608e78eff80 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-2.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-2.js @@ -9,15 +9,16 @@ description: > property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 2); - } - } +var testResult = false; - var arr = [0, 1, 2]; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 2); + } +} - arr.reduceRight(callbackfn); +var arr = [0, 1, 2]; + +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-20.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-20.js index 7c0d2b3d55d7c1ad69a7f4d0c3a5721d65f7e1db..f42f77de414e6c405ff04944a524461e64912950 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-20.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-20.js @@ -10,20 +10,21 @@ description: > inherited accessor property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (typeof prevVal === "undefined"); - } - } +var testResult = false; - Array.prototype[2] = 2; - var arr = [0, 1]; - Object.defineProperty(arr, "2", { - set: function () { }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (typeof prevVal === "undefined"); + } +} - arr.reduceRight(callbackfn); +Array.prototype[2] = 2; +var arr = [0, 1]; +Object.defineProperty(arr, "2", { + set: function() {}, + configurable: true +}); + +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-21.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-21.js index c2586e35a0efe3631d37f05db971a0034603d24a..234438eb9e5aebde098864f654a604cf4a54a096 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-21.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-21.js @@ -9,26 +9,30 @@ description: > accessor property without a get function on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (typeof prevVal === "undefined"); - } - } +var testResult = false; - var proto = { 0: 0, 1: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (typeof prevVal === "undefined"); + } +} - Object.defineProperty(proto, "2", { - set: function () { }, - configurable: true - }); +var proto = { + 0: 0, + 1: 1 +}; - var Con = function () { }; - Con.prototype = proto; +Object.defineProperty(proto, "2", { + set: function() {}, + configurable: true +}); - var child = new Con(); - child.length = 3; +var Con = function() {}; +Con.prototype = proto; - Array.prototype.reduceRight.call(child, callbackfn); +var child = new Con(); +child.length = 3; + +Array.prototype.reduceRight.call(child, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-22.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-22.js index 0c3321dcecddfc92873dfdfa36bae20eb91b0240..80141700405fb948bb3ef3cde18dba35b37fba54 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-22.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-22.js @@ -9,20 +9,21 @@ description: > accessor property without a get function on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (typeof prevVal === "undefined"); - } - } +var testResult = false; - Object.defineProperty(Array.prototype, "2", { - set: function () { }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (typeof prevVal === "undefined"); + } +} - var arr = [0, 1, , ]; +Object.defineProperty(Array.prototype, "2", { + set: function() {}, + configurable: true +}); - arr.reduceRight(callbackfn); +var arr = [0, 1, , ]; + +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-25.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-25.js index ed00735cb01e18cea2c8469d0b2722d26def2a08..a00761e4bc4edd4d9c8664845e07a17ac4a2f332 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-25.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-25.js @@ -10,17 +10,18 @@ description: > is less than number of parameters) ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 0) { - testResult = (prevVal === 1); - } - } +var testResult = false; - var func = function (a, b, c) { - Array.prototype.reduceRight.call(arguments, callbackfn); - }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 0) { + testResult = (prevVal === 1); + } +} - func(0, 1); +var func = function(a, b, c) { + Array.prototype.reduceRight.call(arguments, callbackfn); +}; + +func(0, 1); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-26.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-26.js index fa3c52c43aaf32e591eab92532d852f98b748d56..5024b8159fe3c47f3981453e33c57eb036b902f9 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-26.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-26.js @@ -10,17 +10,18 @@ description: > equals number of parameters) ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 2); - } - } +var testResult = false; - var func = function (a, b, c) { - Array.prototype.reduceRight.call(arguments, callbackfn); - }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 2); + } +} - func(0, 1, 2); +var func = function(a, b, c) { + Array.prototype.reduceRight.call(arguments, callbackfn); +}; + +func(0, 1, 2); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-27.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-27.js index c6cfe25cde0913a1fd343f9f751d50500282fd79..4b716884f96380e4a5a92149ee3579b23d68e566 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-27.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-27.js @@ -10,17 +10,18 @@ description: > is greater than number of parameters) ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 2) { - testResult = (prevVal === 3); - } - } +var testResult = false; - var func = function (a, b, c) { - Array.prototype.reduceRight.call(arguments, callbackfn); - }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 2) { + testResult = (prevVal === 3); + } +} - func(0, 1, 2, 3); +var func = function(a, b, c) { + Array.prototype.reduceRight.call(arguments, callbackfn); +}; + +func(0, 1, 2, 3); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-28.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-28.js index 892cfdc56cc86677a54ef287421109ffe4c12db1..296ac59cd48edb6a2c33e33fe407f00be2a52bbc 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-28.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-28.js @@ -9,15 +9,16 @@ description: > implements its own property get method ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === "2"); - } - } +var testResult = false; - var str = new String("012"); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === "2"); + } +} - Array.prototype.reduceRight.call(str, callbackfn); +var str = new String("012"); + +Array.prototype.reduceRight.call(str, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-29.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-29.js index acb274e17550025abdb27340b52390fc762bcf98..e7c88ee8fcdb33fa645ff80f1d3240a76297bf90 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-29.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-29.js @@ -9,21 +9,22 @@ description: > implements its own property get method ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 2); - } - } +var testResult = false; - var obj = function (a, b, c) { - return a + b + c; - }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 2); + } +} - obj[0] = 0; - obj[1] = 1; - obj[2] = 2; +var obj = function(a, b, c) { + return a + b + c; +}; - Array.prototype.reduceRight.call(obj, callbackfn); +obj[0] = 0; +obj[1] = 1; +obj[2] = 2; + +Array.prototype.reduceRight.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-3.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-3.js index 062f12ba1c81765c46add0fa6c319859d4b8e2ee..5dae8cadef66a28a1fa6ae5b837fc983eff2a8e7 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-3.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-3.js @@ -10,22 +10,28 @@ description: > Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === "20"); - } - } +var testResult = false; - var proto = { 0: 0, 1: 1, 2: 2, length: 2 }; - var Con = function () { }; - Con.prototype = proto; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === "20"); + } +} - var child = new Con(); - child[1] = "10"; - child[2] = "20"; - child.length = 3; +var proto = { + 0: 0, + 1: 1, + 2: 2, + length: 2 +}; +var Con = function() {}; +Con.prototype = proto; - Array.prototype.reduceRight.call(child, callbackfn); +var child = new Con(); +child[1] = "10"; +child[2] = "20"; +child.length = 3; + +Array.prototype.reduceRight.call(child, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-30.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-30.js index bfebf8515e044fd2f0e7dad945247a27d6a81197..dd07c30e290c2418cb32bd67e4ca0e238d9cd6f7 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-30.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-30.js @@ -9,35 +9,36 @@ description: > iteration is observed in subsequent iterations on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1 && prevVal === 2); - } - } - - var arr = [0]; - var preIterVisible = false; - - Object.defineProperty(arr, "1", { - get: function () { - if (preIterVisible) { - return 1; - } else { - return "20"; - } - }, - configurable: true - }); - - Object.defineProperty(arr, "2", { - get: function () { - preIterVisible = true; - return 2; - }, - configurable: true - }); - - arr.reduceRight(callbackfn); +var testResult = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1 && prevVal === 2); + } +} + +var arr = [0]; +var preIterVisible = false; + +Object.defineProperty(arr, "1", { + get: function() { + if (preIterVisible) { + return 1; + } else { + return "20"; + } + }, + configurable: true +}); + +Object.defineProperty(arr, "2", { + get: function() { + preIterVisible = true; + return 2; + }, + configurable: true +}); + +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-31.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-31.js index 8d8168a560f91c42f304e6d51ad336b4c33fdcde..adc024dca684f6c65820738740897089afa70884 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-31.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-31.js @@ -9,35 +9,39 @@ description: > iteration is observed subsequetly on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 2 && curVal === 1); - } - } - - var obj = { 0: 0, length: 3 }; - var preIterVisible = false; - - Object.defineProperty(obj, "1", { - get: function () { - if (preIterVisible) { - return 1; - } else { - return "20"; - } - }, - configurable: true - }); - - Object.defineProperty(obj, "2", { - get: function () { - preIterVisible = true; - return 2; - }, - configurable: true - }); - - Array.prototype.reduceRight.call(obj, callbackfn); +var testResult = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 2 && curVal === 1); + } +} + +var obj = { + 0: 0, + length: 3 +}; +var preIterVisible = false; + +Object.defineProperty(obj, "1", { + get: function() { + if (preIterVisible) { + return 1; + } else { + return "20"; + } + }, + configurable: true +}); + +Object.defineProperty(obj, "2", { + get: function() { + preIterVisible = true; + return 2; + }, + configurable: true +}); + +Array.prototype.reduceRight.call(obj, callbackfn); assert(testResult, 'testResult !== true'); 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 49146cd496facdae76f05d97b76ca3cd72afc40b..e4056e11fc626e89b9b2ad0c975cdc44aa88de0c 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 @@ -9,21 +9,26 @@ description: > iteration on an Array-like object ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx <= 1) { - accessed = true; - } - } +var accessed = false; - var obj = { 0: 0, 1: 1, length: 3 }; - Object.defineProperty(obj, "2", { - get: function () { - throw new RangeError("unhandle exception happened in getter"); - }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx <= 1) { + accessed = true; + } +} + +var obj = { + 0: 0, + 1: 1, + length: 3 +}; +Object.defineProperty(obj, "2", { + get: function() { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true +}); assert.throws(RangeError, function() { - Array.prototype.reduceRight.call(obj, callbackfn); + Array.prototype.reduceRight.call(obj, callbackfn); }); 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 53f974e22d1b78588325e6b879bebf02add20f39..b770c5cccd0429fcdb9b083c4d23af1abceb8a50 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 @@ -9,22 +9,23 @@ description: > iteration on an Array ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx <= 1) { - accessed = true; - } - } +var accessed = false; - var arr = [0, 1]; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx <= 1) { + accessed = true; + } +} - Object.defineProperty(arr, "2", { - get: function () { - throw new RangeError("unhandle exception happened in getter"); - }, - configurable: true - }); +var arr = [0, 1]; + +Object.defineProperty(arr, "2", { + get: function() { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true +}); assert.throws(RangeError, function() { - arr.reduceRight(callbackfn); + arr.reduceRight(callbackfn); }); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-4.js index 2bf4cc00dc5a432fcd7090fbe39761f432a85fba..9363a9c3ba555350373ba07026c863ec06a6c15a 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-4.js @@ -9,14 +9,15 @@ description: > property that overrides an inherited data property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 2); - } - } +var testResult = false; - Array.prototype[2] = "11"; - [0, 1, 2].reduceRight(callbackfn); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 2); + } +} + +Array.prototype[2] = "11"; +[0, 1, 2].reduceRight(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-5.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-5.js index c08e592485078a9eb2a055e24483b9f5ff736aab..1eda02b4625656a8592c3c1a499c5898611173b8 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-5.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-5.js @@ -10,34 +10,35 @@ description: > Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === "20"); - } - } - - var proto = {}; - - Object.defineProperty(proto, "2", { - get: function () { - return 11; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 3; - child[0] = "0"; - child[1] = "1"; - Object.defineProperty(proto, "2", { - value: "20", - configurable: true - }); - - Array.prototype.reduceRight.call(child, callbackfn); +var testResult = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === "20"); + } +} + +var proto = {}; + +Object.defineProperty(proto, "2", { + get: function() { + return 11; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 3; +child[0] = "0"; +child[1] = "1"; +Object.defineProperty(proto, "2", { + value: "20", + configurable: true +}); + +Array.prototype.reduceRight.call(child, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-6.js index 6bd5ab5eb9ebc2275bb2c4a52130e36b97251fb9..6f8f1eec3caf545284972778fc0cd3d84c803715 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-6.js @@ -9,19 +9,20 @@ description: > property that overrides an inherited accessor property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 2); - } - } +var testResult = false; - Object.defineProperty(Array.prototype, "2", { - get: function () { - return "2"; - }, - configurable: true - }); - [0, 1, 2].reduceRight(callbackfn); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 2); + } +} + +Object.defineProperty(Array.prototype, "2", { + get: function() { + return "2"; + }, + configurable: true +}); +[0, 1, 2].reduceRight(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-7.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-7.js index a955557ecbd21d50bfbafba7cc683de96574f506..55a3d6dbda870d88999521e3996b50a23f34759b 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-7.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-7.js @@ -9,19 +9,25 @@ description: > data property on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 2); - } - } +var testResult = false; - var proto = { 0: 0, 1: 1, 2: 2, length: 3 }; - var Con = function () { }; - Con.prototype = proto; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 2); + } +} - var child = new Con(); +var proto = { + 0: 0, + 1: 1, + 2: 2, + length: 3 +}; +var Con = function() {}; +Con.prototype = proto; - Array.prototype.reduceRight.call(child, callbackfn); +var child = new Con(); + +Array.prototype.reduceRight.call(child, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-8.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-8.js index 983566a9cced268423fcaecadab3f1c2ec611e31..d7174183c75719e15619bb9605294213b263bdf4 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-8.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-8.js @@ -9,16 +9,17 @@ description: > data property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 2); - } - } +var testResult = false; - Array.prototype[0] = 0; - Array.prototype[1] = 1; - Array.prototype[2] = 2; - [, , ,].reduceRight(callbackfn); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 2); + } +} + +Array.prototype[0] = 0; +Array.prototype[1] = 1; +Array.prototype[2] = 2; +[, , , ].reduceRight(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-9.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-9.js index e2f7da4b6fb9c9ac2f7d23409cf88b0268c90fb9..648e9485b52e5026d298e7af1d1dd1838ad771f8 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-9.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-9.js @@ -9,21 +9,26 @@ description: > accessor property on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 2); - } - } +var testResult = false; - var obj = { 0: 0, 1: 1, length: 3 }; - Object.defineProperty(obj, "2", { - get: function () { - return 2; - }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 2); + } +} - Array.prototype.reduceRight.call(obj, callbackfn); +var obj = { + 0: 0, + 1: 1, + length: 3 +}; +Object.defineProperty(obj, "2", { + get: function() { + return 2; + }, + configurable: true +}); + +Array.prototype.reduceRight.call(obj, callbackfn); assert(testResult, 'testResult !== true'); 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 9c1d91d3ca07f423ddeb88dc767871074feb2282..8c59328e35effbe3682cf5030eaae4684cb92eb2 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 @@ -9,11 +9,10 @@ description: > and initialValue is not present ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - } +function callbackfn(prevVal, curVal, idx, obj) +{} - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.reduceRight(callbackfn); + arr.reduceRight(callbackfn); }); 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 05271d67450a49fdfefacb5532d1efd0cb87b6dd..3153f84f562bacc4a3f364ecd637cc72e551537e 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 @@ -10,13 +10,12 @@ description: > initialValue is not present ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - } +function callbackfn(prevVal, curVal, idx, obj) +{} - var arr = new Array(10); - arr[9] = 1; - arr.length = 5; +var arr = new Array(10); +arr[9] = 1; +arr.length = 5; assert.throws(TypeError, function() { - arr.reduceRight(callbackfn); + arr.reduceRight(callbackfn); }); 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 e47a755d52a48dd267fccc9d4145ccfd74b6319c..06d5460c7f041510354cadc3e3c94c0039bc8ce8 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 @@ -9,16 +9,15 @@ description: > assigned values are deleted and initialValue is not present ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - } +function callbackfn(prevVal, curVal, idx, obj) +{} - var arr = [1,2,3,4,5]; - delete arr[0]; - delete arr[1]; - delete arr[2]; - delete arr[3]; - delete arr[4]; +var arr = [1, 2, 3, 4, 5]; +delete arr[0]; +delete arr[1]; +delete arr[2]; +delete arr[3]; +delete arr[4]; assert.throws(TypeError, function() { - arr.reduceRight(callbackfn); + arr.reduceRight(callbackfn); }); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-4.js index 18296c2bf4ab371c049e84daec6a01499dd9dfe5..4dc2980963b118b9f1bd4a06465a9f891d99d468 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-4.js @@ -9,11 +9,11 @@ description: > own properties but prototype contains a single property ---*/ - var arr = [, , , ]; +var arr = [, , , ]; - try { - Array.prototype[1] = "prototype"; - arr.reduceRight(function () { }); - } finally { - delete Array.prototype[1]; - } +try { + Array.prototype[1] = "prototype"; + arr.reduceRight(function() {}); +} finally { + delete Array.prototype[1]; +} 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 b5dd24963eedfa3366b107601b58db46cc9826df..224ff36c307eea18a05cbd34214198c375900b2d 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 @@ -9,18 +9,18 @@ description: > visible when an exception occurs ---*/ - var obj = { }; +var obj = {}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - accessed = true; - return 2; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + accessed = true; + return 2; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.reduceRight.call(obj, function () { }); + Array.prototype.reduceRight.call(obj, function() {}); }); 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 476886a76b7679d10d17ada1413caa67527eaf20..3dab92c10bc57d9a0e00a4482497e4db94555b84 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 @@ -9,22 +9,22 @@ description: > visible when an exception occurs ---*/ - var obj = {}; +var obj = {}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - accessed = true; - return "2"; - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + accessed = true; + return "2"; + } + }; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.reduceRight.call(obj, function () { }); + Array.prototype.reduceRight.call(obj, function() {}); }); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-7.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-7.js index 2fabc8fd6d0df4da28ce93c251df3c8384af6a3c..fade921f9860a2accef65344c209dcd333ef1223 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-7.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-7.js @@ -9,15 +9,15 @@ description: > exception was thrown by step 2 ---*/ - var obj = {}; +var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - throw new Test262Error(); - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + throw new Test262Error(); + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.reduceRight.call(obj, function () { }); + Array.prototype.reduceRight.call(obj, function() {}); }); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-8.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-8.js index 52c2ed7a6a7891b569dfd43c3456d07d84890714..d0e875976af39efd24a2e33e51bd45d9691eac99 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-8.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-8.js @@ -9,19 +9,19 @@ description: > exception was thrown by step 3 ---*/ - var obj = {}; +var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - throw new Test262Error(); - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + throw new Test262Error(); + } + }; + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.reduceRight.call(obj, function () { }); + Array.prototype.reduceRight.call(obj, function() {}); }); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-1.js index 8132b414c5de7d01ec11f4a675fb3444c60198d7..ef9f2679140c1fc0542a93ff688d48aae00d9236 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-1.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-1.js @@ -11,12 +11,12 @@ description: > length ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - arr[5] = 6; - arr[2] = 3; - return prevVal + curVal; - } +function callbackfn(prevVal, curVal, idx, obj) { + arr[5] = 6; + arr[2] = 3; + return prevVal + curVal; +} - var arr = ['1', 2, , 4, '5']; +var arr = ['1', 2, , 4, '5']; assert.sameValue(arr.reduceRight(callbackfn), "54321", 'arr.reduceRight(callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-2.js index 05fa751f08ed659f7b0df40e092cd06b83ade173..4fa783dfe046146b8ed052e02d8113119f0879e9 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-2.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-2.js @@ -9,13 +9,13 @@ description: > array after it is called ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - arr[3] = -2; - arr[0] = -1; - return prevVal + curVal; - } +function callbackfn(prevVal, curVal, idx, obj) +{ + arr[3] = -2; + arr[0] = -1; + return prevVal + curVal; +} - var arr = [1,2,3,4,5]; +var arr = [1, 2, 3, 4, 5]; assert.sameValue(arr.reduceRight(callbackfn), 13, 'arr.reduceRight(callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-3.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-3.js index eb48426ea4eb3d5f84c3722c39beae6e77166a19..0455ef32acfebf5a0ec3bb81b39e5733a59d2dbf 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-3.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-3.js @@ -9,14 +9,14 @@ description: > elements in array after the call ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - delete arr[1]; - delete arr[4]; - return prevVal + curVal; - } +function callbackfn(prevVal, curVal, idx, obj) +{ + delete arr[1]; + delete arr[4]; + return prevVal + curVal; +} - var arr = ['1',2,3,4,5]; +var arr = ['1', 2, 3, 4, 5]; // two elements deleted assert.sameValue(arr.reduceRight(callbackfn), "121", 'arr.reduceRight(callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-4.js index 0c00cf9c9ee5238b4d672c6d95f43ce588458ca6..d3fa9884c3ab65006a12603068d7cc00cb6f2b37 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-4.js @@ -9,12 +9,12 @@ description: > elements when Array.length is decreased ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - arr.length = 2; - return prevVal + curVal; - } +function callbackfn(prevVal, curVal, idx, obj) +{ + arr.length = 2; + return prevVal + curVal; +} - var arr = [1,2,3,4,5]; +var arr = [1, 2, 3, 4, 5]; assert.sameValue(arr.reduceRight(callbackfn), 12, 'arr.reduceRight(callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-5.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-5.js index 8cbf9edee983ab72fbf990f667d6e4a23cc224c7..a11242c5d0f7536db3101abe4291e1ad09a6625f 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-5.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-5.js @@ -9,14 +9,15 @@ description: > one element ---*/ - var callCnt = 0; - function callbackfn(prevVal, curVal, idx, obj) - { - callCnt++; - return 2; - } +var callCnt = 0; - var arr = [1]; +function callbackfn(prevVal, curVal, idx, obj) +{ + callCnt++; + return 2; +} + +var arr = [1]; assert.sameValue(arr.reduceRight(callbackfn), 1, 'arr.reduceRight(callbackfn)'); assert.sameValue(callCnt, 0, 'callCnt'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-6.js index ca9493b319b4a88c49b48bd4b8fab59b97131ee7..24f6586901b9a671bdcff23f888b73e616aa27e2 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-6.js @@ -9,16 +9,16 @@ description: > the call when same index is also present in prototype ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - delete arr[1]; - delete arr[2]; - return prevVal + curVal; - } - Array.prototype[2] = 6; - var arr = ['1',2,3,4,5]; - var res = arr.reduceRight(callbackfn); - delete Array.prototype[2]; +function callbackfn(prevVal, curVal, idx, obj) +{ + delete arr[1]; + delete arr[2]; + return prevVal + curVal; +} +Array.prototype[2] = 6; +var arr = ['1', 2, 3, 4, 5]; +var res = arr.reduceRight(callbackfn); +delete Array.prototype[2]; //one element deleted assert.sameValue(res, "151", 'res'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-7.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-7.js index 6adeffef53f9424c874ad769f05c2aeb4cecf84e..b76b74b651f13c192b478932f0ee265548b9c206 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-7.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-7.js @@ -9,13 +9,13 @@ description: > deleted during the call ---*/ - function callbackfn(prevVal, curVal, idx, obj) { - delete o.arr; - return prevVal + curVal; - } +function callbackfn(prevVal, curVal, idx, obj) { + delete o.arr; + return prevVal + curVal; +} - var o = new Object(); - o.arr = ['1', 2, 3, 4, 5]; +var o = new Object(); +o.arr = ['1', 2, 3, 4, 5]; assert.sameValue(o.arr.reduceRight(callbackfn), "141", 'o.arr.reduceRight(callbackfn)'); assert.sameValue(o.hasOwnProperty("arr"), false, 'o.hasOwnProperty("arr")'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-8.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-8.js index 9968f8929f24b558f3f85faad0e83916e946f056..a2ef4d7fec602d67a1c8dd1be9d6b7e8afc0d779 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-8.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-8.js @@ -9,21 +9,24 @@ description: > is 0 ---*/ - var accessed = false; - function callbackfn() { - accessed = true; - } +var accessed = false; - var obj = { length: 0 }; +function callbackfn() { + accessed = true; +} - Object.defineProperty(obj, "5", { - get: function () { - accessed = true; - return 10; - }, - configurable: true - }); +var obj = { + length: 0 +}; - Array.prototype.reduceRight.call(obj, function () { }, "initialValue"); +Object.defineProperty(obj, "5", { + get: function() { + accessed = true; + return 10; + }, + configurable: true +}); + +Array.prototype.reduceRight.call(obj, function() {}, "initialValue"); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-9.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-9.js index f5fc22ab3b99305544c0fa24d7c74301e1bf1645..ac47f378afd259f2823e393aa9f6c76cdb5c0532 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-9.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-9.js @@ -9,19 +9,20 @@ description: > number of iterations ---*/ - var called = 0; - function callbackfn(preVal, val, idx, obj) { - called++; - } +var called = 0; - var arr = [0, 1, 2, 3]; - Object.defineProperty(arr, "4", { - get: function () { - arr.length = 2; - }, - configurable: true - }); +function callbackfn(preVal, val, idx, obj) { + called++; +} - arr.reduceRight(callbackfn, "initialValue"); +var arr = [0, 1, 2, 3]; +Object.defineProperty(arr, "4", { + get: function() { + arr.length = 2; + }, + configurable: true +}); + +arr.reduceRight(callbackfn, "initialValue"); assert.sameValue(called, 3, 'called'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-1.js index 9277ef37d0bdfe5ced1f969d65b66b76b71ff8d4..b7336d05e72ac792b50cebe19aae6587d7e152be 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-1.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-1.js @@ -9,11 +9,10 @@ description: > empty and initialValue is not present ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - } +function callbackfn(prevVal, curVal, idx, obj) +{} - var arr = new Array(10); +var arr = new Array(10); -assert.sameValue(arr.reduceRight(callbackfn,5), 5, 'arr.reduceRight(callbackfn,5)'); +assert.sameValue(arr.reduceRight(callbackfn, 5), 5, 'arr.reduceRight(callbackfn,5)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-10.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-10.js index a92bf8dcc636cb18a1587ac2083b319f43713ad7..1dd6fb9fe716df8bd44aa5aae4f70a9d0d3bc3e8 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-10.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-10.js @@ -10,28 +10,31 @@ description: > Array-like Object ---*/ - var accessed = false; - var testResult = true; +var accessed = false; +var testResult = true; - function callbackfn(preVal, val, idx, obj) { - accessed = true; - if (idx === 3) { - testResult = false; - } - } +function callbackfn(preVal, val, idx, obj) { + accessed = true; + if (idx === 3) { + testResult = false; + } +} - var obj = { 2: 2, length: 20 }; +var obj = { + 2: 2, + length: 20 +}; - Object.defineProperty(obj, "5", { - get: function () { - delete Object.prototype[3]; - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "5", { + get: function() { + delete Object.prototype[3]; + return 0; + }, + configurable: true +}); - Object.prototype[3] = 1; - Array.prototype.reduceRight.call(obj, callbackfn); +Object.prototype[3] = 1; +Array.prototype.reduceRight.call(obj, callbackfn); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-11.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-11.js index bd1bcb4f311526640318c316b90049c5245dff26..e364fbbb7897a31fe1eadfb015725972e0b17114 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-11.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-11.js @@ -9,27 +9,27 @@ description: > step 8 causes deleted index property not to be visited on an Array ---*/ - var accessed = false; - var testResult = true; +var accessed = false; +var testResult = true; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - if (idx === 1) { - testResult = false; - } - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + if (idx === 1) { + testResult = false; + } +} - var arr = [0, , , ]; - Object.defineProperty(arr, "3", { - get: function () { - delete Array.prototype[1]; - return 0; - }, - configurable: true - }); +var arr = [0, , , ]; +Object.defineProperty(arr, "3", { + get: function() { + delete Array.prototype[1]; + return 0; + }, + configurable: true +}); - Array.prototype[1] = 1; - arr.reduceRight(callbackfn); +Array.prototype[1] = 1; +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-12.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-12.js index 9d1eca6456a8e5eb66f3b3b064450a0d2f3dbdfc..a6aed7624d0c6a780946573259b9afdbfa18a6cb 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-12.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-12.js @@ -10,25 +10,29 @@ description: > on an Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1 && curVal === 1) { - testResult = true; - } - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1 && curVal === 1) { + testResult = true; + } +} - var obj = { 0: 0, 1: 111, length: 10 }; +var obj = { + 0: 0, + 1: 111, + length: 10 +}; - Object.defineProperty(obj, "4", { - get: function () { - delete obj[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "4", { + get: function() { + delete obj[1]; + return 0; + }, + configurable: true +}); - Object.prototype[1] = 1; - Array.prototype.reduceRight.call(obj, callbackfn); +Object.prototype[1] = 1; +Array.prototype.reduceRight.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-13.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-13.js index fe522f07158f000a90da32aa88521db6919ec83a..470c9420aec74fe97dfb48f88a60b368f43362d2 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-13.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-13.js @@ -10,24 +10,24 @@ description: > on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1 && curVal === 1) { - testResult = true; - } - } - var arr = [0, 111]; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1 && curVal === 1) { + testResult = true; + } +} +var arr = [0, 111]; - Object.defineProperty(arr, "2", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "2", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); - Array.prototype[1] = 1; - arr.reduceRight(callbackfn); +Array.prototype[1] = 1; +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-14.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-14.js index 16924c99cb57a21675ae434c706d81405e3d5241..8307a9768d01544b0032106488657a2496c24659 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-14.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-14.js @@ -9,27 +9,27 @@ description: > causes deleted index property not to be visited ---*/ - var accessed = false; - var testResult = true; +var accessed = false; +var testResult = true; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - if (idx === 2) { - testResult = false; - } - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + if (idx === 2) { + testResult = false; + } +} - var arr = [0, 1, 2, 3]; +var arr = [0, 1, 2, 3]; - Object.defineProperty(arr, "3", { - get: function () { - arr.length = 2; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "3", { + get: function() { + arr.length = 2; + return 0; + }, + configurable: true +}); - arr.reduceRight(callbackfn); +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-15.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-15.js index 456fc605b2735501cb4467cb0ec5982d0cff8128..97695a950dbe5339c4c8d4305e99f815cf4fc458 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-15.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-15.js @@ -10,30 +10,30 @@ description: > visited ---*/ - var testResult = false; +var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 2 && curVal === "prototype") { - testResult = true; - } - } - var arr = [0, 1, 2, 3]; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 2 && curVal === "prototype") { + testResult = true; + } +} +var arr = [0, 1, 2, 3]; - Object.defineProperty(Array.prototype, "2", { - get: function () { - return "prototype"; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "2", { + get: function() { + return "prototype"; + }, + configurable: true +}); - Object.defineProperty(arr, "3", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); +Object.defineProperty(arr, "3", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); - arr.reduceRight(callbackfn); +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-16.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-16.js index f23e5ecf04bfb2cd46591d5b786dd58ebe73096f..71def64c720835267c6343ed1b5f000e35d42d8d 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-16.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-16.js @@ -10,31 +10,31 @@ description: > flags: [noStrict] ---*/ - var testResult = false; - - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 2 && curVal === "unconfigurable") { - testResult = true; - } - } - - var arr = [0, 1, 2, 3]; - - Object.defineProperty(arr, "2", { - get: function () { - return "unconfigurable"; - }, - configurable: false - }); - - Object.defineProperty(arr, "3", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); - - arr.reduceRight(callbackfn); +var testResult = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 2 && curVal === "unconfigurable") { + testResult = true; + } +} + +var arr = [0, 1, 2, 3]; + +Object.defineProperty(arr, "2", { + get: function() { + return "unconfigurable"; + }, + configurable: false +}); + +Object.defineProperty(arr, "3", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); + +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-17.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-17.js index d74fd82f5886a40d4b506425b4b06e7ac43c3df0..d21d758ac4ad4d3430355c2fa54b06e1f90f8f57 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-17.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-17.js @@ -9,29 +9,31 @@ description: > visited on an Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 0 && curVal === 0) { - testResult = true; - } - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 0 && curVal === 0) { + testResult = true; + } +} - var obj = { length: 2 }; +var obj = { + length: 2 +}; - Object.defineProperty(obj, "1", { - get: function () { - Object.defineProperty(obj, "0", { - get: function () { - return 0; - }, - configurable: true - }); - return 1; - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + Object.defineProperty(obj, "0", { + get: function() { + return 0; + }, + configurable: true + }); + return 1; + }, + configurable: true +}); - Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); +Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-18.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-18.js index d6ab2aac613db36b3f3f11791afec9c5e722c60b..89ed61d4e26661b6105e7d5fdf772fd8e6c2765f 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-18.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-18.js @@ -9,29 +9,29 @@ description: > visited on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1 && curVal === 1) { - testResult = true; - } - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1 && curVal === 1) { + testResult = true; + } +} - var arr = [0, , 2]; +var arr = [0, , 2]; - Object.defineProperty(arr, "2", { - get: function () { - Object.defineProperty(arr, "1", { - get: function () { - return 1; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "2", { + get: function() { + Object.defineProperty(arr, "1", { + get: function() { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - arr.reduceRight(callbackfn, "initialValue"); +arr.reduceRight(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-19.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-19.js index 714b8ecd34b9d3c809a41d209a27f3165dce522f..e31e3f370ba18f5da051bea9d570da549146725c 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-19.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-19.js @@ -9,29 +9,31 @@ description: > visited on an Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1 && curVal === 6.99) { - testResult = true; - } - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1 && curVal === 6.99) { + testResult = true; + } +} - var obj = { length: 6 }; +var obj = { + length: 6 +}; - Object.defineProperty(obj, "2", { - get: function () { - Object.defineProperty(Object.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "2", { + get: function() { + Object.defineProperty(Object.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); +Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-2.js index 423ae546ab0a6aa2aa50ec54c4e8bf97ccf9af49..11d7140d9c5deacde51e08b6c1c15c57951052b9 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-2.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-2.js @@ -9,24 +9,24 @@ description: > visible here ---*/ - var testResult = false; +var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 2 && curVal === "2") { - testResult = true; - } - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 2 && curVal === "2") { + testResult = true; + } +} - var obj = {}; +var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - obj[2] = "2"; - return 3; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + obj[2] = "2"; + return 3; + }, + configurable: true +}); - Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); +Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-20.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-20.js index b993b17f58b458f2fdbb1b9bcb0f9f1248c8d059..47586d76f13b1cee5611485ebd1e9028b5ad06d1 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-20.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-20.js @@ -9,29 +9,29 @@ description: > visited on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1 && curVal === 6.99) { - testResult = true; - } - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1 && curVal === 6.99) { + testResult = true; + } +} - var arr = [0, , 2]; +var arr = [0, , 2]; - Object.defineProperty(arr, "2", { - get: function () { - Object.defineProperty(Array.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "2", { + get: function() { + Object.defineProperty(Array.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - arr.reduceRight(callbackfn, "initialValue"); +arr.reduceRight(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-21.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-21.js index 0b5b53ccfbc14a496b0b68c735dc188f08f2bd60..13f3eeaa688905362f587bbc9ebb124ae2c5f578 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-21.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-21.js @@ -9,34 +9,37 @@ description: > index property not to be visited on an Array-like object ---*/ - var accessed = false; - var testResult = true; - - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - if (idx === 1) { - testResult = false; - } - } - - var obj = { 0: 10, length: 10 }; - - Object.defineProperty(obj, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - - Object.defineProperty(obj, "5", { - get: function () { - delete obj[1]; - return 0; - }, - configurable: true - }); - - Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); +var accessed = false; +var testResult = true; + +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + if (idx === 1) { + testResult = false; + } +} + +var obj = { + 0: 10, + length: 10 +}; + +Object.defineProperty(obj, "1", { + get: function() { + return 6.99; + }, + configurable: true +}); + +Object.defineProperty(obj, "5", { + get: function() { + delete obj[1]; + return 0; + }, + configurable: true +}); + +Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-22.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-22.js index d0bffcff62c4b3de6de36d842aaeef408f54798c..8c57a1bd23a2d93473e7a5b4293411862429bc55 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-22.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-22.js @@ -9,34 +9,34 @@ description: > index property not to be visited on an Array ---*/ - var accessed = false; - var testResult = true; - - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - if (idx === 1) { - testResult = false; - } - } - - var arr = [1, 2, 4]; - - Object.defineProperty(arr, "1", { - get: function () { - return "6.99"; - }, - configurable: true - }); - - Object.defineProperty(arr, "2", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); - - arr.reduceRight(callbackfn, "initialValue"); +var accessed = false; +var testResult = true; + +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + if (idx === 1) { + testResult = false; + } +} + +var arr = [1, 2, 4]; + +Object.defineProperty(arr, "1", { + get: function() { + return "6.99"; + }, + configurable: true +}); + +Object.defineProperty(arr, "2", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); + +arr.reduceRight(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-23.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-23.js index 611310635a1ed52d2c5c68c7773f78f21a3d4fa0..52046431c8ebb5549250d9484cc9f5ce5610ba94 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-23.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-23.js @@ -10,28 +10,31 @@ description: > Object ---*/ - var accessed = false; - var testResult = true; +var accessed = false; +var testResult = true; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - if (idx === 3) { - testResult = false; - } - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + if (idx === 3) { + testResult = false; + } +} - var obj = { 2: 2, length: 20 }; +var obj = { + 2: 2, + length: 20 +}; - Object.defineProperty(obj, "5", { - get: function () { - delete Object.prototype[3]; - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "5", { + get: function() { + delete Object.prototype[3]; + return 0; + }, + configurable: true +}); - Object.prototype[3] = 1; - Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); +Object.prototype[3] = 1; +Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-24.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-24.js index 8f2c455206d74046d93228de64551973c1ea406e..9248519f9746aa3cfb339dd7d90bf79c48696660 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-24.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-24.js @@ -9,27 +9,27 @@ description: > causes deleted index property not to be visited on an Array ---*/ - var accessed = false; - var testResult = true; +var accessed = false; +var testResult = true; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - if (idx === 1) { - testResult = false; - } - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + if (idx === 1) { + testResult = false; + } +} - var arr = [0, , , ]; - Object.defineProperty(arr, "3", { - get: function () { - delete Array.prototype[1]; - return 0; - }, - configurable: true - }); +var arr = [0, , , ]; +Object.defineProperty(arr, "3", { + get: function() { + delete Array.prototype[1]; + return 0; + }, + configurable: true +}); - Array.prototype[1] = 1; - arr.reduceRight(callbackfn, "initialValue"); +Array.prototype[1] = 1; +arr.reduceRight(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-25.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-25.js index 78d46ed7bad7d04d846cdbc4b328492fd6afb480..bbfac73480e8c22af1fd96c71552fd28c4b01fa7 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-25.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-25.js @@ -10,25 +10,30 @@ description: > Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1 && curVal === 1) { - testResult = true; - } - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1 && curVal === 1) { + testResult = true; + } +} - var obj = { 0: 0, 1: 111, 4: 10, length: 10 }; +var obj = { + 0: 0, + 1: 111, + 4: 10, + length: 10 +}; - Object.defineProperty(obj, "4", { - get: function () { - delete obj[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "4", { + get: function() { + delete obj[1]; + return 0; + }, + configurable: true +}); - Object.prototype[1] = 1; - Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); +Object.prototype[1] = 1; +Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-26.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-26.js index 7b0e441b3363c24803764a003fc368375ed0a5c9..6b7362927e2c34ec76f8f1d3910c7bd96f3d7f92 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-26.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-26.js @@ -9,24 +9,24 @@ description: > property causes prototype index property to be visited on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1 && curVal === 1) { - testResult = true; - } - } - var arr = [0, 111]; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1 && curVal === 1) { + testResult = true; + } +} +var arr = [0, 111]; - Object.defineProperty(arr, "2", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "2", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); - Array.prototype[1] = 1; - arr.reduceRight(callbackfn, "initialValue"); +Array.prototype[1] = 1; +arr.reduceRight(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-27.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-27.js index 45aa57a168fc2bc3fc19dc7b5cbaefe640c665f2..01b7f09b9e650584b71398584c489870d8a2b5bd 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-27.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-27.js @@ -9,27 +9,27 @@ description: > deleted index property not to be visited ---*/ - var accessed = false; - var testResult = true; +var accessed = false; +var testResult = true; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - if (idx === 2) { - testResult = false; - } - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + if (idx === 2) { + testResult = false; + } +} - var arr = [0, 1, 2, 3]; +var arr = [0, 1, 2, 3]; - Object.defineProperty(arr, "3", { - get: function () { - arr.length = 2; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "3", { + get: function() { + arr.length = 2; + return 0; + }, + configurable: true +}); - arr.reduceRight(callbackfn, "initialValue"); +arr.reduceRight(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-28.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-28.js index 31ab610686af042435ab94de10b5f2daa3ea343e..a039a64b7acd68be3f6d30f08c26645b738b5c07 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-28.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-28.js @@ -9,30 +9,30 @@ description: > prototype property causes prototype index property to be visited ---*/ - var testResult = false; +var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 2 && curVal === "prototype") { - testResult = true; - } - } - var arr = [0, 1, 2, 3]; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 2 && curVal === "prototype") { + testResult = true; + } +} +var arr = [0, 1, 2, 3]; - Object.defineProperty(Array.prototype, "2", { - get: function () { - return "prototype"; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "2", { + get: function() { + return "prototype"; + }, + configurable: true +}); - Object.defineProperty(arr, "3", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); +Object.defineProperty(arr, "3", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); - arr.reduceRight(callbackfn, "initialValue"); +arr.reduceRight(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-29.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-29.js index b30c7d0b6d7b700ea053154cdf41e2185b466642..b5cd3bd281137b9fb4c060cfc203619315028665 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-29.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-29.js @@ -10,31 +10,31 @@ description: > flags: [noStrict] ---*/ - var testResult = false; - - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 2 && curVal === "unconfigurable") { - testResult = true; - } - } - - var arr = [0, 1, 2, 3]; - - Object.defineProperty(arr, "2", { - get: function () { - return "unconfigurable"; - }, - configurable: false - }); - - Object.defineProperty(arr, "3", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); - - arr.reduceRight(callbackfn, "initialValue"); +var testResult = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 2 && curVal === "unconfigurable") { + testResult = true; + } +} + +var arr = [0, 1, 2, 3]; + +Object.defineProperty(arr, "2", { + get: function() { + return "unconfigurable"; + }, + configurable: false +}); + +Object.defineProperty(arr, "3", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); + +arr.reduceRight(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-3.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-3.js index 3e26f8b983dd20b109856581094c41b810dc8ee2..c9bf72fcb57612a43be5013045ce9cf8f61277ea 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-3.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-3.js @@ -9,27 +9,30 @@ description: > visible here ---*/ - var accessed = false; - var testResult = true; +var accessed = false; +var testResult = true; - function callbackfn(preVal, curVal, idx, obj) { - accessed = true; - if (idx === 2) { - testResult = false; - } - } +function callbackfn(preVal, curVal, idx, obj) { + accessed = true; + if (idx === 2) { + testResult = false; + } +} - var obj = { 2: "2", 3: 10 }; +var obj = { + 2: "2", + 3: 10 +}; - Object.defineProperty(obj, "length", { - get: function () { - delete obj[2]; - return 5; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + delete obj[2]; + return 5; + }, + configurable: true +}); - Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); +Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); assert(accessed, 'accessed !== true'); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-4.js index e8038a7976ee9496e1636a25778f0e6e20efe3ae..de1e7e50eb0fc2c87c3dc15d38dce7169d9d08ea 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-4.js @@ -9,29 +9,31 @@ description: > step 8 can be visited on an Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(preVal, curVal, idx, obj) { - if (idx === 0 && curVal === 0) { - testResult = true; - } - } +function callbackfn(preVal, curVal, idx, obj) { + if (idx === 0 && curVal === 0) { + testResult = true; + } +} - var obj = { length: 2 }; +var obj = { + length: 2 +}; - Object.defineProperty(obj, "1", { - get: function () { - Object.defineProperty(obj, "0", { - get: function () { - return 0; - }, - configurable: true - }); - return 1; - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + Object.defineProperty(obj, "0", { + get: function() { + return 0; + }, + configurable: true + }); + return 1; + }, + configurable: true +}); - Array.prototype.reduceRight.call(obj, callbackfn); +Array.prototype.reduceRight.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-5.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-5.js index 4c0df9703221e922982a8d0ac476748d71540d47..be881241bc90e6208050bde2eefa3a86226473d8 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-5.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-5.js @@ -9,29 +9,29 @@ description: > step 8 can be visited on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(preVal, curVal, idx, obj) { - if (idx === 1 && curVal === 1) { - testResult = true; - } - } +function callbackfn(preVal, curVal, idx, obj) { + if (idx === 1 && curVal === 1) { + testResult = true; + } +} - var arr = [0, , 2]; +var arr = [0, , 2]; - Object.defineProperty(arr, "2", { - get: function () { - Object.defineProperty(arr, "1", { - get: function () { - return 1; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "2", { + get: function() { + Object.defineProperty(arr, "1", { + get: function() { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - arr.reduceRight(callbackfn); +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-6.js index 7149dad93cdc600ac349d85ab4885f4e60f50011..4c4616663d875e8e6470a5a66e972bd0b1786d28 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-6.js @@ -9,29 +9,31 @@ description: > step 8 visited on an Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(preVal, curVal, idx, obj) { - if (idx === 1 && curVal === 6.99) { - testResult = true; - } - } +function callbackfn(preVal, curVal, idx, obj) { + if (idx === 1 && curVal === 6.99) { + testResult = true; + } +} - var obj = { length: 6 }; +var obj = { + length: 6 +}; - Object.defineProperty(obj, "2", { - get: function () { - Object.defineProperty(Object.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(obj, "2", { + get: function() { + Object.defineProperty(Object.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - Array.prototype.reduceRight.call(obj, callbackfn); +Array.prototype.reduceRight.call(obj, callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-7.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-7.js index b38b4cb50af8702ad388f0b283b4bd1270e9ce1b..1eea9497cbc00520c13b37b407deaf1dbb477345 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-7.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-7.js @@ -9,29 +9,29 @@ description: > step 8 visited on an Array ---*/ - var testResult = false; +var testResult = false; - function callbackfn(preVal, curVal, idx, obj) { - if (idx === 1 && curVal === 6.99) { - testResult = true; - } - } +function callbackfn(preVal, curVal, idx, obj) { + if (idx === 1 && curVal === 6.99) { + testResult = true; + } +} - var arr = [0, , 2]; +var arr = [0, , 2]; - Object.defineProperty(arr, "2", { - get: function () { - Object.defineProperty(Array.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "2", { + get: function() { + Object.defineProperty(Array.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); - arr.reduceRight(callbackfn); +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-8.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-8.js index 6e5c2a567472eb2f1b16af44d5acf01dfc19231f..f71e3926ee04764c23e9609664ef47505c8b48e0 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-8.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-8.js @@ -10,34 +10,37 @@ description: > object ---*/ - var accessed = false; - var testResult = true; - - function callbackfn(preVal, val, idx, obj) { - accessed = true; - if (idx === 1) { - testResult = false; - } - } - - var obj = { 0: 10, length: 10 }; - - Object.defineProperty(obj, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - - Object.defineProperty(obj, "5", { - get: function () { - delete obj[1]; - return 0; - }, - configurable: true - }); - - Array.prototype.reduceRight.call(obj, callbackfn); +var accessed = false; +var testResult = true; + +function callbackfn(preVal, val, idx, obj) { + accessed = true; + if (idx === 1) { + testResult = false; + } +} + +var obj = { + 0: 10, + length: 10 +}; + +Object.defineProperty(obj, "1", { + get: function() { + return 6.99; + }, + configurable: true +}); + +Object.defineProperty(obj, "5", { + get: function() { + delete obj[1]; + return 0; + }, + configurable: true +}); + +Array.prototype.reduceRight.call(obj, callbackfn); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-9.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-9.js index 8cc4656065056052697a15626ffa8c84ed0068eb..215cab2ef59228c95d24d0e46a2db6515665791e 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-9.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-9.js @@ -9,34 +9,34 @@ description: > causes deleted index property not to be visited on an Array ---*/ - var accessed = false; - var testResult = true; - - function callbackfn(preVal, curVal, idx, obj) { - accessed = true; - if (idx === 1) { - testResult = false; - } - } - - var arr = [0]; - - Object.defineProperty(arr, "1", { - get: function () { - return "6.99"; - }, - configurable: true - }); - - Object.defineProperty(arr, "2", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); - - arr.reduceRight(callbackfn); +var accessed = false; +var testResult = true; + +function callbackfn(preVal, curVal, idx, obj) { + accessed = true; + if (idx === 1) { + testResult = false; + } +} + +var arr = [0]; + +Object.defineProperty(arr, "1", { + get: function() { + return "6.99"; + }, + configurable: true +}); + +Object.defineProperty(arr, "2", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); + +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-1.js index fdce8cb0da58ac855b04cee9aa9eba0409e0d3e3..825a40814b0a5f33c9892d995df9275023d6f9f6 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-1.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-1.js @@ -9,15 +9,16 @@ description: > never been assigned values ---*/ - var callCnt = 0; - function callbackfn(prevVal, curVal, idx, obj) - { - callCnt++; - return curVal; - } +var callCnt = 0; - var arr = new Array(10); - arr[0] = arr[1] = undefined; //explicitly assigning a value +function callbackfn(prevVal, curVal, idx, obj) +{ + callCnt++; + return curVal; +} + +var arr = new Array(10); +arr[0] = arr[1] = undefined; //explicitly assigning a value assert.sameValue(arr.reduceRight(callbackfn), undefined, 'arr.reduceRight(callbackfn)'); assert.sameValue(callCnt, 1, 'callCnt'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-1.js index da0debdf946b72bf4885284ea386c25ba598633d..351f363ff015272eaa0b8c896233eb0947376be9 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-1.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-1.js @@ -9,14 +9,20 @@ description: > property on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 0) { - testResult = (curVal === 0); - } - } +var testResult = false; - var obj = { 0: 0, 1: 1, 2: 2, length: 2 }; - Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 0) { + testResult = (curVal === 0); + } +} + +var obj = { + 0: 0, + 1: 1, + 2: 2, + length: 2 +}; +Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-10.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-10.js index d4cf4da3796c47b4839b36e7633d3470d78a4e3c..2c3a2f1e71a3231e3d48ce915c9f074fef8d3b70 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-10.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-10.js @@ -9,22 +9,23 @@ description: > accessor property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; - var arr = [0, , 2]; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} - Object.defineProperty(arr, "1", { - get: function () { - return 1; - }, - configurable: true - }); +var arr = [0, , 2]; - arr.reduceRight(callbackfn, "initialValue"); +Object.defineProperty(arr, "1", { + get: function() { + return 1; + }, + configurable: true +}); + +arr.reduceRight(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-11.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-11.js index 1cbecd5edd63de2a7eff846072efdf915e35ac83..8d72dd51d520c75dc6b26b9268b3f3eef9e50a56 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-11.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-11.js @@ -10,28 +10,33 @@ description: > Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === "1"); - } - } - - var proto = { 0: 0, 1: 11, 2: 2 }; - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 3; - - Object.defineProperty(child, "1", { - get: function () { - return "1"; - }, - configurable: true - }); - - Array.prototype.reduceRight.call(child, callbackfn, "initialValue"); +var testResult = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === "1"); + } +} + +var proto = { + 0: 0, + 1: 11, + 2: 2 +}; + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 3; + +Object.defineProperty(child, "1", { + get: function() { + return "1"; + }, + configurable: true +}); + +Array.prototype.reduceRight.call(child, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-12.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-12.js index e7a9e708f591a57be88c355d817f0db33fe8b926..61fb0309ab70266847e8d218e433fcb7908d8ba7 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-12.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-12.js @@ -10,23 +10,24 @@ description: > Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === "1"); - } - } +var testResult = false; - Array.prototype[1] = 11; - var arr = [0, ,2]; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === "1"); + } +} - Object.defineProperty(arr, "1", { - get: function () { - return "1"; - }, - configurable: true - }); +Array.prototype[1] = 11; +var arr = [0, , 2]; - arr.reduceRight(callbackfn, "initialValue"); +Object.defineProperty(arr, "1", { + get: function() { + return "1"; + }, + configurable: true +}); + +arr.reduceRight(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-13.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-13.js index d9cbbc10bd396137ffe0bb57c853d7fabb05a6a5..f66c4bf60c19da2d0e41cff79ee1d126229f2f08 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-13.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-13.js @@ -10,35 +10,39 @@ description: > an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === "1"); - } - } - - var proto = { 0: 0, 2: 2}; - - Object.defineProperty(proto, "1", { - get: function () { - return 11; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 3; - - Object.defineProperty(child, "1", { - get: function () { - return "1"; - }, - configurable: true - }); - - Array.prototype.reduceRight.call(child, callbackfn, "initialValue"); +var testResult = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === "1"); + } +} + +var proto = { + 0: 0, + 2: 2 +}; + +Object.defineProperty(proto, "1", { + get: function() { + return 11; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 3; + +Object.defineProperty(child, "1", { + get: function() { + return "1"; + }, + configurable: true +}); + +Array.prototype.reduceRight.call(child, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-14.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-14.js index e0df7ceb0475042bd0856cb89d7821a8996dc7c0..25f63b507d2cb6378280877be678365ea8be6ebf 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-14.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-14.js @@ -10,28 +10,29 @@ description: > an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === "1"); - } - } +var testResult = false; - Object.defineProperty(Array.prototype, "1", { - get: function () { - return 11; - }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === "1"); + } +} - var arr = [0, ,2]; +Object.defineProperty(Array.prototype, "1", { + get: function() { + return 11; + }, + configurable: true +}); - Object.defineProperty(arr, "1", { - get: function () { - return "1"; - }, - configurable: true - }); - arr.reduceRight(callbackfn, "initialValue"); +var arr = [0, , 2]; + +Object.defineProperty(arr, "1", { + get: function() { + return "1"; + }, + configurable: true +}); +arr.reduceRight(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-15.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-15.js index f8684e9e87b7cb18998adec9a4fb0a940c0ed691..270f2ed4b8496deb1aa63e618109fa2368c222e4 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-15.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-15.js @@ -9,28 +9,32 @@ description: > accessor property on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; - var proto = { 0: 0, 2: 2 }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} - Object.defineProperty(proto, "1", { - get: function () { - return 1; - }, - configurable: true - }); +var proto = { + 0: 0, + 2: 2 +}; - var Con = function () { }; - Con.prototype = proto; +Object.defineProperty(proto, "1", { + get: function() { + return 1; + }, + configurable: true +}); - var child = new Con(); - child.length = 3; +var Con = function() {}; +Con.prototype = proto; - Array.prototype.reduceRight.call(child, callbackfn, "initialValue"); +var child = new Con(); +child.length = 3; + +Array.prototype.reduceRight.call(child, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-16.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-16.js index 0f70fe6179260e7dc7ac2f6a9e838de601729112..78cdc1a281e93b33f0474124803de0eaaec68393 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-16.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-16.js @@ -9,22 +9,23 @@ description: > accessor property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; - Object.defineProperty(Array.prototype, "1", { - get: function () { - return 1; - }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} - var arr = [0, , 2]; +Object.defineProperty(Array.prototype, "1", { + get: function() { + return 1; + }, + configurable: true +}); - arr.reduceRight(callbackfn, "initialValue"); +var arr = [0, , 2]; + +arr.reduceRight(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-17.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-17.js index 04d28b5566ae452818663e0d9f5d7582937c8948..7f9c3c0730f648b66b4c8e8c0ce36f2298eb6c8b 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-17.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-17.js @@ -9,20 +9,25 @@ description: > accessor property without a get function on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (typeof curVal === "undefined"); - } - } +var testResult = false; - var obj = { 0: 0, 2: 2, length: 3 }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (typeof curVal === "undefined"); + } +} - Object.defineProperty(obj, "1", { - set: function () { }, - configurable: true - }); +var obj = { + 0: 0, + 2: 2, + length: 3 +}; - Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); +Object.defineProperty(obj, "1", { + set: function() {}, + configurable: true +}); + +Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-18.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-18.js index ffd33eaac3af14a46b96c8022f83005fa0135a88..21a4bf39dc5a5aeb3172011cb6435278f272615c 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-18.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-18.js @@ -9,20 +9,21 @@ description: > accessor property without a get function on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (typeof curVal === "undefined"); - } - } +var testResult = false; - var arr = [0, , 2]; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (typeof curVal === "undefined"); + } +} - Object.defineProperty(arr, "1", { - set: function () { }, - configurable: true - }); +var arr = [0, , 2]; - arr.reduceRight(callbackfn, "initialValue"); +Object.defineProperty(arr, "1", { + set: function() {}, + configurable: true +}); + +arr.reduceRight(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-19.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-19.js index ca309ae008662609bcf5836fd7bf0e110a8e479c..82ab638bd085034af71d57339daf47f6b4594e44 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-19.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-19.js @@ -10,21 +10,26 @@ description: > inherited accessor property on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (typeof curVal === "undefined"); - } - } +var testResult = false; - Object.prototype[1] = 1; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (typeof curVal === "undefined"); + } +} - var obj = { 0: 0, 2: 2, length: 3 }; - Object.defineProperty(obj, "1", { - set: function () { }, - configurable: true - }); +Object.prototype[1] = 1; - Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); +var obj = { + 0: 0, + 2: 2, + length: 3 +}; +Object.defineProperty(obj, "1", { + set: function() {}, + configurable: true +}); + +Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-2.js index f608df6090299e0e08405d1c55011ab57155ebfc..c7168a194990e2bc10091653d5f6009e6edecb34 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-2.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-2.js @@ -9,14 +9,15 @@ description: > property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; - var arr = [0, 1, 2]; - arr.reduceRight(callbackfn, "initialValue"); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} + +var arr = [0, 1, 2]; +arr.reduceRight(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-20.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-20.js index 266cafd1ae23950ad5cb210b5361ab74227f8b87..0f39cd442b6999eb6bc5877b28a5c4d801af50b8 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-20.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-20.js @@ -10,20 +10,21 @@ description: > inherited accessor property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (typeof curVal === "undefined"); - } - } +var testResult = false; - Array.prototype[1] = 1; - var arr = [0, ,2]; - Object.defineProperty(arr, "1", { - set: function () { }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (typeof curVal === "undefined"); + } +} - arr.reduceRight(callbackfn, "initialValue"); +Array.prototype[1] = 1; +var arr = [0, , 2]; +Object.defineProperty(arr, "1", { + set: function() {}, + configurable: true +}); + +arr.reduceRight(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-21.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-21.js index 1e7b5fd1ae4ae1ac174419cd91c60a1a21d3091d..f5dda1c86655e8f9914e0c828908296c0af61568 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-21.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-21.js @@ -9,26 +9,30 @@ description: > accessor property without a get function on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (typeof curVal === "undefined"); - } - } +var testResult = false; - var proto = { 0: 0, 2: 2 }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (typeof curVal === "undefined"); + } +} - Object.defineProperty(proto, "1", { - set: function () { }, - configurable: true - }); +var proto = { + 0: 0, + 2: 2 +}; - var Con = function () { }; - Con.prototype = proto; +Object.defineProperty(proto, "1", { + set: function() {}, + configurable: true +}); - var child = new Con(); - child.length = 3; +var Con = function() {}; +Con.prototype = proto; - Array.prototype.reduceRight.call(child, callbackfn, "initialValue"); +var child = new Con(); +child.length = 3; + +Array.prototype.reduceRight.call(child, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-22.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-22.js index dedd4b643b13997d3f2d047217e48a09799224bb..365b543a52090234ee9bd0238851d3475780dbd5 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-22.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-22.js @@ -9,20 +9,21 @@ description: > accessor property without a get function on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (typeof curVal === "undefined"); - } - } +var testResult = false; - Object.defineProperty(Array.prototype, "1", { - set: function () { }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (typeof curVal === "undefined"); + } +} - var arr = [0, , 2]; +Object.defineProperty(Array.prototype, "1", { + set: function() {}, + configurable: true +}); - arr.reduceRight(callbackfn, "initialValue"); +var arr = [0, , 2]; + +arr.reduceRight(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-25.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-25.js index 81d2d0e0460c62d54adcd38fa0c953aaeeb0758b..9c177f936a43cf6b06cb29942c5818ce96104f5d 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-25.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-25.js @@ -10,17 +10,18 @@ description: > is less than number of parameters) ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; - var func = function (a, b, c) { - Array.prototype.reduceRight.call(arguments, callbackfn, "initialValue"); - }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} - func(0, 1); +var func = function(a, b, c) { + Array.prototype.reduceRight.call(arguments, callbackfn, "initialValue"); +}; + +func(0, 1); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-26.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-26.js index e2518afe356b78edbb1c13b3053ee31646d79953..79984ddfe34fed5fbf9f7bfce6506ce952fe4193 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-26.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-26.js @@ -10,17 +10,18 @@ description: > equals number of parameters) ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 2) { - testResult = (curVal === 2); - } - } +var testResult = false; - var func = function (a, b, c) { - Array.prototype.reduceRight.call(arguments, callbackfn, "initialValue"); - }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 2) { + testResult = (curVal === 2); + } +} - func(0, 1, 2); +var func = function(a, b, c) { + Array.prototype.reduceRight.call(arguments, callbackfn, "initialValue"); +}; + +func(0, 1, 2); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-27.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-27.js index 677bcd3da2b8bf3a4a6335919b9a06b8a059f81c..080ad10a216a91d5e6d5c8d4e348fc80a0bb1621 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-27.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-27.js @@ -10,17 +10,18 @@ description: > is greater than number of parameters) ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 3) { - testResult = (curVal === 3); - } - } +var testResult = false; - var func = function (a, b, c) { - Array.prototype.reduceRight.call(arguments, callbackfn, "initialValue"); - }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 3) { + testResult = (curVal === 3); + } +} - func(0, 1, 2, 3); +var func = function(a, b, c) { + Array.prototype.reduceRight.call(arguments, callbackfn, "initialValue"); +}; + +func(0, 1, 2, 3); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-28.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-28.js index 83976643ca57d445b2c64829d01b9432e2cee119..388685e913b2c8ebe6574c307349fa5da233c35c 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-28.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-28.js @@ -9,14 +9,15 @@ description: > implements its own property get method ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === "1"); - } - } +var testResult = false; - var str = new String("012"); - Array.prototype.reduceRight.call(str, callbackfn, "initialValue"); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === "1"); + } +} + +var str = new String("012"); +Array.prototype.reduceRight.call(str, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-29.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-29.js index b69e0332b200c5cbddb086e13ffcd429a91dc523..2cc8148fda0c5662d95a0d1dab522626077ce014 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-29.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-29.js @@ -9,22 +9,23 @@ description: > implements its own property get method ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; +var initialValue = 0; - var obj = function (a, b, c) { - return a + b + c; - }; - obj[0] = 0; - obj[1] = 1; - obj[2] = 2; - obj[3] = 3; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} - Array.prototype.reduceRight.call(obj, callbackfn, initialValue); +var obj = function(a, b, c) { + return a + b + c; +}; +obj[0] = 0; +obj[1] = 1; +obj[2] = 2; +obj[3] = 3; + +Array.prototype.reduceRight.call(obj, callbackfn, initialValue); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-3.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-3.js index 50fa727045feb1160b6790563288bca5decc3831..98c28ad1e09c84ec63eac4ce43fcbc6b94d7dd73 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-3.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-3.js @@ -10,22 +10,28 @@ description: > Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === "1"); - } - } +var testResult = false; - var proto = { 0: 10, 1: 11, 2: 12, length: 2 }; - var Con = function () { }; - Con.prototype = proto; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === "1"); + } +} - var child = new Con(); - child[1] = "1"; - child[2] = "2"; - child.length = 3; +var proto = { + 0: 10, + 1: 11, + 2: 12, + length: 2 +}; +var Con = function() {}; +Con.prototype = proto; - Array.prototype.reduceRight.call(child, callbackfn, "initialValue"); +var child = new Con(); +child[1] = "1"; +child[2] = "2"; +child.length = 3; + +Array.prototype.reduceRight.call(child, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-30.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-30.js index c3c66cd5faf251a83d3ca9bc90286c65906cd8ad..234bf191a1f1cd6641d3e7bed24b2de5675b521a 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-30.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-30.js @@ -9,35 +9,36 @@ description: > previous iterations is observed on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } - - var arr = [, ,]; - var preIterVisible = false; - - Object.defineProperty(arr, "2", { - get: function () { - preIterVisible = true; - return 0; - }, - configurable: true - }); - - Object.defineProperty(arr, "1", { - get: function () { - if (preIterVisible) { - return 1; - } else { - return "11"; - } - }, - configurable: true - }); - - arr.reduceRight(callbackfn, "initialValue"); +var testResult = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} + +var arr = [, , ]; +var preIterVisible = false; + +Object.defineProperty(arr, "2", { + get: function() { + preIterVisible = true; + return 0; + }, + configurable: true +}); + +Object.defineProperty(arr, "1", { + get: function() { + if (preIterVisible) { + return 1; + } else { + return "11"; + } + }, + configurable: true +}); + +arr.reduceRight(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-31.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-31.js index a25b15397480ff127f5dcf2584ec5ce65b15e567..c560a641e9f9d21ae059c5d4a8132a29712a3e8c 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-31.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-31.js @@ -9,35 +9,38 @@ description: > previous iterations is observed on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } - - var obj = { length: 3 }; - var preIterVisible = false; - - Object.defineProperty(obj, "2", { - get: function () { - preIterVisible = true; - return 0; - }, - configurable: true - }); - - Object.defineProperty(obj, "1", { - get: function () { - if (preIterVisible) { - return 1; - } else { - return "11"; - } - }, - configurable: true - }); - - Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); +var testResult = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} + +var obj = { + length: 3 +}; +var preIterVisible = false; + +Object.defineProperty(obj, "2", { + get: function() { + preIterVisible = true; + return 0; + }, + configurable: true +}); + +Object.defineProperty(obj, "1", { + get: function() { + if (preIterVisible) { + return 1; + } else { + return "11"; + } + }, + configurable: true +}); + +Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); assert(testResult, 'testResult !== 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 a0225a88209cd927b907788791f0ad74c75f4287..57da7683af50497ebaebb12d76642265a06c87ee 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 @@ -9,22 +9,27 @@ description: > getter terminate iteration on an Array-like object ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx <= 1) { - accessed = true; - } - } +var accessed = false; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx <= 1) { + accessed = true; + } +} - var obj = { 0: 0, 2: 2, length: 3 }; - Object.defineProperty(obj, "1", { - get: function () { - throw new RangeError("unhandle exception happened in getter"); - }, - configurable: true - }); + +var obj = { + 0: 0, + 2: 2, + length: 3 +}; +Object.defineProperty(obj, "1", { + get: function() { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true +}); assert.throws(RangeError, function() { - Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); + Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); }); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-33.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-33.js index 643f4ee4a2926c519279dcef5fc746f03637132b..257325e497951a1f509058d8501a9f2a3261f3ca 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-33.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-33.js @@ -9,24 +9,25 @@ description: > getter terminate iteration on an Array ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx <= 1) { - accessed = true; - } - } +var accessed = false; - var arr = [0, , 2]; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx <= 1) { + accessed = true; + } +} - Object.defineProperty(arr, "1", { - get: function () { - throw new Test262Error("unhandle exception happened in getter"); - }, - configurable: true - }); +var arr = [0, , 2]; + +Object.defineProperty(arr, "1", { + get: function() { + throw new Test262Error("unhandle exception happened in getter"); + }, + configurable: true +}); assert.throws(Test262Error, function() { - arr.reduceRight(callbackfn, "initialValue"); + arr.reduceRight(callbackfn, "initialValue"); }); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-4.js index a5226d8d80f655b2ac660871ca988500a7c63c66..a5145b80d7001202fa014db1508900c070aefea7 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-4.js @@ -9,14 +9,15 @@ description: > property that overrides an inherited data property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; - Array.prototype[1] = "11"; - [0, 1, 2].reduceRight(callbackfn, "initialValue"); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} + +Array.prototype[1] = "11"; +[0, 1, 2].reduceRight(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-5.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-5.js index fe417547f8fe80ee2168287e0272a07ae2d62326..6feb43a1be59c99ce69deb89607643894aff67d6 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-5.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-5.js @@ -10,33 +10,34 @@ description: > Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 0) { - testResult = (curVal === "0"); - } - } - - var proto = {}; - - Object.defineProperty(proto, "0", { - get: function () { - return 10; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 2; - Object.defineProperty(child, "0", { - value: "0", - configurable: true - }); - child[1] = "1"; - - Array.prototype.reduceRight.call(child, callbackfn, "initialValue"); +var testResult = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 0) { + testResult = (curVal === "0"); + } +} + +var proto = {}; + +Object.defineProperty(proto, "0", { + get: function() { + return 10; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 2; +Object.defineProperty(child, "0", { + value: "0", + configurable: true +}); +child[1] = "1"; + +Array.prototype.reduceRight.call(child, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-6.js index d3715f273b51f5f7a086ae1e300585190c343f05..5b47467c3197d879202a5f62593815835b177f84 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-6.js @@ -9,19 +9,20 @@ description: > property that overrides an inherited accessor property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; - Object.defineProperty(Array.prototype, "1", { - get: function () { - return "11"; - }, - configurable: true - }); - [0, 1, 2].reduceRight(callbackfn, "initialValue"); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} + +Object.defineProperty(Array.prototype, "1", { + get: function() { + return "11"; + }, + configurable: true +}); +[0, 1, 2].reduceRight(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-7.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-7.js index 31f37fcee553f7fa1de289b9692857d24b4ecd11..e5a8ebfc367034482bbcd006f88365569e0e9ce5 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-7.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-7.js @@ -9,20 +9,25 @@ description: > data property on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; - var proto = { 0: 0, 1: 1, 2: 2 }; - var Con = function () { }; - Con.prototype = proto; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} - var child = new Con(); - child.length = 3; +var proto = { + 0: 0, + 1: 1, + 2: 2 +}; +var Con = function() {}; +Con.prototype = proto; - Array.prototype.reduceRight.call(child, callbackfn, "initialValue"); +var child = new Con(); +child.length = 3; + +Array.prototype.reduceRight.call(child, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-8.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-8.js index 754987649de20ba495e75c67e5d419f5df9343d4..ad73acacbe616dfb08b5f1146e93502083dc32b1 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-8.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-8.js @@ -9,16 +9,17 @@ description: > data property on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; - Array.prototype[0] = 0; - Array.prototype[1] = 1; - Array.prototype[2] = 2; - [, , , ].reduceRight(callbackfn, "initialValue"); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} + +Array.prototype[0] = 0; +Array.prototype[1] = 1; +Array.prototype[2] = 2; +[, , , ].reduceRight(callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-9.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-9.js index e26ebcc16867ba105b6c2d8e2a12f321ad472aaf..d512dd5daf6ac98fe0362836e42c349aab248671 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-9.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-9.js @@ -9,21 +9,26 @@ description: > accessor property on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } - } +var testResult = false; - var obj = { 0: 0, 2: 2, length: 3 }; - Object.defineProperty(obj, "1", { - get: function () { - return 1; - }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } +} - Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); +var obj = { + 0: 0, + 2: 2, + length: 3 +}; +Object.defineProperty(obj, "1", { + get: function() { + return 1; + }, + configurable: true +}); + +Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-1.js index ef650ba62a8cc8dcc8de37eb3edb3e3ba24803c0..50b5043be21332f5e328b270c33be07a51f1463d 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-1.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-1.js @@ -9,14 +9,14 @@ description: > parameters (initialvalue not passed) ---*/ - function callbackfn(prevVal, curVal, idx, obj) - { - if(idx+1 < obj.length && obj[idx] === curVal && obj[idx+1] === prevVal) - return curVal; - else - return false; - } +function callbackfn(prevVal, curVal, idx, obj) +{ + if (idx + 1 < obj.length && obj[idx] === curVal && obj[idx + 1] === prevVal) + return curVal; + else + return false; +} - var arr = [0,1,true,null,new Object(),"five"]; +var arr = [0, 1, true, null, new Object(), "five"]; assert.sameValue(arr.reduceRight(callbackfn), 0, 'arr.reduceRight(callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-10.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-10.js index ef2c334856b201c8b985752189b6b1cb9624fea2..1953c9a379d8c338c38d2d23995a370dd8ebe97c 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-10.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-10.js @@ -9,12 +9,12 @@ description: > parameter ---*/ - var called = 0; +var called = 0; - function callbackfn(prevVal) { - called++; - return prevVal; - } +function callbackfn(prevVal) { + called++; + return prevVal; +} assert.sameValue([11, 12].reduceRight(callbackfn, 100), 100, '[11, 12].reduceRight(callbackfn, 100)'); assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-11.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-11.js index 50fe7d7aac68125c425a3fa412a536303265752a..d6e3cfd1d7873d4a9f0efa0acddd5cddaa1b65eb 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-11.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-11.js @@ -9,14 +9,14 @@ description: > parameter ---*/ - var testResult = false; +var testResult = false; - function callbackfn(prevVal, curVal) { - if (prevVal === 100) { - testResult = true; - } - return curVal > 10; - } +function callbackfn(prevVal, curVal) { + if (prevVal === 100) { + testResult = true; + } + return curVal > 10; +} assert.sameValue([11].reduceRight(callbackfn, 100), true, '[11].reduceRight(callbackfn, 100)'); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-12.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-12.js index c29286b57d378f248a75d037cd63220a0769746a..5d7a7b572ac446070e2b387de7772097ee9d3ef4 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-12.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-12.js @@ -9,16 +9,16 @@ description: > parameter ---*/ - var testResult = false; - var arr = [11, 12, 13]; - var initVal = 6.99; +var testResult = false; +var arr = [11, 12, 13]; +var initVal = 6.99; - function callbackfn(prevVal, curVal, idx) { - if (idx === 2) { - testResult = (prevVal === initVal); - } - return curVal > 10 && arguments[3][idx] === curVal; - } +function callbackfn(prevVal, curVal, idx) { + if (idx === 2) { + testResult = (prevVal === initVal); + } + return curVal > 10 && arguments[3][idx] === curVal; +} assert.sameValue(arr.reduceRight(callbackfn, initVal), true, 'arr.reduceRight(callbackfn, initVal)'); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-13.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-13.js index 39325da4ed857c92b4d84efda8e6fe3c7454a117..6fc2965d5ae71ced985e06908c1dccdcd99fd9fa 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-13.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-13.js @@ -9,16 +9,16 @@ description: > parameter ---*/ - var arr = [11, 12, 13]; - var initVal = 6.99; - var testResult = false; +var arr = [11, 12, 13]; +var initVal = 6.99; +var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 2) { - testResult = (prevVal === initVal); - } - return curVal > 10 && obj[idx] === curVal; - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 2) { + testResult = (prevVal === initVal); + } + return curVal > 10 && obj[idx] === curVal; +} assert.sameValue(arr.reduceRight(callbackfn, initVal), true, 'arr.reduceRight(callbackfn, initVal)'); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-14.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-14.js index 200649494e79639904916fe9d4aff637fc619806..07437dba5126525ff16276b0327e5b8b43e8b257 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-14.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-14.js @@ -7,8 +7,8 @@ es5id: 15.4.4.22-9-c-ii-14 description: Array.prototype.reduceRight - callbackfn uses arguments ---*/ - function callbackfn() { - return arguments[0] === 100 && arguments[3][arguments[2]] === arguments[1]; - } +function callbackfn() { + return arguments[0] === 100 && arguments[3][arguments[2]] === arguments[1]; +} assert.sameValue([11].reduceRight(callbackfn, 100), true, '[11].reduceRight(callbackfn, 100)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-16.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-16.js index 101a63d5f267ccfc72a5ddd32abdafdac661d947..401a680ec0be12a748143d8196409b58c5b70e54 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-16.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-16.js @@ -9,15 +9,20 @@ description: > called on an Array-like object ---*/ - var testResult = false; +var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (prevVal === 8 || curVal === 8) { - testResult = true; - } - } +function callbackfn(prevVal, curVal, idx, obj) { + if (prevVal === 8 || curVal === 8) { + testResult = true; + } +} - var obj = { 0: 11, 10: 12, non_index_property: 8, length: 20 }; - Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); +var obj = { + 0: 11, + 10: 12, + non_index_property: 8, + length: 20 +}; +Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); assert.sameValue(testResult, false, 'testResult'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-17.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-17.js index 0b8e5be99915457dc791ed22babf8216c001fbeb..b2823532e8b680eb1c003d2550061cd8d3172e87 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-17.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-17.js @@ -9,19 +9,19 @@ description: > iteration is the result of previous iteration on an Array ---*/ - var arr = [11, 12, 13]; - var testResult = true; - var initVal = 6.99; - var preResult = initVal; +var arr = [11, 12, 13]; +var testResult = true; +var initVal = 6.99; +var preResult = initVal; - function callbackfn(prevVal, curVal, idx, obj) { - if (prevVal !== preResult) { - testResult = false; - } - preResult = curVal; - return curVal; - } +function callbackfn(prevVal, curVal, idx, obj) { + if (prevVal !== preResult) { + testResult = false; + } + preResult = curVal; + return curVal; +} - arr.reduceRight(callbackfn, initVal); +arr.reduceRight(callbackfn, initVal); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-18.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-18.js index 7e7098d40e1daee0b8ede817eb84af8d424dd79d..28d86867b7ba347d8c3b5d5fa501a910c388d35f 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-18.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-18.js @@ -10,17 +10,17 @@ description: > Array ---*/ - var arr = [11, 12]; - var testResult = false; - var initVal = 6.99; +var arr = [11, 12]; +var testResult = false; +var initVal = 6.99; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === initVal); - } - return curVal; - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === initVal); + } + return curVal; +} - arr.reduceRight(callbackfn, initVal); +arr.reduceRight(callbackfn, initVal); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-19.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-19.js index 194a3291765e8ba73ba5b93d1b1633d2e11a6a2a..991b82cf0924c857247a05b018fd97475e05e5d6 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-19.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-19.js @@ -10,15 +10,15 @@ description: > undefined when 'initialValue' is not present on an Array ---*/ - var arr = [11, 12, 13]; - var testResult = false; +var arr = [11, 12, 13]; +var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === 13); - } - return curVal; - } - arr.reduceRight(callbackfn); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === 13); + } + return curVal; +} +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-2.js index 7324a06a84b8d13bb558e68beaa1503c488c3144..238b1e2a3e686718a044491127d9b285808c9a1d 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-2.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-2.js @@ -9,17 +9,17 @@ description: > parameters (initialvalue passed) ---*/ - var bParCorrect = false; - var arr = [0, 1, true, null, new Object(), "five"]; - var initialValue = 5.5; +var bParCorrect = false; +var arr = [0, 1, true, null, new Object(), "five"]; +var initialValue = 5.5; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === obj.length - 1 && obj[idx] === curVal && prevVal === initialValue) - return curVal; - else if (idx + 1 < obj.length && obj[idx] === curVal && obj[idx + 1] === prevVal) - return curVal; - else - return false; - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === obj.length - 1 && obj[idx] === curVal && prevVal === initialValue) + return curVal; + else if (idx + 1 < obj.length && obj[idx] === curVal && obj[idx + 1] === prevVal) + return curVal; + else + return false; +} assert.sameValue(arr.reduceRight(callbackfn, initialValue), 0, 'arr.reduceRight(callbackfn, initialValue)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-20.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-20.js index f4b5470c69607027fafff03ed2de02419b6500fe..09cf7e099940cb93b0cdd0b6d36706085e68f5bf 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-20.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-20.js @@ -7,13 +7,17 @@ es5id: 15.4.4.22-9-c-ii-20 description: Array.prototype.reduceRight - undefined can be used as accumulator ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return typeof prevVal === "undefined"; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return typeof prevVal === "undefined"; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, undefined), true, 'Array.prototype.reduceRight.call(obj, callbackfn, undefined)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-21.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-21.js index 7f10e3b7871a03182ad7d8f0cb3ae83cce3bcd0a..83f18c38c506874e22b62bd10a88a2066f2621e7 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-21.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-21.js @@ -7,13 +7,17 @@ es5id: 15.4.4.22-9-c-ii-21 description: Array.prototype.reduceRight - null can be used as accumulator ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === null; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === null; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, null), true, 'Array.prototype.reduceRight.call(obj, callbackfn, null)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-22.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-22.js index 10b20d9427fc33133bc1312b1a215f3ba70b92be..e130868f08d72dfe2db695696b1c599d89ef3930 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-22.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-22.js @@ -9,13 +9,17 @@ description: > accumulator ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === false; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === false; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, false), true, 'Array.prototype.reduceRight.call(obj, callbackfn, false)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-23.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-23.js index 57cb524bded49e1eef1e6444a6b9e8b73125b4da..dc7dba028e267bd795d0b325cdd1550424b655ab 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-23.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-23.js @@ -9,13 +9,17 @@ description: > accumulator ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === 12; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === 12; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 12), true, 'Array.prototype.reduceRight.call(obj, callbackfn, 12)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-24.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-24.js index 2326939fd0291a18fe0dab0dda6376b70bdefbd1..768eb6a3ddf52d4299d03aa5fa766e31b0b14a04 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-24.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-24.js @@ -9,13 +9,17 @@ description: > accumulator ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === "hello_"; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === "hello_"; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, "hello_"), true, 'Array.prototype.reduceRight.call(obj, callbackfn, "hello_")'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-25.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-25.js index 4de1b221a27a270d7fe4740bf7c2d045334b7825..7d37c5f2aca13c6c2720a303a559c1eb5a31c771 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-25.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-25.js @@ -9,14 +9,18 @@ description: > accumulator ---*/ - var accessed = false; - var objFunction = function () { }; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === objFunction; - } +var accessed = false; +var objFunction = function() {}; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === objFunction; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, objFunction), true, 'Array.prototype.reduceRight.call(obj, callbackfn, objFunction)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-26.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-26.js index 485f17e1097dc564aab0f5871f1c0dfe067f87aa..e95896266ca90cd98ecf2b77267b1db2d7fc1862 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-26.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-26.js @@ -9,14 +9,18 @@ description: > accumulator ---*/ - var accessed = false; - var objArray = []; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === objArray; - } +var accessed = false; +var objArray = []; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === objArray; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, objArray), true, 'Array.prototype.reduceRight.call(obj, callbackfn, objArray)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-27.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-27.js index 3414ccbc9374302428710a8490fac59ec8aafa48..b5f187df0e7d45f019074c53baf911a7a0e54e6e 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-27.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-27.js @@ -9,14 +9,18 @@ description: > accumulator ---*/ - var accessed = false; - var objString = new String(); - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === objString; - } +var accessed = false; +var objString = new String(); - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === objString; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, objString), true, 'Array.prototype.reduceRight.call(obj, callbackfn, objString)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-28.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-28.js index 541ff7834c79de6e32085e37c4c06353b592731d..e8f4b8bc066bdae5b0928a25eef4398f85c0e991 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-28.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-28.js @@ -9,14 +9,18 @@ description: > accumulator ---*/ - var accessed = false; - var objBoolean = new Boolean(); - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === objBoolean; - } +var accessed = false; +var objBoolean = new Boolean(); - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === objBoolean; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, objBoolean), true, 'Array.prototype.reduceRight.call(obj, callbackfn, objBoolean)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-29.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-29.js index 852073958f272e787b4d757098de4d71af0bd2af..7194c1789bafa4198d6dfd6a4b46385331fd3575 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-29.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-29.js @@ -9,14 +9,18 @@ description: > accumulator ---*/ - var accessed = false; - var objNumber = new Number(); - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === objNumber; - } +var accessed = false; +var objNumber = new Number(); - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === objNumber; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, objNumber), true, 'Array.prototype.reduceRight.call(obj, callbackfn, objNumber)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-3.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-3.js index 7a53ea562732cba537c495f5105a60a21d51acfd..86a77aa3658e58dac3992dcfb842e9724007f650 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-3.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-3.js @@ -7,16 +7,17 @@ es5id: 15.4.4.22-9-c-ii-3 description: Array.prototype.reduceRight - callbackfn takes 4 arguments ---*/ - var bCalled = false; - function callbackfn(prevVal, curVal, idx, obj) - { - bCalled = true; - if(prevVal === true && arguments.length === 4) - return true; - else - return false; - } - var arr = [0,1,2,3,4,5,6,7,8,9]; +var bCalled = false; -assert.sameValue(arr.reduceRight(callbackfn,true), true, 'arr.reduceRight(callbackfn,true)'); +function callbackfn(prevVal, curVal, idx, obj) +{ + bCalled = true; + if (prevVal === true && arguments.length === 4) + return true; + else + return false; +} +var arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + +assert.sameValue(arr.reduceRight(callbackfn, true), true, 'arr.reduceRight(callbackfn,true)'); assert.sameValue(bCalled, true, 'bCalled'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-30.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-30.js index c151604233ced7fa78c24584211208b06b8b96de..0df77901888d53f3cc58de956f99dd4b13bff441 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-30.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-30.js @@ -9,13 +9,17 @@ description: > accumulator ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === Math; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === Math; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, Math), true, 'Array.prototype.reduceRight.call(obj, callbackfn, Math)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-31.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-31.js index c58777b282e783addb9e935fae40ddad831d15a7..092e60ecf7d8c80c07a58ec67e5efff32f81e8db 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-31.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-31.js @@ -9,14 +9,18 @@ description: > accumulator ---*/ - var accessed = false; - var objDate = new Date(); - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === objDate; - } +var accessed = false; +var objDate = new Date(); - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === objDate; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, objDate), true, 'Array.prototype.reduceRight.call(obj, callbackfn, objDate)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-32.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-32.js index 08e8e42323d74f287d511c2b0e2f78711bbfeab8..921bc654da210fe0b88813b672f94089235a11e8 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-32.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-32.js @@ -9,14 +9,18 @@ description: > accumulator ---*/ - var accessed = false; - var objRegExp = new RegExp(); - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === objRegExp; - } +var accessed = false; +var objRegExp = new RegExp(); - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === objRegExp; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, objRegExp), true, 'Array.prototype.reduceRight.call(obj, callbackfn, objRegExp)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-33.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-33.js index 97419e156b9aedad8848d1ffb16f0110aaaabf1f..37a2bd4a689111b8c1aa4b9697b164447d07512b 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-33.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-33.js @@ -7,13 +7,17 @@ es5id: 15.4.4.22-9-c-ii-33 description: Array.prototype.reduceRight - the JSON can be used as accumulator ---*/ - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === JSON; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === JSON; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, JSON), true, 'Array.prototype.reduceRight.call(obj, callbackfn, JSON)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-34.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-34.js index f384ce910943d988bac3972d4bdda0ae046e3235..72fcc0cc5625e6c20f515337564ef59f9c7f7be6 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-34.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-34.js @@ -9,14 +9,18 @@ description: > accumulator ---*/ - var accessed = false; - var objError = new RangeError(); - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === objError; - } +var accessed = false; +var objError = new RangeError(); - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === objError; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, objError), true, 'Array.prototype.reduceRight.call(obj, callbackfn, objError)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-35.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-35.js index 11d7428b73915b4a31357ffa426151f49b12f71e..db05c37e0d02c1c928060b0f62a4ce613dcc6b5a 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-35.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-35.js @@ -9,19 +9,22 @@ description: > accumulator ---*/ - var accessed = false; - var arg; +var accessed = false; +var arg; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === arg; - } +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === arg; +} - var obj = { 0: 11, length: 1 }; +var obj = { + 0: 11, + length: 1 +}; - (function fun() { - arg = arguments; - }(10, 11, 12, 13)); +(function fun() { + arg = arguments; +}(10, 11, 12, 13)); assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, arg), true, 'Array.prototype.reduceRight.call(obj, callbackfn, arg)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-37.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-37.js index e8b37ab73426ac3e817e28ce68645dcae5f4541d..23314a32bdc45e78f310f483c60c6e1d96026fe6 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-37.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-37.js @@ -10,13 +10,17 @@ description: > ---*/ var global = this; - var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - return prevVal === global; - } +var accessed = false; - var obj = { 0: 11, length: 1 }; +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + return prevVal === global; +} + +var obj = { + 0: 11, + length: 1 +}; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, this), true, 'Array.prototype.reduceRight.call(obj, callbackfn, this)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-4-s.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-4-s.js index 5993872575b4f08645062fdc5c70e19509eda6d0..35efbafc9ea2d9a7151c3016a72c764b0b65b092 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-4-s.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-4-s.js @@ -10,13 +10,14 @@ description: > flags: [noStrict] ---*/ - var innerThisCorrect = false; - function callbackfn(prevVal, curVal, idx, obj) - { - "use strict"; - innerThisCorrect = this===undefined; - return true; - } - [0].reduceRight(callbackfn,true); +var innerThisCorrect = false; + +function callbackfn(prevVal, curVal, idx, obj) +{ + "use strict"; + innerThisCorrect = this === undefined; + return true; +} +[0].reduceRight(callbackfn, true); assert(innerThisCorrect, 'innerThisCorrect !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-4.js index 2fc5083b78c14efaa7ac551ad6a04b0507d0e9a5..7dd1ce5ed0a4918d85c82f3a25e47cc02874bdce 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-4.js @@ -9,20 +9,20 @@ description: > numeric order ---*/ - var arr = [0, 1, 2, 3, 4, 5]; - var lastIdx = arr.length - 1; - var accessed = false; - var result = true; +var arr = [0, 1, 2, 3, 4, 5]; +var lastIdx = arr.length - 1; +var accessed = false; +var result = true; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - if (lastIdx !== idx) { - result = false; - } else { - lastIdx--; - } - } - arr.reduceRight(callbackfn, 1); +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + if (lastIdx !== idx) { + result = false; + } else { + lastIdx--; + } +} +arr.reduceRight(callbackfn, 1); assert(result, 'result !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-5.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-5.js index 8d3811a03ec2f3043818958915fdb7233020af53..ccb63b8118f1ad3595eea344a017e19a3652811d 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-5.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-5.js @@ -9,27 +9,27 @@ description: > iteration and not prior to starting the loop on an Array ---*/ - var arr = [11, 12, 13, 14]; - var kIndex = []; - var result = true; - var called = 0; +var arr = [11, 12, 13, 14]; +var kIndex = []; +var result = true; +var called = 0; - //By below way, we could verify that k would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time. - function callbackfn(preVal, curVal, idx, o) { - //Each position should be visited one time, which means k is accessed one time during iterations. - called++; - if (typeof kIndex[idx] === "undefined") { - //when current position is visited, its next index should has been visited. - if (idx !== arr.length - 1 && typeof kIndex[idx + 1] === "undefined") { - result = false; - } - kIndex[idx] = 1; - } else { - result = false; - } - } +//By below way, we could verify that k would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time. +function callbackfn(preVal, curVal, idx, o) { + //Each position should be visited one time, which means k is accessed one time during iterations. + called++; + if (typeof kIndex[idx] === "undefined") { + //when current position is visited, its next index should has been visited. + if (idx !== arr.length - 1 && typeof kIndex[idx + 1] === "undefined") { + result = false; + } + kIndex[idx] = 1; + } else { + result = false; + } +} - arr.reduceRight(callbackfn, 1); +arr.reduceRight(callbackfn, 1); assert(result, 'result !== true'); assert.sameValue(called, 4, 'called'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-7.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-7.js index 2c4f536010485228258421a4d96762dae9c2caa5..f6f26025d88e3d6b119ba413809157c79d3a3f2d 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-7.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-7.js @@ -9,21 +9,26 @@ description: > callbackfn terminate iteration ---*/ - var accessed = false; +var accessed = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx < 10) { - accessed = true; - } - if (idx === 10) { - throw new Test262Error("Exception occurred in callbackfn"); - } - } +function callbackfn(prevVal, curVal, idx, obj) { + if (idx < 10) { + accessed = true; + } + if (idx === 10) { + throw new Test262Error("Exception occurred in callbackfn"); + } +} - var obj = { 0: 11, 4: 10, 10: 8, length: 20 }; +var obj = { + 0: 11, + 4: 10, + 10: 8, + length: 20 +}; assert.throws(Test262Error, function() { - Array.prototype.reduceRight.call(obj, callbackfn, 1); + Array.prototype.reduceRight.call(obj, callbackfn, 1); }); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-8.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-8.js index 3625e8a4dfc3f3e69f30c77ebbe78e76e61f0951..439445c5b68ab5c18788c4d1c733408fe8641bd8 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-8.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-8.js @@ -9,15 +9,20 @@ description: > previous iterations is observed ---*/ - var accessed = false; - var obj = { 0: 11, 1: 12, length: 2 }; - function callbackfn(prevVal, curVal, idx, obj) { - accessed = true; - if (idx === 1) { - obj[idx - 1] = 8; - } - return curVal > 10; - } +var accessed = false; +var obj = { + 0: 11, + 1: 12, + length: 2 +}; + +function callbackfn(prevVal, curVal, idx, obj) { + accessed = true; + if (idx === 1) { + obj[idx - 1] = 8; + } + return curVal > 10; +} assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 1), false, 'Array.prototype.reduceRight.call(obj, callbackfn, 1)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-9.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-9.js index 170d9d32843266fbf913df0be109e06a48c08f29..c1dfba32898fcbe5d8e5e5ba9d6ab027e1008dc9 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-9.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-9.js @@ -9,12 +9,12 @@ description: > parameter ---*/ - var called = 0; +var called = 0; - function callbackfn() { - called++; - return true; - } +function callbackfn() { + called++; + return true; +} assert.sameValue([11, 12].reduceRight(callbackfn, 11), true, '[11, 12].reduceRight(callbackfn, 11)'); assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A1_T1.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A1_T1.js index 7ca4f7f6e3ee801ead3db31a6f454f96fe6d5913..fd092bbb997011366a7ac52d95888b50254d97a2 100644 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A1_T1.js +++ b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A1_T1.js @@ -26,7 +26,7 @@ if (reverse !== x) { } //CHECK#3 -x = new Array(1,2); +x = new Array(1, 2); var reverse = x.reverse(); if (reverse !== x) { $ERROR('#3: x = new Array(1,2); x.reverse() === x. Actual: ' + (reverse)); diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A1_T2.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A1_T2.js index 62f93f6e5372ed58b1ede59dccf8504ca7387e80..a488885d41411bfe84165fb121bd7a40ae5c186f 100644 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A1_T2.js +++ b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A1_T2.js @@ -26,52 +26,52 @@ if (reverse !== x) { //CHECK#2 if (x[0] !== "-1") { - $ERROR('#2: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[0] === "-1". Actual: ' + (x[0])); + $ERROR('#2: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[0] === "-1". Actual: ' + (x[0])); } //CHECK#3 if (x[1] !== "NaN") { - $ERROR('#3: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[1] === "NaN". Actual: ' + (x[1])); + $ERROR('#3: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[1] === "NaN". Actual: ' + (x[1])); } //CHECK#4 if (x[2] !== undefined) { - $ERROR('#4: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[2] === undefined. Actual: ' + (x[2])); + $ERROR('#4: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[2] === undefined. Actual: ' + (x[2])); } //CHECK#5 if (x[3] !== undefined) { - $ERROR('#5: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[3] === undefined. Actual: ' + (x[3])); + $ERROR('#5: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[3] === undefined. Actual: ' + (x[3])); } //CHECK#6 if (x[4] !== undefined) { - $ERROR('#6: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[4] === undefined. Actual: ' + (x[4])); + $ERROR('#6: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[4] === undefined. Actual: ' + (x[4])); } //CHECK#7 if (x[5] !== undefined) { - $ERROR('#7: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[5] === undefined. Actual: ' + (x[5])); + $ERROR('#7: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[5] === undefined. Actual: ' + (x[5])); } //CHECK#8 if (x[6] !== undefined) { - $ERROR('#8: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[6] === undefined. Actual: ' + (x[6])); + $ERROR('#8: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[6] === undefined. Actual: ' + (x[6])); } //CHECK#9 if (x[7] !== Infinity) { - $ERROR('#9: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[7] === Infinity. Actual: ' + (x[7])); + $ERROR('#9: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[7] === Infinity. Actual: ' + (x[7])); } //CHECK#10 if (x[8] !== undefined) { - $ERROR('#10: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[8] === undefined. Actual: ' + (x[8])); + $ERROR('#10: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[8] === undefined. Actual: ' + (x[8])); } //CHECK#11 if (x[9] !== true) { - $ERROR('#11: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[9] === true. Actual: ' + (x[9])); + $ERROR('#11: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[9] === true. Actual: ' + (x[9])); } x.length = 9; @@ -83,45 +83,45 @@ if (reverse !== x) { //CHECK#12 if (x[0] !== undefined) { - $ERROR('#12: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[0] === undefined. Actual: ' + (x[0])); + $ERROR('#12: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[0] === undefined. Actual: ' + (x[0])); } //CHECK#13 if (x[1] !== Infinity) { - $ERROR('#13: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[1] === Infinity. Actual: ' + (x[1])); + $ERROR('#13: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[1] === Infinity. Actual: ' + (x[1])); } //CHECK#14 if (x[2] !== undefined) { - $ERROR('#14: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[2] === undefined. Actual: ' + (x[2])); + $ERROR('#14: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[2] === undefined. Actual: ' + (x[2])); } //CHECK#15 if (x[3] !== undefined) { - $ERROR('#15: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[3] === undefined. Actual: ' + (x[3])); + $ERROR('#15: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[3] === undefined. Actual: ' + (x[3])); } //CHECK#16 if (x[4] !== undefined) { - $ERROR('#16: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[4] === undefined. Actual: ' + (x[4])); + $ERROR('#16: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[4] === undefined. Actual: ' + (x[4])); } //CHECK#17 if (x[5] !== undefined) { - $ERROR('#17: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[5] === undefined. Actual: ' + (x[5])); + $ERROR('#17: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[5] === undefined. Actual: ' + (x[5])); } //CHECK#18 if (x[6] !== undefined) { - $ERROR('#18: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[6] === undefined. Actual: ' + (x[6])); + $ERROR('#18: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[6] === undefined. Actual: ' + (x[6])); } //CHECK#19 if (x[7] !== "NaN") { - $ERROR('#19: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[7] === "NaN". Actual: ' + (x[7])); + $ERROR('#19: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[7] === "NaN". Actual: ' + (x[7])); } //CHECK#20 if (x[8] !== "-1") { - $ERROR('#20: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[8] === "-1". Actual: ' + (x[8])); + $ERROR('#20: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[8] === "-1". Actual: ' + (x[8])); } diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A2_T1.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A2_T1.js index ec750f6264fcad0328a723415567df377f49e5b0..384047599185af3ee4121c7c149c3abb56d24e75 100644 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A2_T1.js +++ b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A2_T1.js @@ -31,52 +31,52 @@ if (reverse !== obj) { //CHECK#2 if (obj[0] !== "-1") { - $ERROR('#2: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[0] === "-1". Actual: ' + (obj[0])); + $ERROR('#2: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[0] === "-1". Actual: ' + (obj[0])); } //CHECK#3 if (obj[1] !== "NaN") { - $ERROR('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[1] === "NaN". Actual: ' + (obj[1])); + $ERROR('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[1] === "NaN". Actual: ' + (obj[1])); } //CHECK#4 if (obj[2] !== undefined) { - $ERROR('#4: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2])); + $ERROR('#4: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2])); } //CHECK#5 if (obj[3] !== undefined) { - $ERROR('#5: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3])); + $ERROR('#5: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3])); } //CHECK#6 if (obj[4] !== undefined) { - $ERROR('#6: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4])); + $ERROR('#6: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4])); } //CHECK#7 if (obj[5] !== undefined) { - $ERROR('#7: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5])); + $ERROR('#7: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5])); } //CHECK#8 if (obj[6] !== undefined) { - $ERROR('#8: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6])); + $ERROR('#8: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6])); } //CHECK#9 if (obj[7] !== Infinity) { - $ERROR('#9: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[7] === Infinity. Actual: ' + (obj[7])); + $ERROR('#9: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[7] === Infinity. Actual: ' + (obj[7])); } //CHECK#10 if (obj[8] !== undefined) { - $ERROR('#10: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[8] === undefined. Actual: ' + (obj[8])); + $ERROR('#10: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[8] === undefined. Actual: ' + (obj[8])); } //CHECK#11 if (obj[9] !== true) { - $ERROR('#11: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[9] === true. Actual: ' + (obj[9])); + $ERROR('#11: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[9] === true. Actual: ' + (obj[9])); } obj.length = 9; @@ -88,45 +88,45 @@ if (reverse !== obj) { //CHECK#12 if (obj[0] !== undefined) { - $ERROR('#12: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[0] === undefined. Actual: ' + (obj[0])); + $ERROR('#12: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[0] === undefined. Actual: ' + (obj[0])); } //CHECK#13 if (obj[1] !== Infinity) { - $ERROR('#13: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[1] === Infinity. Actual: ' + (obj[1])); + $ERROR('#13: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[1] === Infinity. Actual: ' + (obj[1])); } //CHECK#14 if (obj[2] !== undefined) { - $ERROR('#14: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2])); + $ERROR('#14: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2])); } //CHECK#15 if (obj[3] !== undefined) { - $ERROR('#15: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3])); + $ERROR('#15: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3])); } //CHECK#16 if (obj[4] !== undefined) { - $ERROR('#16: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4])); + $ERROR('#16: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4])); } //CHECK#17 if (obj[5] !== undefined) { - $ERROR('#17: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5])); + $ERROR('#17: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5])); } //CHECK#18 if (obj[6] !== undefined) { - $ERROR('#18: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6])); + $ERROR('#18: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6])); } //CHECK#19 if (obj[7] !== "NaN") { - $ERROR('#19: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[7] === "NaN". Actual: ' + (obj[7])); + $ERROR('#19: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[7] === "NaN". Actual: ' + (obj[7])); } //CHECK#20 if (obj[8] !== "-1") { - $ERROR('#20: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[8] === "-1". Actual: ' + (obj[8])); + $ERROR('#20: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[8] === "-1". Actual: ' + (obj[8])); } diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A2_T2.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A2_T2.js index 2d521f112939ef5d0430fe08ae7f375cbf78417e..77693f71ce5e09ac8d540e650bb300091eeeac57 100644 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A2_T2.js +++ b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A2_T2.js @@ -31,52 +31,52 @@ if (reverse !== obj) { //CHECK#2 if (obj[0] !== "-1") { - $ERROR('#2: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[0] === "-1". Actual: ' + (obj[0])); + $ERROR('#2: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[0] === "-1". Actual: ' + (obj[0])); } //CHECK#3 if (obj[1] !== "NaN") { - $ERROR('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[1] === "NaN". Actual: ' + (obj[1])); + $ERROR('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[1] === "NaN". Actual: ' + (obj[1])); } //CHECK#4 if (obj[2] !== undefined) { - $ERROR('#4: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2])); + $ERROR('#4: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2])); } //CHECK#5 if (obj[3] !== undefined) { - $ERROR('#5: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3])); + $ERROR('#5: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3])); } //CHECK#6 if (obj[4] !== undefined) { - $ERROR('#6: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4])); + $ERROR('#6: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4])); } //CHECK#7 if (obj[5] !== undefined) { - $ERROR('#7: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5])); + $ERROR('#7: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5])); } //CHECK#8 if (obj[6] !== undefined) { - $ERROR('#8: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6])); + $ERROR('#8: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6])); } //CHECK#9 if (obj[7] !== Infinity) { - $ERROR('#9: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[7] === Infinity. Actual: ' + (obj[7])); + $ERROR('#9: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[7] === Infinity. Actual: ' + (obj[7])); } //CHECK#10 if (obj[8] !== undefined) { - $ERROR('#10: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[8] === undefined. Actual: ' + (obj[8])); + $ERROR('#10: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[8] === undefined. Actual: ' + (obj[8])); } //CHECK#11 if (obj[9] !== true) { - $ERROR('#11: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[9] === true. Actual: ' + (obj[9])); + $ERROR('#11: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[9] === true. Actual: ' + (obj[9])); } obj.length = new Number(9.5); @@ -88,45 +88,45 @@ if (reverse !== obj) { //CHECK#12 if (obj[0] !== undefined) { - $ERROR('#12: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[0] === undefined. Actual: ' + (obj[0])); + $ERROR('#12: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[0] === undefined. Actual: ' + (obj[0])); } //CHECK#13 if (obj[1] !== Infinity) { - $ERROR('#13: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[1] === Infinity. Actual: ' + (obj[1])); + $ERROR('#13: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[1] === Infinity. Actual: ' + (obj[1])); } //CHECK#14 if (obj[2] !== undefined) { - $ERROR('#14: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2])); + $ERROR('#14: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2])); } //CHECK#15 if (obj[3] !== undefined) { - $ERROR('#15: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3])); + $ERROR('#15: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3])); } //CHECK#16 if (obj[4] !== undefined) { - $ERROR('#16: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4])); + $ERROR('#16: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4])); } //CHECK#17 if (obj[5] !== undefined) { - $ERROR('#17: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5])); + $ERROR('#17: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5])); } //CHECK#18 if (obj[6] !== undefined) { - $ERROR('#18: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6])); + $ERROR('#18: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6])); } //CHECK#19 if (obj[7] !== "NaN") { - $ERROR('#19: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[7] === "NaN". Actual: ' + (obj[7])); + $ERROR('#19: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[7] === "NaN". Actual: ' + (obj[7])); } //CHECK#20 if (obj[8] !== "-1") { - $ERROR('#20: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[8] === "-1". Actual: ' + (obj[8])); + $ERROR('#20: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[8] === "-1". Actual: ' + (obj[8])); } diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A2_T3.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A2_T3.js index 1c41625f822ccbed440977eb4df4b32768e5fff1..2fd9a2d2a836a3137ccc73d798da89c780d11299 100644 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A2_T3.js +++ b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A2_T3.js @@ -31,52 +31,52 @@ if (reverse !== obj) { //CHECK#2 if (obj[0] !== "-1") { - $ERROR('#2: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[0] === "-1". Actual: ' + (obj[0])); + $ERROR('#2: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[0] === "-1". Actual: ' + (obj[0])); } //CHECK#3 if (obj[1] !== "NaN") { - $ERROR('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[1] === "NaN". Actual: ' + (obj[1])); + $ERROR('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[1] === "NaN". Actual: ' + (obj[1])); } //CHECK#4 if (obj[2] !== undefined) { - $ERROR('#4: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2])); + $ERROR('#4: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2])); } //CHECK#5 if (obj[3] !== undefined) { - $ERROR('#5: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3])); + $ERROR('#5: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3])); } //CHECK#6 if (obj[4] !== undefined) { - $ERROR('#6: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4])); + $ERROR('#6: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4])); } //CHECK#7 if (obj[5] !== undefined) { - $ERROR('#7: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5])); + $ERROR('#7: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5])); } //CHECK#8 if (obj[6] !== undefined) { - $ERROR('#8: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6])); + $ERROR('#8: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6])); } //CHECK#9 if (obj[7] !== Infinity) { - $ERROR('#9: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[7] === Infinity. Actual: ' + (obj[7])); + $ERROR('#9: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[7] === Infinity. Actual: ' + (obj[7])); } //CHECK#10 if (obj[8] !== undefined) { - $ERROR('#10: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[8] === undefined. Actual: ' + (obj[8])); + $ERROR('#10: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[8] === undefined. Actual: ' + (obj[8])); } //CHECK#11 if (obj[9] !== true) { - $ERROR('#11: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[9] === true. Actual: ' + (obj[9])); + $ERROR('#11: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[9] === true. Actual: ' + (obj[9])); } obj.length = new String("9"); @@ -88,45 +88,45 @@ if (reverse !== obj) { //CHECK#12 if (obj[0] !== undefined) { - $ERROR('#12: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[0] === undefined. Actual: ' + (obj[0])); + $ERROR('#12: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[0] === undefined. Actual: ' + (obj[0])); } //CHECK#13 if (obj[1] !== Infinity) { - $ERROR('#13: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[1] === Infinity. Actual: ' + (obj[1])); + $ERROR('#13: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[1] === Infinity. Actual: ' + (obj[1])); } //CHECK#14 if (obj[2] !== undefined) { - $ERROR('#14: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2])); + $ERROR('#14: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2])); } //CHECK#15 if (obj[3] !== undefined) { - $ERROR('#15: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3])); + $ERROR('#15: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3])); } //CHECK#16 if (obj[4] !== undefined) { - $ERROR('#16: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4])); + $ERROR('#16: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4])); } //CHECK#17 if (obj[5] !== undefined) { - $ERROR('#17: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5])); + $ERROR('#17: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5])); } //CHECK#18 if (obj[6] !== undefined) { - $ERROR('#18: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6])); + $ERROR('#18: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6])); } //CHECK#19 if (obj[7] !== "NaN") { - $ERROR('#19: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[7] === "NaN". Actual: ' + (obj[7])); + $ERROR('#19: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[7] === "NaN". Actual: ' + (obj[7])); } //CHECK#20 if (obj[8] !== "-1") { - $ERROR('#20: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[8] === "-1". Actual: ' + (obj[8])); + $ERROR('#20: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[8] === "-1". Actual: ' + (obj[8])); } diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A4_T1.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A4_T1.js index 82fa71a07d7f0e0044af7003b320de708b3d4df4..44fefbf426cb4ca2af6a0dde62db0c14051b4413 100644 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A4_T1.js +++ b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A4_T1.js @@ -40,7 +40,9 @@ if (x[1] !== 1) { Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.reverse = Array.prototype.reverse; -x = {0:0}; +x = { + 0: 0 +}; x.reverse(); //CHECK#5 diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A4_T2.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A4_T2.js index f658651f46fa3aa6f67c66e7079185d61fb26b22..942d287ad784fbf8744b4f8f2529c29ec7939bb4 100644 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A4_T2.js +++ b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A4_T2.js @@ -11,7 +11,7 @@ description: > ---*/ Array.prototype[1] = -1; -var x = [0,1]; +var x = [0, 1]; x.length = 2; x.reverse(); @@ -40,7 +40,10 @@ if (x[1] !== -1) { Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.reverse = Array.prototype.reverse; -x = {0:0,1:1}; +x = { + 0: 0, + 1: 1 +}; x.reverse(); //CHECK#5 diff --git a/test/built-ins/Array/prototype/reverse/length-exceeding-integer-limit-with-object.js b/test/built-ins/Array/prototype/reverse/length-exceeding-integer-limit-with-object.js index 2296861a5058800b5fd3e65104dacc1f0274ddba..94e53bb20b3d94604692ddcec9dd7ab2d294ffc3 100644 --- a/test/built-ins/Array/prototype/reverse/length-exceeding-integer-limit-with-object.js +++ b/test/built-ins/Array/prototype/reverse/length-exceeding-integer-limit-with-object.js @@ -11,20 +11,20 @@ info: | ... ---*/ -function StopReverse() { } +function StopReverse() {} // Object with large "length" property and no indexed properties in the uint32 range. var arrayLike = { - get "9007199254740990"() { + get "9007199254740990" () { throw new StopReverse(); }, - get "9007199254740991"() { + get "9007199254740991" () { $ERROR("Get 9007199254740991"); }, - get "9007199254740992"() { + get "9007199254740992" () { $ERROR("Get 9007199254740992"); }, - length: 2**53 + 2, + length: 2 ** 53 + 2, }; assert.throws(StopReverse, function() { diff --git a/test/built-ins/Array/prototype/reverse/length-exceeding-integer-limit-with-proxy.js b/test/built-ins/Array/prototype/reverse/length-exceeding-integer-limit-with-proxy.js index e4b45f459576f2bbd65c6a89e70e2985b8f125b7..308eb5e192bb6daf0b6a6b6906d3b13930ee7d23 100644 --- a/test/built-ins/Array/prototype/reverse/length-exceeding-integer-limit-with-proxy.js +++ b/test/built-ins/Array/prototype/reverse/length-exceeding-integer-limit-with-proxy.js @@ -8,7 +8,7 @@ description: > includes: [compareArray.js, proxyTrapsHelper.js] ---*/ -function StopReverse() { } +function StopReverse() {} var arrayLike = { 0: "zero", @@ -25,7 +25,7 @@ var arrayLike = { /* 9007199254740989: hole, */ 9007199254740990: "2**53-2", - length: 2**53 + 2, + length: 2 ** 53 + 2, }; var traps = []; @@ -106,7 +106,7 @@ assert.compareArray(traps, [ "Get:4", ]); -assert.sameValue(arrayLike.length, 2**53 + 2, "Length property is not modified"); +assert.sameValue(arrayLike.length, 2 ** 53 + 2, "Length property is not modified"); assert.sameValue(arrayLike[0], "2**53-2", "Property at index 0"); assert.sameValue(1 in arrayLike, false, "Property at index 1"); diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A1.1_T1.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A1.1_T1.js index f84a5392ee0252f25ef596d2e32b10dd4c699b88..b087c14b74fbd0d6b0064fbb6b32caefcc09a6f3 100644 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A1.1_T1.js +++ b/test/built-ins/Array/prototype/shift/S15.4.4.9_A1.1_T1.js @@ -23,7 +23,7 @@ if (x.length !== 0) { } //CHECK#3 -var x = Array(1,2,3); +var x = Array(1, 2, 3); x.length = 0; var shift = x.shift(); if (shift !== undefined) { diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A1.2_T1.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A1.2_T1.js index 3fac087a29946b254b1fb7518853a8a8f55d9cdf..b736fa0f34f7eebe664d10f342f3ce5630eae39d 100644 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A1.2_T1.js +++ b/test/built-ins/Array/prototype/shift/S15.4.4.9_A1.2_T1.js @@ -11,7 +11,7 @@ description: Checking this use new Array() and [] ---*/ //CHECK#1 -var x = new Array(0,1,2,3); +var x = new Array(0, 1, 2, 3); var shift = x.shift(); if (shift !== 0) { $ERROR('#1: x = new Array(0,1,2,3); x.shift() === 0. Actual: ' + (shift)); diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A2_T1.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A2_T1.js index ea342a469721bb4d788d3d51db8dbab48cdf134d..caf6bcb1802b923791ae25574fdb2dd9a076748e 100644 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A2_T1.js +++ b/test/built-ins/Array/prototype/shift/S15.4.4.9_A2_T1.js @@ -18,15 +18,15 @@ obj.shift = Array.prototype.shift; if (obj.length !== undefined) { $ERROR('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length)); } else { - //CHECK#1 - var shift = obj.shift(); -if (shift !== undefined) { - $ERROR('#1: var obj = {}; obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift)); - } - //CHECK#2 - if (obj.length !== 0) { - $ERROR('#2: var obj = {}; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 0. Actual: ' + (obj.length)); - } + //CHECK#1 + var shift = obj.shift(); + if (shift !== undefined) { + $ERROR('#1: var obj = {}; obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift)); + } + //CHECK#2 + if (obj.length !== 0) { + $ERROR('#2: var obj = {}; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 0. Actual: ' + (obj.length)); + } } //CHECK#3 diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A2_T2.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A2_T2.js index 2dc7695d292cf2f2d08e9c98c90eb99343f96825..af9768c9127c37c07f19e93551aa463b0b82a069 100644 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A2_T2.js +++ b/test/built-ins/Array/prototype/shift/S15.4.4.9_A2_T2.js @@ -50,7 +50,7 @@ if (shift !== undefined) { if (obj.length !== 0) { $ERROR('#8: var obj = {}; obj.length = -0; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 0. Actual: ' + (obj.length)); } else { - if (1/obj.length !== Number.POSITIVE_INFINITY) { + if (1 / obj.length !== Number.POSITIVE_INFINITY) { $ERROR('#8: var obj = {}; obj.length = -0; obj.shift = Array.prototype.shift; obj.shift(); obj.length === +0. Actual: ' + (obj.length)); } } diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A2_T5.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A2_T5.js index f16915d791d03e09ee2e0f72c7c3d563f35a845c..51e927577b05766f9a19beb6b6321472dee7faa3 100644 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A2_T5.js +++ b/test/built-ins/Array/prototype/shift/S15.4.4.9_A2_T5.js @@ -17,7 +17,11 @@ obj.shift = Array.prototype.shift; //CHECK#1 obj[0] = -1; -obj.length = {valueOf: function() {return 1}}; +obj.length = { + valueOf: function() { + return 1 + } +}; var shift = obj.shift(); if (shift !== -1) { $ERROR('#1: obj[0] = -1; obj.length = {valueOf: function() {return 1}} obj.shift() === -1. Actual: ' + (shift)); @@ -25,7 +29,14 @@ if (shift !== -1) { //CHECK#2 obj[0] = -1; -obj.length = {valueOf: function() {return 1}, toString: function() {return 0}}; +obj.length = { + valueOf: function() { + return 1 + }, + toString: function() { + return 0 + } +}; var shift = obj.shift(); if (shift !== -1) { $ERROR('#0: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {return 0}} obj.shift() === -1. Actual: ' + (shift)); @@ -33,7 +44,14 @@ if (shift !== -1) { //CHECK#3 obj[0] = -1; -obj.length = {valueOf: function() {return 1}, toString: function() {return {}}}; +obj.length = { + valueOf: function() { + return 1 + }, + toString: function() { + return {} + } +}; var shift = obj.shift(); if (shift !== -1) { $ERROR('#3: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {return {}}} obj.shift() === -1. Actual: ' + (shift)); @@ -42,9 +60,16 @@ if (shift !== -1) { //CHECK#4 try { obj[0] = -1; - obj.length = {valueOf: function() {return 1}, toString: function() {throw "error"}}; + obj.length = { + valueOf: function() { + return 1 + }, + toString: function() { + throw "error" + } + }; var shift = obj.shift(); -if (shift !== -1) { + if (shift !== -1) { $ERROR('#4.1: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {throw "error"}}; obj.shift() === ",". Actual: ' + (shift)); } } @@ -58,7 +83,11 @@ catch (e) { //CHECK#5 obj[0] = -1; -obj.length = {toString: function() {return 0}}; +obj.length = { + toString: function() { + return 0 + } +}; var shift = obj.shift(); if (shift !== undefined) { $ERROR('#5: obj[0] = -1; obj.length = {toString: function() {return 0}} obj.shift() === undefined. Actual: ' + (shift)); @@ -66,7 +95,14 @@ if (shift !== undefined) { //CHECK#6 obj[0] = -1; -obj.length = {valueOf: function() {return {}}, toString: function() {return 0}} +obj.length = { + valueOf: function() { + return {} + }, + toString: function() { + return 0 + } +} var shift = obj.shift(); if (shift !== undefined) { $ERROR('#6: obj[0] = -1; obj.length = {valueOf: function() {return {}}, toString: function() {return 0}} obj.shift() === undefined. Actual: ' + (shift)); @@ -75,7 +111,14 @@ if (shift !== undefined) { //CHECK#7 try { obj[0] = -1; - obj.length = {valueOf: function() {throw "error"}, toString: function() {return 0}}; + obj.length = { + valueOf: function() { + throw "error" + }, + toString: function() { + return 0 + } + }; var shift = obj.shift(); $ERROR('#7.1: obj[0] = -1; obj.length = {valueOf: function() {throw "error"}, toString: function() {return 0}}; obj.shift() throw "error". Actual: ' + (shift)); } @@ -88,7 +131,14 @@ catch (e) { //CHECK#8 try { obj[0] = -1; - obj.length = {valueOf: function() {return {}}, toString: function() {return {}}}; + obj.length = { + valueOf: function() { + return {} + }, + toString: function() { + return {} + } + }; var shift = obj.shift(); $ERROR('#8.1: obj[0] = -1; obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.shift() throw TypeError. Actual: ' + (shift)); } diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A3_T3.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A3_T3.js index 60942b64a109fddf903c087c1b646e6ca70ebb21..f1c786b2109e3f81be978163efd8e03285003d98 100644 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A3_T3.js +++ b/test/built-ins/Array/prototype/shift/S15.4.4.9_A3_T3.js @@ -27,10 +27,10 @@ if (obj.length !== 0) { //CHECK#3 if (obj[0] !== "x") { - $ERROR('#3: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x"; obj[1] = "y"; obj.length = -4294967294; obj.shift(); obj[0] === "x". Actual: ' + (obj[0])); + $ERROR('#3: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x"; obj[1] = "y"; obj.length = -4294967294; obj.shift(); obj[0] === "x". Actual: ' + (obj[0])); } //CHECK#4 if (obj[1] !== "y") { - $ERROR('#4: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x" obj[1] = "y"; obj.length = -4294967294; obj.shift(); obj[1] === "y". Actual: ' + (obj[1])); + $ERROR('#4: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x" obj[1] = "y"; obj.length = -4294967294; obj.shift(); obj[1] === "y". Actual: ' + (obj[1])); } diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A4_T1.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A4_T1.js index 3a7c667f3c37140034f7654255a2e37f78ff5059..8b7854630856415734057847ccc6c192cfeaf563 100644 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A4_T1.js +++ b/test/built-ins/Array/prototype/shift/S15.4.4.9_A4_T1.js @@ -33,7 +33,9 @@ if (x[1] !== 1) { Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.shift = Array.prototype.shift; -x = {0:0}; +x = { + 0: 0 +}; //CHECK#4 var shift = x.shift(); diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A4_T2.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A4_T2.js index 703c32e109e0a022c8e6eaeae9e655641246690b..20fb5644e3103ec44b374fe77b27d237790443fb 100644 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A4_T2.js +++ b/test/built-ins/Array/prototype/shift/S15.4.4.9_A4_T2.js @@ -11,7 +11,7 @@ description: > ---*/ Array.prototype[1] = -1; -var x = [0,1]; +var x = [0, 1]; x.length = 2; //CHECK#1 @@ -33,7 +33,10 @@ if (x[1] !== -1) { Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.shift = Array.prototype.shift; -x = {0:0,1:1}; +x = { + 0: 0, + 1: 1 +}; //CHECK#4 var shift = x.shift(); diff --git a/test/built-ins/Array/prototype/slice/15.4.4.10-10-c-ii-1.js b/test/built-ins/Array/prototype/slice/15.4.4.10-10-c-ii-1.js index bd1c3658216201a314a61fad9e82185d80df8844..ec1f509d3ac5cee5566e5a567181b8caab39ed5a 100644 --- a/test/built-ins/Array/prototype/slice/15.4.4.10-10-c-ii-1.js +++ b/test/built-ins/Array/prototype/slice/15.4.4.10-10-c-ii-1.js @@ -9,15 +9,15 @@ description: > index property (read-only) exists in Array.prototype (Step 10.c.ii) ---*/ - var arrObj = [1, 2, 3]; +var arrObj = [1, 2, 3]; - Object.defineProperty(Array.prototype, "0", { - value: "test", - writable: false, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + value: "test", + writable: false, + configurable: true +}); - var newArr = arrObj.slice(0, 1); +var newArr = arrObj.slice(0, 1); assert(newArr.hasOwnProperty("0"), 'newArr.hasOwnProperty("0") !== true'); assert.sameValue(newArr[0], 1, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T1.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T1.js index 567f24e6d4c436e569f5ff7751961494f2d62a6f..befb1fd88cc0de419a14a8229fc7033c1fb6daef 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T1.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T1.js @@ -10,8 +10,8 @@ es5id: 15.4.4.10_A1.1_T1 description: length > end > start = 0 ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(0,3); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(0, 3); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T2.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T2.js index 42027f84c2bb499df71f16a28f95c00faa90dc12..5955eb054eff6c18009612c9105b8d29a3f9b707 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T2.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T2.js @@ -10,8 +10,8 @@ es5id: 15.4.4.10_A1.1_T2 description: length > end = start > 0 ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(3,3); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(3, 3); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T3.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T3.js index 29b2074ed88fa2a947c7aab10bf3a4fd0ab5009f..1967fdbca4faeeb43d92c6dd8010037585a07530 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T3.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T3.js @@ -10,8 +10,8 @@ es5id: 15.4.4.10_A1.1_T3 description: length > start > end > 0 ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(4,3); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(4, 3); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T4.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T4.js index 7191ed8e2c019925a6971c2aaded4d3041677c4a..719d7634c5992d066a961d8a1af736701216dbc1 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T4.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T4.js @@ -10,8 +10,8 @@ es5id: 15.4.4.10_A1.1_T4 description: length = end = start > 0 ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(5,5); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(5, 5); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T5.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T5.js index b5ccf106487eb774d331b061e57fd5f0aa2084ea..6c6e24b8599c13d763c91ad676bfef7e2bebd942 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T5.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T5.js @@ -10,8 +10,8 @@ es5id: 15.4.4.10_A1.1_T5 description: length = end > start > 0 ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(3,5); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(3, 5); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T6.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T6.js index c66a6bddf728ce5c8a52d0ec6daa211d349cc581..63a86046ab49ffa563ae8f78193e47f3c3a3906d 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T6.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T6.js @@ -10,8 +10,8 @@ es5id: 15.4.4.10_A1.1_T6 description: length > end > start > 0; ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(2,4); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(2, 4); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T7.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T7.js index 5e1585a5253f6ed2ca0911bb5674a60440a6377d..158c4e01d56114abb954afc3b99abe127293b7c3 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T7.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.1_T7.js @@ -10,8 +10,8 @@ es5id: 15.4.4.10_A1.1_T7 description: end > length > start > 0 ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(3,6); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(3, 6); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.2_T1.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.2_T1.js index efac0d415655a61ee3e6c27f652185264241ae6a..f79bd3d4fe9351b2c1c13524cfb6a4fd0cb86f41 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.2_T1.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.2_T1.js @@ -10,8 +10,8 @@ es5id: 15.4.4.10_A1.2_T1 description: length > end = abs(start), start < 0 ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(-3,3); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(-3, 3); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.2_T2.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.2_T2.js index f424caee999ed3d36e4b63c4e854eee34ce9b5fa..ef60e55af9c5d0900044462bea438aac369b1788 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.2_T2.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.2_T2.js @@ -10,8 +10,8 @@ es5id: 15.4.4.10_A1.2_T2 description: length = end > abs(start), start < 0 ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(-1,5); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(-1, 5); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.2_T3.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.2_T3.js index 8b6018424b336a3e57998e14599b42f02ce761ce..c598e8679140b7dcee5c97b51543b5ecbd643058 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.2_T3.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.2_T3.js @@ -10,8 +10,8 @@ es5id: 15.4.4.10_A1.2_T3 description: abs(start) = length > end > 0, start < 0 ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(-5,1); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(-5, 1); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.2_T4.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.2_T4.js index cddd4790b85014b848ea4bd578333d6f8abeba47..c12138e36761469291e37dab77a62fc8e8411e7b 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.2_T4.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.2_T4.js @@ -10,8 +10,8 @@ es5id: 15.4.4.10_A1.2_T4 description: abs(start) > length = end > 0, start < 0 ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(-9,5); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(-9, 5); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.3_T1.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.3_T1.js index b5d84984f79eecdbfc1aebbbd15964abc646f3a7..664ed6861ad857e438f33e3adef7ed430dffb476 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.3_T1.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.3_T1.js @@ -10,8 +10,8 @@ es5id: 15.4.4.10_A1.3_T1 description: length > abs(end) > start = 0, end < 0 ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(0,-2); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(0, -2); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.3_T2.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.3_T2.js index 0b4c0c2bc189dfedf276c2bca050d71bb0b73b64..761cb1266d79ca4d072fc7c765583f55e635e951 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.3_T2.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.3_T2.js @@ -10,8 +10,8 @@ es5id: 15.4.4.10_A1.3_T2 description: length > abs(end) > start > 0, end < 0 ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(1,-4); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(1, -4); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.3_T3.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.3_T3.js index f14a223e39a89a641d3a0893dee954a0d3607489..37f75f8cb1e2dfa04c71c612735f87e06a08a914 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.3_T3.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.3_T3.js @@ -10,8 +10,8 @@ es5id: 15.4.4.10_A1.3_T3 description: length = abs(end) > start = 0, end < 0 ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(0,-5); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(0, -5); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.3_T4.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.3_T4.js index f544b49f5e50dcf6d609f862a1bac78139184222..c62284187e9e4a4d9c8e776b81130c779f903216 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.3_T4.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.3_T4.js @@ -10,8 +10,8 @@ es5id: 15.4.4.10_A1.3_T4 description: abs(end) > length > start > 0, end < 0 ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(4,-9); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(4, -9); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.4_T1.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.4_T1.js index 91919d2072662366e6abf64be015ba253a344e2a..ac01bd21b09f5dba61a1d99aa6e9d76134caefbd 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.4_T1.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.4_T1.js @@ -10,8 +10,8 @@ es5id: 15.4.4.10_A1.4_T1 description: -length = start < end < 0 ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(-5,-2); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(-5, -2); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.4_T2.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.4_T2.js index b0d708464885563fd6506d999d245aedd00eb378..a08595272ad9fbff9e1c8714278c4a3e64cdac94 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.4_T2.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.4_T2.js @@ -10,8 +10,8 @@ es5id: 15.4.4.10_A1.4_T2 description: -length < start < end < 0 ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(-3,-1); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(-3, -1); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.4_T3.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.4_T3.js index 222609a983c63875ab3b53e076733f1a614d0e45..0942b395b2442e5ee12811c9fc3088b77beb8919 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.4_T3.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.4_T3.js @@ -10,8 +10,8 @@ es5id: 15.4.4.10_A1.4_T3 description: start < -length < end < 0 ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(-9,-1); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(-9, -1); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.4_T4.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.4_T4.js index cb326f2506595c8669dae8f5bcf598eaa8372d58..3536e83a9745604fe6885cf310100c439ed919df 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.4_T4.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.4_T4.js @@ -10,8 +10,8 @@ es5id: 15.4.4.10_A1.4_T4 description: start = end < -length ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(-6,-6); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(-6, -6); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.5_T1.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.5_T1.js index dc61d20fadabbb5bd6a3bb17dbb1280603d8b9c4..47fc27eafee38ff7c037b254407c5c270b8484c3 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.5_T1.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.5_T1.js @@ -8,7 +8,7 @@ es5id: 15.4.4.10_A1.5_T1 description: end === undefined ---*/ -var x = [0,1,2,3,4]; +var x = [0, 1, 2, 3, 4]; var arr = x.slice(3, undefined); //CHECK#1 diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.5_T2.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.5_T2.js index 7bdeb398329a65289d88af7e02b5dcba3b4c7aed..d6423de98cdeb6f2139e0fa61c8caf66e00bad75 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.5_T2.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A1.5_T2.js @@ -8,7 +8,7 @@ es5id: 15.4.4.10_A1.5_T2 description: end is absent ---*/ -var x = [0,1,2,3,4]; +var x = [0, 1, 2, 3, 4]; var arr = x.slice(-2); //CHECK#1 diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.1_T1.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.1_T1.js index d81cd4a98accb75723cb5d971f948435be332615..ceecbe2ae40ad6660100f4bfffac8a433e60d00b 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.1_T1.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.1_T1.js @@ -8,8 +8,8 @@ es5id: 15.4.4.10_A2.1_T1 description: start is not integer ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(2.5,4); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(2.5, 4); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.1_T2.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.1_T2.js index 6c86d2e502db80a3667a7dd0dfa8e6dfe26ecfc3..be2087bab354f6d90f5ba2813cedad693ab94a93 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.1_T2.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.1_T2.js @@ -8,8 +8,8 @@ es5id: 15.4.4.10_A2.1_T2 description: start = NaN ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(NaN,3); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(NaN, 3); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.1_T3.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.1_T3.js index d61be15bf89f413e904a656219d067659c717581..41514e02792d2d3a8adfbab1edcf0ee83e3b1c79 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.1_T3.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.1_T3.js @@ -8,8 +8,8 @@ es5id: 15.4.4.10_A2.1_T3 description: start = Infinity ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(Number.POSITIVE_INFINITY,3); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(Number.POSITIVE_INFINITY, 3); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.1_T4.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.1_T4.js index 86c49a99a64a901286a26c53d7d6df81768cc409..7d1f0fc99be03c222a462472b09cd90d125657f6 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.1_T4.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.1_T4.js @@ -8,8 +8,8 @@ es5id: 15.4.4.10_A2.1_T4 description: start = -Infinity ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(Number.NEGATIVE_INFINITY,3); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(Number.NEGATIVE_INFINITY, 3); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.1_T5.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.1_T5.js index 57e496f09c7ebd47c2fd6de3467f0732475d451d..e0c60b2feaed49a1d10afdd0f54e3293a13823aa 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.1_T5.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.1_T5.js @@ -8,8 +8,15 @@ es5id: 15.4.4.10_A2.1_T5 description: ToInteger use ToNumber ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice({valueOf: function() {return 0}, toString: function() {return 3}},3); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice({ + valueOf: function() { + return 0 + }, + toString: function() { + return 3 + } +}, 3); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.2_T1.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.2_T1.js index 5614b6d5ae786097bffb4d5ff48e188e7372656c..b5274f83b3617cdc42a1581ce9d92aab3ac06d79 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.2_T1.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.2_T1.js @@ -8,8 +8,8 @@ es5id: 15.4.4.10_A2.2_T1 description: end is not integer ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(2,4.5); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(2, 4.5); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.2_T2.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.2_T2.js index 1ba6d497178f36f674e98bcd89a1fc31f3b92c9c..ab712d9ba1cb840a95d89e16f496700fcd3fe02a 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.2_T2.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.2_T2.js @@ -8,8 +8,8 @@ es5id: 15.4.4.10_A2.2_T2 description: end = NaN ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(0,NaN); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(0, NaN); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.2_T3.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.2_T3.js index 71a12e4c5ea7dc170ac80bebc0d2e2e03acf9813..31c4a03593c06c4e8382fc79f2da16adac25a771 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.2_T3.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.2_T3.js @@ -8,8 +8,8 @@ es5id: 15.4.4.10_A2.2_T3 description: end = Infinity ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(0,Number.POSITIVE_INFINITY); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(0, Number.POSITIVE_INFINITY); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.2_T4.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.2_T4.js index b4e12693c4633ee566f7dcea1a3ab338e1e9e0c1..d5f4063e891a12afca5c70cca0444ee0d5b69a53 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.2_T4.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.2_T4.js @@ -8,8 +8,8 @@ es5id: 15.4.4.10_A2.2_T4 description: end = -Infinity ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(0,Number.NEGATIVE_INFINITY); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(0, Number.NEGATIVE_INFINITY); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.2_T5.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.2_T5.js index 17e113c6b9f789b0377cb284945ec2ab3209d8c4..78affa8a2c52f22f538ace675e7e99a900a46e17 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.2_T5.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2.2_T5.js @@ -8,8 +8,15 @@ es5id: 15.4.4.10_A2.2_T5 description: ToInteger use ToNumber ---*/ -var x = [0,1,2,3,4]; -var arr = x.slice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); +var x = [0, 1, 2, 3, 4]; +var arr = x.slice(0, { + valueOf: function() { + return 3 + }, + toString: function() { + return 0 + } +}); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2_T1.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2_T1.js index 2bb88ee4501b1fb01a818bfb3a64c7727ee11021..05fb643f1cfa74e2b39753166d4c0905d11458a3 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2_T1.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2_T1.js @@ -20,7 +20,7 @@ obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; -var arr = obj.slice(0,3); +var arr = obj.slice(0, 3); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2_T2.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2_T2.js index bf6dbdc5297373335b21baacd6b51db7d8a7e76f..0971b1a476c620228ce8139f3b5d7a678b4791e7 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2_T2.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2_T2.js @@ -20,7 +20,7 @@ obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; -var arr = obj.slice(-5,3); +var arr = obj.slice(-5, 3); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2_T3.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2_T3.js index 2d0ef0d240c2e3dba8e36bcf32076b6e3edad3ac..9214694c6ad887aeebe8e860712453bb58df397d 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2_T3.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2_T3.js @@ -20,7 +20,7 @@ obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; -var arr = obj.slice(0,-2); +var arr = obj.slice(0, -2); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2_T4.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2_T4.js index d1aa9d2586e71fa5adfa5215193342341d810adb..398423039fa24e8f3d072d6c712b32cfeb980446 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A2_T4.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A2_T4.js @@ -20,7 +20,7 @@ obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; -var arr = obj.slice(-5,-2); +var arr = obj.slice(-5, -2); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A3_T1.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A3_T1.js index 1a4ad0bb164cae1baa33cb5dfe84d2916185739c..63b69324ba87561b2f1a3f313cdab5f818f70aae 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A3_T1.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A3_T1.js @@ -15,10 +15,10 @@ obj[4294967295] = "y"; obj.length = 4294967296; try { - var arr = obj.slice(0,4294967296); + var arr = obj.slice(0, 4294967296); $ERROR('#1: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.slice(0,4294967296); lead to throwing exception.'); } catch (e) { if (!(e instanceof RangeError)) { - $ERROR('#1.1: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.slice(0,4294967296); lead to throwing exception. Exception is instance of RangeError. Actual: exception is '+e); + $ERROR('#1.1: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.slice(0,4294967296); lead to throwing exception. Exception is instance of RangeError. Actual: exception is ' + e); } } diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A3_T2.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A3_T2.js index 7c65b5fbe85005b0d37e930d6f65db8944b2cc8d..d6d1c630f2d81458ff5a8f423acae62953569c91 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A3_T2.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A3_T2.js @@ -15,10 +15,10 @@ obj[4294967296] = "y"; obj.length = 4294967297; try { - var arr = obj.slice(0,4294967297); + var arr = obj.slice(0, 4294967297); $ERROR('#1: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; var arr = obj.slice(0,4294967297); lead to throwing exception.'); } catch (e) { if (!(e instanceof RangeError)) { - $ERROR('#1.1: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; var arr = obj.slice(0,4294967297); lead to throwing exception. Exception is instance of RangeError. Actual: exception is '+e); + $ERROR('#1.1: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; var arr = obj.slice(0,4294967297); lead to throwing exception. Exception is instance of RangeError. Actual: exception is ' + e); } } diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A3_T3.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A3_T3.js index a5b78f6f080c54c0960bd2cca9e3df72d2bb546e..95da2f223834c4f9522183dfd14ddcdd8c16ac99 100644 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A3_T3.js +++ b/test/built-ins/Array/prototype/slice/S15.4.4.10_A3_T3.js @@ -12,7 +12,7 @@ var obj = {}; obj.slice = Array.prototype.slice; obj[4294967294] = "x"; obj.length = -1; -var arr = obj.slice(4294967294,4294967295); +var arr = obj.slice(4294967294, 4294967295); //CHECK#1 if (arr.length !== 0) { @@ -21,5 +21,5 @@ if (arr.length !== 0) { //CHECK#3 if (arr[0] !== undefined) { - $ERROR('#3: var obj = {}; obj.slice = Array.prototype.slice; obj[4294967294] = "x"; obj.length = 4294967295; var arr = obj.slice(4294967294,4294967295); arr[0] === undefined. Actual: ' + (arr[0])); + $ERROR('#3: var obj = {}; obj.slice = Array.prototype.slice; obj[4294967294] = "x"; obj.length = 4294967295; var arr = obj.slice(4294967294,4294967295); arr[0] === undefined. Actual: ' + (arr[0])); } diff --git a/test/built-ins/Array/prototype/slice/create-non-array.js b/test/built-ins/Array/prototype/slice/create-non-array.js index 9061638d0fe3f95c1fc3f5262dc429b7929e776e..d1cbc45859a782ebe81a783a60e00fe9a6562c59 100644 --- a/test/built-ins/Array/prototype/slice/create-non-array.js +++ b/test/built-ins/Array/prototype/slice/create-non-array.js @@ -16,7 +16,9 @@ info: | 4. If isArray is false, return ? ArrayCreate(length). ---*/ -var obj = { length: 0 }; +var obj = { + length: 0 +}; var callCount = 0; var result; Object.defineProperty(obj, 'constructor', { diff --git a/test/built-ins/Array/prototype/slice/length-exceeding-integer-limit-proxied-array.js b/test/built-ins/Array/prototype/slice/length-exceeding-integer-limit-proxied-array.js index 1d9f80606d0ca617ae76d4312a89eeb2ad1697da..d1839760a147f0bed380201bfdd6588d4fd59fec 100644 --- a/test/built-ins/Array/prototype/slice/length-exceeding-integer-limit-proxied-array.js +++ b/test/built-ins/Array/prototype/slice/length-exceeding-integer-limit-proxied-array.js @@ -30,27 +30,27 @@ array["9007199254740991"] = "9007199254740991"; var proxy = new Proxy(array, { get(t, pk, r) { if (pk === "length") - return 2**53 + 2; + return 2 ** 53 + 2; return Reflect.get(t, pk, r); } }); var result = Array.prototype.slice.call(proxy, 9007199254740989); -assert.compareArray(result, [ "9007199254740989", "9007199254740990" ], - "slice(9007199254740989)"); +assert.compareArray(result, ["9007199254740989", "9007199254740990"], + "slice(9007199254740989)"); var result = Array.prototype.slice.call(proxy, 9007199254740989, 9007199254740990); -assert.compareArray(result, [ "9007199254740989" ], - "slice(9007199254740989, 9007199254740990)"); +assert.compareArray(result, ["9007199254740989"], + "slice(9007199254740989, 9007199254740990)"); var result = Array.prototype.slice.call(proxy, 9007199254740989, 9007199254740996); -assert.compareArray(result, [ "9007199254740989", "9007199254740990" ], - "slice(9007199254740989, 9007199254740996)"); +assert.compareArray(result, ["9007199254740989", "9007199254740990"], + "slice(9007199254740989, 9007199254740996)"); var result = Array.prototype.slice.call(proxy, -2); -assert.compareArray(result, [ "9007199254740989", "9007199254740990" ], - "slice(-2)"); +assert.compareArray(result, ["9007199254740989", "9007199254740990"], + "slice(-2)"); var result = Array.prototype.slice.call(proxy, -2, -1); -assert.compareArray(result, [ "9007199254740989" ], - "slice(-2, -1)"); +assert.compareArray(result, ["9007199254740989"], + "slice(-2, -1)"); diff --git a/test/built-ins/Array/prototype/slice/length-exceeding-integer-limit.js b/test/built-ins/Array/prototype/slice/length-exceeding-integer-limit.js index 2fa32db97c8c09f7d2a98f313360d5869389ef11..d3b4292881ff576a3f145af3967e3ec4dcce13fc 100644 --- a/test/built-ins/Array/prototype/slice/length-exceeding-integer-limit.js +++ b/test/built-ins/Array/prototype/slice/length-exceeding-integer-limit.js @@ -23,25 +23,25 @@ var arrayLike = { "9007199254740989": "9007199254740989", "9007199254740990": "9007199254740990", "9007199254740991": "9007199254740991", - length: 2**53 + 2, + length: 2 ** 53 + 2, }; var result = Array.prototype.slice.call(arrayLike, 9007199254740989); -assert.compareArray(result, [ "9007199254740989", "9007199254740990" ], - "slice(9007199254740989)"); +assert.compareArray(result, ["9007199254740989", "9007199254740990"], + "slice(9007199254740989)"); var result = Array.prototype.slice.call(arrayLike, 9007199254740989, 9007199254740990); -assert.compareArray(result, [ "9007199254740989" ], - "slice(9007199254740989, 9007199254740990)"); +assert.compareArray(result, ["9007199254740989"], + "slice(9007199254740989, 9007199254740990)"); var result = Array.prototype.slice.call(arrayLike, 9007199254740989, 9007199254740996); -assert.compareArray(result, [ "9007199254740989", "9007199254740990" ], - "slice(9007199254740989, 9007199254740996)"); +assert.compareArray(result, ["9007199254740989", "9007199254740990"], + "slice(9007199254740989, 9007199254740996)"); var result = Array.prototype.slice.call(arrayLike, -2); -assert.compareArray(result, [ "9007199254740989", "9007199254740990" ], - "slice(-2)"); +assert.compareArray(result, ["9007199254740989", "9007199254740990"], + "slice(-2)"); var result = Array.prototype.slice.call(arrayLike, -2, -1); -assert.compareArray(result, [ "9007199254740989" ], - "slice(-2, -1)"); +assert.compareArray(result, ["9007199254740989"], + "slice(-2, -1)"); 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 216ca2186fa954324d59cb6444ac8c16240b22f9..d4f780dfae611ed2bbbad8644ab7b06dc5fa87ee 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 @@ -9,5 +9,5 @@ description: Array.prototype.some applied to undefined throws a TypeError assert.throws(TypeError, function() { - Array.prototype.some.call(undefined); + Array.prototype.some.call(undefined); }); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-10.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-10.js index 7c6c28469a0f36909cef68048acb1a2bf97f5327..b0bf38a18ca02a65717af9ff9c609f9be090430e 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-10.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-10.js @@ -7,11 +7,11 @@ es5id: 15.4.4.17-1-10 description: Array.prototype.some applied to the Math object ---*/ - function callbackfn(val, idx, obj) { - return '[object Math]' === Object.prototype.toString.call(obj); - } +function callbackfn(val, idx, obj) { + return '[object Math]' === Object.prototype.toString.call(obj); +} - Math.length = 1; - Math[0] = 1; +Math.length = 1; +Math[0] = 1; assert(Array.prototype.some.call(Math, callbackfn), 'Array.prototype.some.call(Math, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-11.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-11.js index 79081ad78d551b341c01f8f2e838b68ab9760fb4..d61f9594bea2358333ab93e5215ad548ff4ead44 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-11.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-11.js @@ -7,13 +7,13 @@ es5id: 15.4.4.17-1-11 description: Array.prototype.some applied to Date object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Date; - } +function callbackfn(val, idx, obj) { + return obj instanceof Date; +} - var obj = new Date(); - obj.length = 2; - obj[0] = 11; - obj[1] = 9; +var obj = new Date(); +obj.length = 2; +obj[0] = 11; +obj[1] = 9; assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-12.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-12.js index e34099ca7c5a1e48a08cd5370cd70da8ac87eaac..905cf427461a28c0f963f0d7028c059095f2507e 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-12.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-12.js @@ -7,13 +7,13 @@ es5id: 15.4.4.17-1-12 description: Array.prototype.some applied to RegExp object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof RegExp; - } +function callbackfn(val, idx, obj) { + return obj instanceof RegExp; +} - var obj = new RegExp(); - obj.length = 2; - obj[0] = 11; - obj[1] = 9; +var obj = new RegExp(); +obj.length = 2; +obj[0] = 11; +obj[1] = 9; assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-13.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-13.js index 650afc630cbfb71c6e09f1e7b1ce5c5fe3ebbbc7..55105713d59c5eb428090a51867cc4fb2c945878 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-13.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-13.js @@ -7,11 +7,11 @@ es5id: 15.4.4.17-1-13 description: Array.prototype.some applied to the JSON object ---*/ - function callbackfn(val, idx, obj) { - return '[object JSON]' === Object.prototype.toString.call(obj); - } +function callbackfn(val, idx, obj) { + return '[object JSON]' === Object.prototype.toString.call(obj); +} - JSON.length = 1; - JSON[0] = 1; +JSON.length = 1; +JSON[0] = 1; assert(Array.prototype.some.call(JSON, callbackfn), 'Array.prototype.some.call(JSON, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-14.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-14.js index 292ab95afbcfd49c285f65ceae09cb51851c489c..82182878460996715102c282c3bb0f106046ca30 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-14.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-14.js @@ -7,12 +7,12 @@ es5id: 15.4.4.17-1-14 description: Array.prototype.some applied to Error object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Error; - } +function callbackfn(val, idx, obj) { + return obj instanceof Error; +} - var obj = new Error(); - obj.length = 1; - obj[0] = 1; +var obj = new Error(); +obj.length = 1; +obj[0] = 1; assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-15.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-15.js index d4622f376db7028b30ab913718e62dbe013cc8d4..27cfa61dbe9bb3416b74af2f928df64b467f3c0a 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-15.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-15.js @@ -7,12 +7,12 @@ es5id: 15.4.4.17-1-15 description: Array.prototype.some applied to the Arguments object ---*/ - function callbackfn(val, idx, obj) { - return '[object Arguments]' === Object.prototype.toString.call(obj); - } +function callbackfn(val, idx, obj) { + return '[object Arguments]' === Object.prototype.toString.call(obj); +} - var obj = (function () { - return arguments; - }("a", "b")); +var obj = (function() { + return arguments; +}("a", "b")); assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-2.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-2.js index bdcf9c45cd90c2479ff8a220137bc71e49de1680..abc12eef8d03770cd0aaac6c9bd4129b7491c991 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 @@ -9,5 +9,5 @@ description: Array.prototype.some applied to null throws a TypeError assert.throws(TypeError, function() { - Array.prototype.some.call(null); + Array.prototype.some.call(null); }); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-3.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-3.js index 49c698f379eae9bd1ac0e44ff80827e8cfd51932..38edf932d97437e6b0502111fd446c783ec56373 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-3.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-3.js @@ -7,11 +7,11 @@ es5id: 15.4.4.17-1-3 description: Array.prototype.some applied to boolean primitive ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Boolean; - } +function callbackfn(val, idx, obj) { + return obj instanceof Boolean; +} - Boolean.prototype[0] = 1; - Boolean.prototype.length = 1; +Boolean.prototype[0] = 1; +Boolean.prototype.length = 1; assert(Array.prototype.some.call(false, callbackfn), 'Array.prototype.some.call(false, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-4.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-4.js index d17988608a8f4be3b22e88de9340d8c6d39f615c..e025ac0c295c9ebfe4d8b1b827af57c13e9c3512 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-4.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-4.js @@ -7,13 +7,13 @@ es5id: 15.4.4.17-1-4 description: Array.prototype.some applied to Boolean object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Boolean; - } +function callbackfn(val, idx, obj) { + return obj instanceof Boolean; +} - var obj = new Boolean(true); - obj.length = 2; - obj[0] = 11; - obj[1] = 9; +var obj = new Boolean(true); +obj.length = 2; +obj[0] = 11; +obj[1] = 9; assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-5.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-5.js index ce0483b517dbdc51f97a4c5ee007d2ba2d23bc79..827d030efd25aede348b1d3abf94f68e810d2ca7 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-5.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-5.js @@ -7,11 +7,11 @@ es5id: 15.4.4.17-1-5 description: Array.prototype.some applied to number primitive ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Number; - } +function callbackfn(val, idx, obj) { + return obj instanceof Number; +} - Number.prototype[1] = true; - Number.prototype.length = 2; +Number.prototype[1] = true; +Number.prototype.length = 2; assert(Array.prototype.some.call(5, callbackfn), 'Array.prototype.some.call(5, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-6.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-6.js index a5c84bfe5992303bbb6ba025cb68e64be2a1c8ad..78791585ec11f6cb2a4f5f702c0c447b123076db 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-6.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-6.js @@ -7,13 +7,13 @@ es5id: 15.4.4.17-1-6 description: Array.prototype.some applied to Number object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Number; - } +function callbackfn(val, idx, obj) { + return obj instanceof Number; +} - var obj = new Number(-128); - obj.length = 2; - obj[0] = 11; - obj[1] = 9; +var obj = new Number(-128); +obj.length = 2; +obj[0] = 11; +obj[1] = 9; assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-7.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-7.js index c44c66dc3ebcbefe619f1505bafac369106d24d3..f69a384e39a94f05b00320c8c5e015159490feb9 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-7.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-7.js @@ -7,8 +7,8 @@ es5id: 15.4.4.17-1-7 description: Array.prototype.some applied to applied to string primitive ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof String; - } +function callbackfn(val, idx, obj) { + return obj instanceof String; +} assert(Array.prototype.some.call("hello\nw_orld\\!", callbackfn), 'Array.prototype.some.call("hello\nw_orld\\!", callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-8.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-8.js index bbef0f62b1699f012d21046fda29900abe5e53b0..4a439b90ef809427758a96d059a1465624a969f9 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-8.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-8.js @@ -7,10 +7,10 @@ es5id: 15.4.4.17-1-8 description: Array.prototype.some applied to String object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof String; - } +function callbackfn(val, idx, obj) { + return obj instanceof String; +} - var obj = new String("hello\nw_orld\\!"); +var obj = new String("hello\nw_orld\\!"); assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-9.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-9.js index 3dd74e3021c15e924a2350d990ec425a42ca26c7..866d6f61b8577f693fc4112557483ecda6643cdd 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-9.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-9.js @@ -7,14 +7,14 @@ es5id: 15.4.4.17-1-9 description: Array.prototype.some applied to Function object ---*/ - function callbackfn(val, idx, obj) { - return obj instanceof Function; - } +function callbackfn(val, idx, obj) { + return obj instanceof Function; +} - var obj = function (a, b) { - return a + b; - }; - obj[0] = 11; - obj[1] = 9; +var obj = function(a, b) { + return a + b; +}; +obj[0] = 11; +obj[1] = 9; assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-1.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-1.js index b8d3aec50d2da9b44fdad9e30d75926e71a17baf..aa8eeca34cd4fd9a5a00531ad12801ddcc3be7fe 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-1.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-1.js @@ -9,20 +9,20 @@ description: > Array-like object ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var obj = { - 0: 9, - 1: 11, - 2: 12, - length: 2 - }; +var obj = { + 0: 9, + 1: 11, + 2: 12, + length: 2 +}; assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-10.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-10.js index 29409cea907fbe5d166eba9d89bf361b06b97daa..5a97e40fd9bf2efa67319e7ae28ec41af415992b 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-10.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-10.js @@ -9,30 +9,30 @@ description: > on an Array-like object ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } - - function callbackfn2(val, idx, obj) { - return val > 11; - } - - var proto = {}; - - Object.defineProperty(proto, "length", { - get: function () { - return 2; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child[0] = 9; - child[1] = 11; - child[2] = 12; +function callbackfn1(val, idx, obj) { + return val > 10; +} + +function callbackfn2(val, idx, obj) { + return val > 11; +} + +var proto = {}; + +Object.defineProperty(proto, "length", { + get: function() { + return 2; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child[0] = 9; +child[1] = 11; +child[2] = 12; assert(Array.prototype.some.call(child, callbackfn1), 'Array.prototype.some.call(child, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(child, callbackfn2), false, 'Array.prototype.some.call(child, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-11.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-11.js index 41b817a873f5e94cf63c704460c2379717f4945e..04062111969bf524b5c7917927a62c703ceac3d3 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-11.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-11.js @@ -9,21 +9,21 @@ description: > without a get function on an Array-like object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var obj = { - 0: 11, - 1: 12 - }; - Object.defineProperty(obj, "length", { - set: function () { }, - configurable: true - }); +var obj = { + 0: 11, + 1: 12 +}; +Object.defineProperty(obj, "length", { + set: function() {}, + configurable: true +}); assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-12.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-12.js index df83ae028b60fb5d04607ee3445e022f9366a905..0f4f5077fd77f963147a3114e6bc127182652c23 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-12.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-12.js @@ -10,25 +10,28 @@ description: > Array-like object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - Object.defineProperty(Object.prototype, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(Object.prototype, "length", { + get: function() { + return 2; + }, + configurable: true +}); - var obj = { 0: 11, 1: 12 }; - Object.defineProperty(obj, "length", { - set: function () { }, - configurable: true - }); +var obj = { + 0: 11, + 1: 12 +}; +Object.defineProperty(obj, "length", { + set: function() {}, + configurable: true +}); assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-13.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-13.js index d16ce11487448768256a331dc0bef0574cc633fa..568c277050758c98e847c621c19b900101b312fb 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-13.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-13.js @@ -9,25 +9,25 @@ description: > without a get function on an Array-like object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var proto = {}; - Object.defineProperty(proto, "length", { - set: function () { }, - configurable: true - }); +var proto = {}; +Object.defineProperty(proto, "length", { + set: function() {}, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[0] = 11; - child[1] = 12; +var child = new Con(); +child[0] = 11; +child[1] = 12; assert.sameValue(Array.prototype.some.call(child, callbackfn), false, 'Array.prototype.some.call(child, callbackfn)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-14.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-14.js index ce43f05a32457e224c44909117e5f4e2e696c85c..78ee06b3e77fdea79ff15bf52d8256ef761af94a 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-14.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-14.js @@ -9,14 +9,17 @@ description: > Array-like object ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-17.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-17.js index 67829327e3ff1f0d32a8d243bdcfcbf2f212bc4d..21eb5febacd93a91b36d2795e5d314a0c6be3ed2 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-17.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-17.js @@ -9,18 +9,18 @@ description: > implements its own property get method ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var func = function (a, b) { - arguments[2] = 12; - return Array.prototype.some.call(arguments, callbackfn1) && - !Array.prototype.some.call(arguments, callbackfn2); - }; +var func = function(a, b) { + arguments[2] = 12; + return Array.prototype.some.call(arguments, callbackfn1) && + !Array.prototype.some.call(arguments, callbackfn2); +}; assert(func(9, 11), 'func(9, 11) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-18.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-18.js index e640da588ec5fef02ee41c546a45b0fddd11a732..336a943e4ecb9247fdffd1e1e75aacd6ea686ed7 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-18.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-18.js @@ -9,17 +9,17 @@ description: > own property get method ---*/ - function callbackfn1(val, idx, obj) { - return parseInt(val, 10) > 1; - } +function callbackfn1(val, idx, obj) { + return parseInt(val, 10) > 1; +} - function callbackfn2(val, idx, obj) { - return parseInt(val, 10) > 2; - } +function callbackfn2(val, idx, obj) { + return parseInt(val, 10) > 2; +} - var str = new String("12"); +var str = new String("12"); - String.prototype[2] = "3"; +String.prototype[2] = "3"; assert(Array.prototype.some.call(str, callbackfn1), 'Array.prototype.some.call(str, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(str, callbackfn2), false, 'Array.prototype.some.call(str, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-19.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-19.js index a299cbbc789c2faa021a77209c259a30c7037329..07c1ada28befd37909f5087924cc9b70d2aa8e65 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-19.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-19.js @@ -9,20 +9,20 @@ description: > its own property get method ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var fun = function (a, b) { - return a + b; - }; - fun[0] = 9; - fun[1] = 11; - fun[2] = 12; +var fun = function(a, b) { + return a + b; +}; +fun[0] = 9; +fun[1] = 11; +fun[2] = 12; assert(Array.prototype.some.call(fun, callbackfn1), 'Array.prototype.some.call(fun, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(fun, callbackfn2), false, 'Array.prototype.some.call(fun, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-2.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-2.js index e546927edb5c8e3086169823e4dc7f4eeacccc77..e8d870de6401448f415913f21890588deeb02397 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-2.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-2.js @@ -7,15 +7,15 @@ es5id: 15.4.4.17-2-2 description: Array.prototype.some - 'length' is own data property on an Array ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - Array.prototype[2] = 12; +Array.prototype[2] = 12; assert([9, 11].some(callbackfn1), '[9, 11].some(callbackfn1) !== true'); assert.sameValue([9, 11].some(callbackfn2), false, '[9, 11].some(callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-3.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-3.js index d2ef52b08bf32d9e5722e4b1cfb143a179d8c382..f663fb2742cf49989a8d0347e518514a5d807a03 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-3.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-3.js @@ -9,24 +9,26 @@ description: > overrides an inherited data property on an Array-like object ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var proto = { length: 3 }; +var proto = { + length: 3 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 2; - child[0] = 9; - child[1] = 11; - child[2] = 12; +var child = new Con(); +child.length = 2; +child[0] = 9; +child[1] = 11; +child[2] = 12; assert(Array.prototype.some.call(child, callbackfn1), 'Array.prototype.some.call(child, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(child, callbackfn2), false, 'Array.prototype.some.call(child, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-4.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-4.js index e3461b6b2b41f559c9e6c9f2e71f409062167be4..b966fb8c8bc283073a7c7ee3085d7d0cfb248db7 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-4.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-4.js @@ -9,18 +9,19 @@ description: > overrides an inherited data property on an array ---*/ - var arrProtoLen = 0; - function callbackfn1(val, idx, obj) { - return val > 10; - } +var arrProtoLen = 0; - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - arrProtoLen = Array.prototype.length; - Array.prototype.length = 0; - Array.prototype[2] = 12; +function callbackfn2(val, idx, obj) { + return val > 11; +} + +arrProtoLen = Array.prototype.length; +Array.prototype.length = 0; +Array.prototype[2] = 12; assert([9, 11].some(callbackfn1), '[9, 11].some(callbackfn1) !== true'); assert.sameValue([9, 11].some(callbackfn2), false, '[9, 11].some(callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-5.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-5.js index af407300f304966e4d074cbb6d367d7d2fc9e300..6433283d2aa9ca0abcf4d5cd657d380d88299b11 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-5.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-5.js @@ -9,35 +9,35 @@ description: > overrides an inherited accessor property on an Array-like object ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } - - function callbackfn2(val, idx, obj) { - return val > 11; - } - - var proto = {}; - - Object.defineProperty(proto, "length", { - get: function () { - return 3; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - Object.defineProperty(child, "length", { - value: 2, - configurable: true - }); - - child[0] = 9; - child[1] = 11; - child[2] = 12; +function callbackfn1(val, idx, obj) { + return val > 10; +} + +function callbackfn2(val, idx, obj) { + return val > 11; +} + +var proto = {}; + +Object.defineProperty(proto, "length", { + get: function() { + return 3; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +Object.defineProperty(child, "length", { + value: 2, + configurable: true +}); + +child[0] = 9; +child[1] = 11; +child[2] = 12; assert(Array.prototype.some.call(child, callbackfn1), 'Array.prototype.some.call(child, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(child, callbackfn2), false, 'Array.prototype.some.call(child, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-6.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-6.js index c559436e5008961d99e86f7ab5054f75d7ba33e0..2b322c6257f780ab6f946af8884b17b8619ad9b7 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-6.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-6.js @@ -9,23 +9,25 @@ description: > an Array-like object ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var proto = { length: 2 }; +var proto = { + length: 2 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[0] = 9; - child[1] = 11; - child[2] = 12; +var child = new Con(); +child[0] = 9; +child[1] = 11; +child[2] = 12; assert(Array.prototype.some.call(child, callbackfn1), 'Array.prototype.some.call(child, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(child, callbackfn2), false, 'Array.prototype.some.call(child, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-7.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-7.js index 2231966742135c7708d5472adc785d0ffd3a449c..0a3e4b4e68789a6e1501ab3719e05ae65afb6a6b 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-7.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-7.js @@ -9,26 +9,26 @@ description: > Array-like object ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var obj = { }; +var obj = {}; - Object.defineProperty(obj, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return 2; + }, + configurable: true +}); - obj[0] = 9; - obj[1] = 11; - obj[2] = 12; +obj[0] = 9; +obj[1] = 11; +obj[2] = 12; assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-8.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-8.js index 4fd06784b12ea1aaa2f6331f3ed7873af6174c87..9e23a93810298ba37a72b7f40156af43a3c5da68 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-8.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-8.js @@ -9,31 +9,33 @@ description: > overrides an inherited data property on an Array-like object ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var proto = { length: 3 }; +var proto = { + length: 3 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); +var child = new Con(); - Object.defineProperty(child, "length", { - get: function () { - return 2; - }, - configurable: true - }); +Object.defineProperty(child, "length", { + get: function() { + return 2; + }, + configurable: true +}); - child[0] = 9; - child[1] = 11; - child[2] = 12; +child[0] = 9; +child[1] = 11; +child[2] = 12; assert(Array.prototype.some.call(child, callbackfn1), 'Array.prototype.some.call(child, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(child, callbackfn2), false, 'Array.prototype.some.call(child, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-9.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-9.js index efd0405f07a3cf15f384ad9bb5c3333e6c400247..c670d9a8d53a61eb53370e169e25125cf90bb8f4 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-9.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-9.js @@ -9,38 +9,38 @@ description: > overrides an inherited accessor property on an Array-like object ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } - - function callbackfn2(val, idx, obj) { - return val > 11; - } - - var proto = {}; - - Object.defineProperty(proto, "length", { - get: function () { - return 3; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - - Object.defineProperty(child, "length", { - get: function () { - return 2; - }, - configurable: true - }); - - child[0] = 9; - child[1] = 11; - child[2] = 12; +function callbackfn1(val, idx, obj) { + return val > 10; +} + +function callbackfn2(val, idx, obj) { + return val > 11; +} + +var proto = {}; + +Object.defineProperty(proto, "length", { + get: function() { + return 3; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); + +Object.defineProperty(child, "length", { + get: function() { + return 2; + }, + configurable: true +}); + +child[0] = 9; +child[1] = 11; +child[2] = 12; assert(Array.prototype.some.call(child, callbackfn1), 'Array.prototype.some.call(child, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(child, callbackfn2), false, 'Array.prototype.some.call(child, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-1.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-1.js index 75dd25133668e35efd07aa018bef573abdbdd1f7..8f93e82c576b5dd5267b136828ebb8d9521319ee 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-1.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-1.js @@ -7,14 +7,17 @@ es5id: 15.4.4.17-3-1 description: Array.prototype.some - value of 'length' is undefined ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var obj = { 0: 11, length: undefined }; +var obj = { + 0: 11, + length: undefined +}; assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-10.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-10.js index 042091cbff164121c19ac7af876b722bc7b93a75..ef0361216a74d00371a7a5cde16b009a4ba539e4 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-10.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-10.js @@ -7,14 +7,17 @@ es5id: 15.4.4.17-3-10 description: Array.prototype.some - value of 'length' is a number (value is NaN) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var obj = { 0: 11, length: NaN }; +var obj = { + 0: 11, + length: NaN +}; assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-11.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-11.js index 0c0dc91bdac8061b5c72568308017e31cefcdff0..fa9790642168a9904b5b360b63b65ba1968f30dc 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-11.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-11.js @@ -9,15 +9,20 @@ description: > number ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var obj = { 0: 9, 1: 11, 2: 12, length: "2" }; +var obj = { + 0: 9, + 1: 11, + 2: 12, + length: "2" +}; assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-12.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-12.js index 5308096de933c8eb8e80d4933b9bc85da3a8591d..ac407faa9f680405779324dae38633a74ebfba5e 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-12.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-12.js @@ -9,15 +9,20 @@ description: > number ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var obj = { 0: 9, 1: 11, 2: 12, length: "-4294967294" }; +var obj = { + 0: 9, + 1: 11, + 2: 12, + length: "-4294967294" +}; assert.sameValue(Array.prototype.some.call(obj, callbackfn1), false, 'Array.prototype.some.call(obj, callbackfn1)'); assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-13.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-13.js index 127405c68464a682769a1f32ad810817629179cd..dcaa0d724ffd42c4c534def56c550c2aac62b91e 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-13.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-13.js @@ -9,15 +9,20 @@ description: > number ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var obj = { 0: 9, 1: 11, 2: 12, length: "2.5" }; +var obj = { + 0: 9, + 1: 11, + 2: 12, + length: "2.5" +}; assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-14.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-14.js index ac471bf34d5e8f58edeb706db95f69b4e786a62f..77607bfcaf934c3932abb592d78292e52530860b 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-14.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-14.js @@ -7,16 +7,25 @@ es5id: 15.4.4.17-3-14 description: Array.prototype.some - 'length' is a string containing +/-Infinity ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var objOne = { 0: 11, length: "Infinity" }; - var objTwo = { 0: 11, length: "+Infinity" }; - var objThree = { 0: 11, length: "-Infinity" }; +var objOne = { + 0: 11, + length: "Infinity" +}; +var objTwo = { + 0: 11, + length: "+Infinity" +}; +var objThree = { + 0: 11, + length: "-Infinity" +}; assert(Array.prototype.some.call(objOne, callbackfn), 'Array.prototype.some.call(objOne, callbackfn) !== true'); assert(Array.prototype.some.call(objTwo, callbackfn), 'Array.prototype.some.call(objTwo, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-15.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-15.js index 08a39ca38f8ea7f1d1c3ff3f4894fd0757c05888..a74c4bcebdf414aeae1ae17696bb7cb135b3dbab 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-15.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-15.js @@ -9,15 +9,20 @@ description: > exponential number ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var obj = { 0: 9, 1: 11, 2: 12, length: "2E0" }; +var obj = { + 0: 9, + 1: 11, + 2: 12, + length: "2E0" +}; assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-16.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-16.js index 86173aca7800e75f14151353e3bdad43e3e3df65..057f06876502fb5f94d19cf1523bd3f0495a000d 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-16.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-16.js @@ -7,15 +7,20 @@ es5id: 15.4.4.17-3-16 description: Array.prototype.some - 'length' is a string containing a hex number ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var obj = { 0: 9, 1: 11, 2: 12, length: "0x0002" }; +var obj = { + 0: 9, + 1: 11, + 2: 12, + length: "0x0002" +}; assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-17.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-17.js index cf2759e88fec3f1c52a8bb46cd6671e6190bf2ea..857fa9a373ebd772b6bf85ce2ae03e3220600078 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-17.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-17.js @@ -9,15 +9,20 @@ description: > with leading zeros ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var obj = { 0: 9, 1: 11, 2: 12, length: "0002.00" }; +var obj = { + 0: 9, + 1: 11, + 2: 12, + length: "0002.00" +}; assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-18.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-18.js index a8924f21ff29ea7448a0aba479bdf08b279f56a6..13de82ccd07d0d8f90e78a1bfc279bb855bfcece 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-18.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-18.js @@ -9,14 +9,18 @@ description: > convert to a number ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var obj = { 0: 11, 1: 21, length: "two" }; +var obj = { + 0: 11, + 1: 21, + length: "two" +}; assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-19.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-19.js index dddf8132dc8d6c646df57ac862e9a62159b0f71b..c8521e83c380504e40d9503154db28479bd31ed9 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-19.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-19.js @@ -9,27 +9,27 @@ description: > own toString method ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var toStringAccessed = false; - var obj = { - 0: 9, - 1: 11, - 2: 12, +var toStringAccessed = false; +var obj = { + 0: 9, + 1: 11, + 2: 12, - length: { - toString: function () { - toStringAccessed = true; - return '2'; - } - } - }; + length: { + toString: function() { + toStringAccessed = true; + return '2'; + } + } +}; assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-2.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-2.js index 3b90cbdd1b01c4cf5e93658620f76f96b86dab28..2898ce5ae75ad76fc2396b856383adbb11c87e6e 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-2.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-2.js @@ -9,15 +9,19 @@ description: > (length overridden to true(type conversion)) ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var obj = { 0: 11, 1: 12, length: true }; +var obj = { + 0: 11, + 1: 12, + length: true +}; assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-20.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-20.js index af023ef5e8f47dc32e42d8d17466844e948fe48d..9464bc45e2f37f5462f6b9aafab0289315eaa1ac 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-20.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-20.js @@ -9,27 +9,27 @@ description: > own valueOf method ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var valueOfAccessed = false; +var valueOfAccessed = false; - var obj = { - 0: 9, - 1: 11, - 2: 12, - length: { - valueOf: function () { - valueOfAccessed = true; - return 2; - } - } - }; +var obj = { + 0: 9, + 1: 11, + 2: 12, + length: { + valueOf: function() { + valueOfAccessed = true; + return 2; + } + } +}; assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-21.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-21.js index cb1926df0506853630f59a2153eaadff544d5d23..c0d6aa9c8301057796882e62f21d47b006f716b7 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-21.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-21.js @@ -10,32 +10,32 @@ description: > returns a string ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var toStringAccessed = false; - var valueOfAccessed = false; +var toStringAccessed = false; +var valueOfAccessed = false; - var obj = { - 0: 9, - 1: 11, - 2: 12, - length: { - valueOf: function () { - valueOfAccessed = true; - return {}; - }, - toString: function () { - toStringAccessed = true; - return '2'; - } - } - }; +var obj = { + 0: 9, + 1: 11, + 2: 12, + length: { + valueOf: function() { + valueOfAccessed = true; + return {}; + }, + toString: function() { + toStringAccessed = true; + return '2'; + } + } +}; assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)'); 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 a166c39f733e12c039672a07a394cbd0061438bc..1dc3f2b006f38368b047e369993ab6204b8e86b5 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 @@ -10,32 +10,32 @@ description: > primitive values ---*/ - var callbackfnAccessed = false; - var toStringAccessed = false; - var valueOfAccessed = false; +var callbackfnAccessed = false; +var toStringAccessed = false; +var valueOfAccessed = false; - function callbackfn(val, idx, obj) { - callbackfnAccessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + callbackfnAccessed = true; + return val > 10; +} - var obj = { - 0: 11, - 1: 12, +var obj = { + 0: 11, + 1: 12, - length: { - valueOf: function () { - valueOfAccessed = true; - return {}; - }, - toString: function () { - toStringAccessed = true; - return {}; - } - } - }; + length: { + valueOf: function() { + valueOfAccessed = true; + return {}; + }, + toString: function() { + toStringAccessed = true; + return {}; + } + } +}; assert.throws(TypeError, function() { - Array.prototype.some.call(obj, callbackfn); + Array.prototype.some.call(obj, callbackfn); }); assert(toStringAccessed, 'toStringAccessed !== true'); assert(valueOfAccessed, 'valueOfAccessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-23.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-23.js index 29c6dfbbd5fc6d4bf1eab4b08d6b11f533c56bc2..ec119aec4826b9046e5c8b0adaf0ade249777711 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-23.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-23.js @@ -9,40 +9,40 @@ description: > is an object with an own toString and inherited valueOf methods ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } - - function callbackfn2(val, idx, obj) { - return val > 11; - } - - var valueOfAccessed = false; - var toStringAccessed = false; - - var proto = { - valueOf: function () { - valueOfAccessed = true; - return 2; - } - }; - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - - child.toString = function () { - toStringAccessed = true; - return '1'; - }; - - var obj = { - 0: 9, - 1: 11, - 2: 12, - length: child - }; +function callbackfn1(val, idx, obj) { + return val > 10; +} + +function callbackfn2(val, idx, obj) { + return val > 11; +} + +var valueOfAccessed = false; +var toStringAccessed = false; + +var proto = { + valueOf: function() { + valueOfAccessed = true; + return 2; + } +}; + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); + +child.toString = function() { + toStringAccessed = true; + return '1'; +}; + +var obj = { + 0: 9, + 1: 11, + 2: 12, + length: child +}; assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-24.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-24.js index fd95a3234c65369b5750a02cdc6d20a01d495811..562d7fdf153bec11c5261fd03b388ba6ae6f502c 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-24.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-24.js @@ -9,20 +9,20 @@ description: > non-integer, ensure truncation occurs in the proper direction ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var obj = { - 0: 9, - 10: 11, - 11: 12, - length: 11.5 - }; +var obj = { + 0: 9, + 10: 11, + 11: 12, + length: 11.5 +}; assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-25.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-25.js index ef10bed26565425a0089018f0bac71d8454c4b25..e1916896b9ca74d7d3224673c43e45169ef2e3a6 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-25.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-25.js @@ -7,20 +7,20 @@ es5id: 15.4.4.17-3-25 description: Array.prototype.some - value of 'length' is a negative non-integer ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var obj = { - 0: 9, - 1: 11, - 2: 12, - length: -4294967294.5 - }; +var obj = { + 0: 9, + 1: 11, + 2: 12, + length: -4294967294.5 +}; assert.sameValue(Array.prototype.some.call(obj, callbackfn1), false, 'Array.prototype.some.call(obj, callbackfn1)'); assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-28.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-28.js index 31d402e2d14d513e70746553580c02fa09f5221f..b47063417780cfd5825e3ce9b1266bc0f38022c0 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-28.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-28.js @@ -7,17 +7,17 @@ es5id: 15.4.4.17-3-28 description: Array.prototype.some - value of 'length' is boundary value (2^32) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var obj = { - 0: 12, - length: 4294967296 - }; +var obj = { + 0: 12, + length: 4294967296 +}; assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-29.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-29.js index eeca40a0bd7d5857a24928d022a7a84b6dae2f00..132a0ec3b9ecdb0fe13693a80670e900ea0b6d1a 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-29.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-29.js @@ -9,19 +9,19 @@ description: > 1) ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var obj = { - 0: 11, - 1: 12, - length: 4294967297 - }; +var obj = { + 0: 11, + 1: 12, + length: 4294967297 +}; assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true'); assert(Array.prototype.some.call(obj, callbackfn2), 'Array.prototype.some.call(obj, callbackfn2) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-3.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-3.js index 769953764031d6bef0440043e6191d783897cbb2..97637f6a7b3155c23f457bf6f21de0024f908fd0 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-3.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-3.js @@ -7,14 +7,17 @@ es5id: 15.4.4.17-3-3 description: Array.prototype.some - value of 'length' is a number (value is 0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var obj = { 0: 11, length: 0 }; +var obj = { + 0: 11, + length: 0 +}; assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-4.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-4.js index cfcc27fc3062b74de20e210bd25be38866d58758..3a35aa14976cada80532df40fc1ef02aca036dc4 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-4.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-4.js @@ -7,14 +7,17 @@ es5id: 15.4.4.17-3-4 description: Array.prototype.some - value of 'length' is a number (value is +0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var obj = { 0: 11, length: +0 }; +var obj = { + 0: 11, + length: +0 +}; assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-5.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-5.js index 27d31dea75b7cd91d355891b16983b387bc74494..2eddf9891a98f7393dd4be9c6b906b856cb78c17 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-5.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-5.js @@ -7,14 +7,17 @@ es5id: 15.4.4.17-3-5 description: Array.prototype.some - value of 'length' is a number (value is -0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var obj = { 0: 11, length: -0 }; +var obj = { + 0: 11, + length: -0 +}; assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-6.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-6.js index 053e096a9830ca54cd33a566c266d7b594faa4f7..c53b2808f3f0df23d7d8046aa3d5b4e47427657d 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-6.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-6.js @@ -9,15 +9,20 @@ description: > positive) ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var obj = { 0: 9, 1: 11, 2: 12, length: 2 }; +var obj = { + 0: 9, + 1: 11, + 2: 12, + length: 2 +}; assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true'); assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-7.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-7.js index 31de3aa25c00226887623abf01a1f0f34c4d49c8..fcfdbecf295d18670e84f851a0d9f4884007e120 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-7.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-7.js @@ -9,15 +9,20 @@ description: > negative) ---*/ - function callbackfn1(val, idx, obj) { - return val > 10; - } +function callbackfn1(val, idx, obj) { + return val > 10; +} - function callbackfn2(val, idx, obj) { - return val > 11; - } +function callbackfn2(val, idx, obj) { + return val > 11; +} - var obj = { 0: 9, 1: 11, 2: 12, length: -4294967294 }; +var obj = { + 0: 9, + 1: 11, + 2: 12, + length: -4294967294 +}; assert.sameValue(Array.prototype.some.call(obj, callbackfn1), false, 'Array.prototype.some.call(obj, callbackfn1)'); assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-8.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-8.js index f5496a481ff095b6282b2a19e4756cc9539ff55b..6946b1899b5fdca9f2effcae888bace5498b07c4 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-8.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-8.js @@ -9,14 +9,17 @@ description: > Infinity) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var obj = { 0: 11, length: Infinity }; +var obj = { + 0: 11, + length: Infinity +}; assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-3-9.js b/test/built-ins/Array/prototype/some/15.4.4.17-3-9.js index c65f458c0d0bd1fb7a4b59bed62f7ad05d4b8ce9..c0b2c5c15f5e02d7d7bdf7716297975b3bd62b06 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-3-9.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-3-9.js @@ -9,14 +9,17 @@ description: > -Infinity) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var obj = { 0: 11, length: -Infinity }; +var obj = { + 0: 11, + length: -Infinity +}; assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-4-1.js b/test/built-ins/Array/prototype/some/15.4.4.17-4-1.js index 9ff74cac0aab426a0949630e375dec6177ebf902..30976864ef597972ab9dba10f23c24e29585b5d1 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.17-4-1 description: Array.prototype.some throws TypeError if callbackfn is undefined ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.some(); + arr.some(); }); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-4-10.js b/test/built-ins/Array/prototype/some/15.4.4.17-4-10.js index 345f1474c3055f4226fd0f407775d421d256f5d0..3300ce53214a57f15d440988b41cd1a510a29a24 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-4-10.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-4-10.js @@ -9,15 +9,18 @@ description: > was thrown by step 2 ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - Object.defineProperty(obj, "length", { - get: function () { - throw new Test262Error(); - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + throw new Test262Error(); + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.some.call(obj, undefined); + Array.prototype.some.call(obj, undefined); }); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-4-11.js b/test/built-ins/Array/prototype/some/15.4.4.17-4-11.js index 0eec6e6c39ed95f67db8cfd930f565cafd4a2467..d0c7e6a74d5c91f13d6c23d5cee0b0509de9ac81 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-4-11.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-4-11.js @@ -9,19 +9,22 @@ description: > was thrown by step 3 ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - throw new Test262Error(); - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + throw new Test262Error(); + } + }; + }, + configurable: true +}); assert.throws(Test262Error, function() { - Array.prototype.some.call(obj, undefined); + Array.prototype.some.call(obj, undefined); }); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-4-12.js b/test/built-ins/Array/prototype/some/15.4.4.17-4-12.js index a7d7c1f7071c5fe228b1d0edfa75a81e7ac818f1..156090da39395b0da0d4dd2140c545bd174f91a2 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-4-12.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-4-12.js @@ -7,8 +7,8 @@ es5id: 15.4.4.17-4-12 description: Array.prototype.some - 'callbackfn' is a function ---*/ - function callbackfn(val, idx, obj) { - return val > 10; - } +function callbackfn(val, idx, obj) { + return val > 10; +} assert([9, 11].some(callbackfn), '[9, 11].some(callbackfn) !== true'); 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 ef372ed699d43e90ee75c7ccdc7be0e519f65a91..c46be1588f62650c8c2337e0f0489a645cdd5c59 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 @@ -9,26 +9,26 @@ description: > passing undefined for callbackfn ---*/ - var obj = { }; - var lengthAccessed = false; - var loopAccessed = false; +var obj = {}; +var lengthAccessed = false; +var loopAccessed = false; - Object.defineProperty(obj, "length", { - get: function () { - lengthAccessed = true; - return 20; - }, - configurable: true - }); - Object.defineProperty(obj, "0", { - get: function () { - loopAccessed = true; - return 10; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + lengthAccessed = true; + return 20; + }, + configurable: true +}); +Object.defineProperty(obj, "0", { + get: function() { + loopAccessed = true; + return 10; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.some.call(obj); + Array.prototype.some.call(obj); }); 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 8d200ecceb5c37bd1d81031d0973e5bd8fc49fa3..260caee75cfb78c46039dded1f4711f64dc858dc 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 @@ -9,7 +9,7 @@ description: > unreferenced ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(ReferenceError, function() { - arr.some(foo); + 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 79c8e45fdfda159bc9a65cce6a92dcf7c26ab3a3..74b4e4acc7a66db193f188b296f4a390f90a2f47 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.17-4-3 description: Array.prototype.some throws TypeError if callbackfn is null ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.some(null); + 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 9530cb7816d3911eaff0c7165e56b7fc70f0bce5..ef357be26719a6cef208f64fb9cce1e1d556893d 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.17-4-4 description: Array.prototype.some throws TypeError if callbackfn is boolean ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.some(true); + 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 ac6df1f87aabeb586297432c0bd3f9d9f297b580..7a281a2295512c79041e9915b0de2ce9ed295ad7 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.17-4-5 description: Array.prototype.some throws TypeError if callbackfn is number ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.some(5); + 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 530cfb4e1b185ad4bbba3d73a23a85400168852b..7339b3cc4fc84e0c9c47b4610330abccae6109a3 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 @@ -7,7 +7,7 @@ es5id: 15.4.4.17-4-6 description: Array.prototype.some throws TypeError if callbackfn is string ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.some("abc"); + 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 be4508eeb62643cb8773fde1601a013b0641ca6f..06105fd1eb8eb3a62c6b0edf441cca20d020125c 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 @@ -9,7 +9,7 @@ description: > without a Call internal method ---*/ - var arr = new Array(10); +var arr = new Array(10); assert.throws(TypeError, function() { - arr.some(new Object()); + 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 ea4f929348c6bc2695d26ed681b2613171fc72ac..4735534bd559040996defae6551b78be2060f7b5 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 @@ -9,18 +9,21 @@ description: > when an exception occurs ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - accessed = true; - return 2; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + accessed = true; + return 2; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.some.call(obj, null); + Array.prototype.some.call(obj, null); }); 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 ba37bfec5dcfa0ba25abd27f969142161e323877..7e777335911eed93ff7c84e77b09953a777d3946 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 @@ -9,22 +9,25 @@ description: > when an exception occurs ---*/ - var obj = { 0: 11, 1: 12 }; +var obj = { + 0: 11, + 1: 12 +}; - var accessed = false; +var accessed = false; - Object.defineProperty(obj, "length", { - get: function () { - return { - toString: function () { - accessed = true; - return "2"; - } - }; - }, - configurable: true - }); +Object.defineProperty(obj, "length", { + get: function() { + return { + toString: function() { + accessed = true; + return "2"; + } + }; + }, + configurable: true +}); assert.throws(TypeError, function() { - Array.prototype.some.call(obj, null); + Array.prototype.some.call(obj, null); }); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-1-s.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-1-s.js index 737db1039b98d665a19ecd716e2b41e8c370a595..f94bc04c65b6cbe1eb9551c753245fcb0dff4e69 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-1-s.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-1-s.js @@ -8,14 +8,14 @@ description: Array.prototype.some - thisArg not passed to strict callbackfn flags: [noStrict] ---*/ - var innerThisCorrect = false; +var innerThisCorrect = false; - function callbackfn(val, idx, obj) { - "use strict"; - innerThisCorrect = this===undefined; - return true; - } +function callbackfn(val, idx, obj) { + "use strict"; + innerThisCorrect = this === undefined; + return true; +} - [1].some(callbackfn); +[1].some(callbackfn); assert(innerThisCorrect, 'innerThisCorrect !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-1.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-1.js index bbbac58dbfc2f0d17f64253ace2378a63996dd4f..9effb1bb12c1b239f81662e84278ecb70f187b2c 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-1.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-1.js @@ -9,13 +9,13 @@ flags: [noStrict] ---*/ (function() { - this._15_4_4_17_5_1 = false; - var _15_4_4_17_5_1 = true; + this._15_4_4_17_5_1 = false; + var _15_4_4_17_5_1 = true; - function callbackfn(val, idx, obj) { - return this._15_4_4_17_5_1; - } - var arr = [1]; + function callbackfn(val, idx, obj) { + return this._15_4_4_17_5_1; + } + var arr = [1]; -assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)'); + assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)'); })(); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-10.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-10.js index b30a41be92659fda8bc59df7d514248da93a2260..7b9f0b960e0d385b500e7b052f7bdf4232b06d22 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-10.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-10.js @@ -7,10 +7,10 @@ es5id: 15.4.4.17-5-10 description: Array.prototype.some - Array Object can be used as thisArg ---*/ - var objArray = []; +var objArray = []; - function callbackfn(val, idx, obj) { - return this === objArray; - } +function callbackfn(val, idx, obj) { + return this === objArray; +} assert([11].some(callbackfn, objArray), '[11].some(callbackfn, objArray) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-11.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-11.js index 03e69a4aeb614b9b128bc99777ed7b24d978cc94..19c1305d5216cebedec69fd5bbd5aa2a6eaad3c2 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-11.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-11.js @@ -7,10 +7,10 @@ es5id: 15.4.4.17-5-11 description: Array.prototype.some - String object can be used as thisArg ---*/ - var objString = new String(); +var objString = new String(); - function callbackfn(val, idx, obj) { - return this === objString; - } +function callbackfn(val, idx, obj) { + return this === objString; +} assert([11].some(callbackfn, objString), '[11].some(callbackfn, objString) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-12.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-12.js index 79f3e73ee5773eb239eea8c25685769b29da5d23..7f908ab7f16d9ba5e2d7fd81709c8ad00d2db2ea 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-12.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-12.js @@ -7,10 +7,10 @@ es5id: 15.4.4.17-5-12 description: Array.prototype.some - Boolean object can be used as thisArg ---*/ - var objBoolean = new Boolean(); +var objBoolean = new Boolean(); - function callbackfn(val, idx, obj) { - return this === objBoolean; - } +function callbackfn(val, idx, obj) { + return this === objBoolean; +} assert([11].some(callbackfn, objBoolean), '[11].some(callbackfn, objBoolean) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-13.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-13.js index ec80e4d63fc21e21e0f94d4507393929ed8025aa..d5d94de657dca08e98c47993031e5dd18f008add 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-13.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-13.js @@ -7,10 +7,10 @@ es5id: 15.4.4.17-5-13 description: Array.prototype.some - Number object can be used as thisArg ---*/ - var objNumber = new Number(); +var objNumber = new Number(); - function callbackfn(val, idx, obj) { - return this === objNumber; - } +function callbackfn(val, idx, obj) { + return this === objNumber; +} assert([11].some(callbackfn, objNumber), '[11].some(callbackfn, objNumber) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-14.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-14.js index 41ce9be978875cad4802841d8c5ed942e7ade386..93e4deb575c3a833d8d7d2ca46cce872c6b7f702 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-14.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-14.js @@ -7,8 +7,8 @@ es5id: 15.4.4.17-5-14 description: Array.prototype.some - the Math object can be used as thisArg ---*/ - function callbackfn(val, idx, obj) { - return this === Math; - } +function callbackfn(val, idx, obj) { + return this === Math; +} assert([11].some(callbackfn, Math), '[11].some(callbackfn, Math) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-15.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-15.js index 9bca4cb95e9c4a85f16208eb5a6cbe059c146bdd..145681226660e1baf666df1bb8b1c57fc9b126f8 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-15.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-15.js @@ -7,10 +7,10 @@ es5id: 15.4.4.17-5-15 description: Array.prototype.some - Date object can be used as thisArg ---*/ - var objDate = new Date(); +var objDate = new Date(); - function callbackfn(val, idx, obj) { - return this === objDate; - } +function callbackfn(val, idx, obj) { + return this === objDate; +} assert([11].some(callbackfn, objDate), '[11].some(callbackfn, objDate) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-16.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-16.js index 122b6abf640972b4406bd5cbeca52fafd9e956da..e9a56f636b41c4eaeabc771ef35e3f5e87a895b0 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-16.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-16.js @@ -7,10 +7,10 @@ es5id: 15.4.4.17-5-16 description: Array.prototype.some - RegExp object can be used as thisArg ---*/ - var objRegExp = new RegExp(); +var objRegExp = new RegExp(); - function callbackfn(val, idx, obj) { - return this === objRegExp; - } +function callbackfn(val, idx, obj) { + return this === objRegExp; +} assert([11].some(callbackfn, objRegExp), '[11].some(callbackfn, objRegExp) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-17.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-17.js index 344f84d9eceb915618562477a4bc97537fc60563..27ec167f4c93dd1bf06ba12d799afa7dc98ec251 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-17.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-17.js @@ -7,8 +7,8 @@ es5id: 15.4.4.17-5-17 description: Array.prototype.some - the JSON object can be used as thisArg ---*/ - function callbackfn(val, idx, obj) { - return this === JSON; - } +function callbackfn(val, idx, obj) { + return this === JSON; +} assert([11].some(callbackfn, JSON), '[11].some(callbackfn, JSON) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-18.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-18.js index 5d6a3dccde8d149f824379a971f729f34cc0143e..338b3c0dd44790b873e11e64f8f4d47c6662f6c4 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-18.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-18.js @@ -7,10 +7,10 @@ es5id: 15.4.4.17-5-18 description: Array.prototype.some - Error object can be used as thisArg ---*/ - var objError = new RangeError(); +var objError = new RangeError(); - function callbackfn(val, idx, obj) { - return this === objError; - } +function callbackfn(val, idx, obj) { + return this === objError; +} assert([11].some(callbackfn, objError), '[11].some(callbackfn, objError) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-19.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-19.js index 6e702f470c18f667eab6e65ab47d8eb67d36b06b..03815a02d2832e926834f2bb1da9f33e714173cc 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-19.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-19.js @@ -7,14 +7,14 @@ es5id: 15.4.4.17-5-19 description: Array.prototype.some - the Arguments object can be used as thisArg ---*/ - var arg; +var arg; - function callbackfn(val, idx, obj) { - return this === arg; - } +function callbackfn(val, idx, obj) { + return this === arg; +} - (function fun() { - arg = arguments; - }(1, 2, 3)); +(function fun() { + arg = arguments; +}(1, 2, 3)); assert([11].some(callbackfn, arg), '[11].some(callbackfn, arg) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-2.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-2.js index 76776201d49f4368039bbaab2f86a38c497dc083..e0142b343aa284a4ef65ee2412ac4797f6e9cda8 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-2.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-2.js @@ -7,14 +7,15 @@ es5id: 15.4.4.17-5-2 description: Array.prototype.some - thisArg is Object ---*/ - var res = false; - var o = new Object(); - o.res = true; - function callbackfn(val, idx, obj) - { - return this.res; - } +var res = false; +var o = new Object(); +o.res = true; - var arr = [1]; +function callbackfn(val, idx, obj) +{ + return this.res; +} + +var arr = [1]; assert.sameValue(arr.some(callbackfn, o), true, 'arr.some(callbackfn, o)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-21.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-21.js index 974c7f0e8d02c11ef161b79171d895cf08afffd1..e80fe9b22e05da77037f4d188d5590466ff035e7 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-21.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-21.js @@ -8,8 +8,9 @@ description: Array.prototype.some - the global object can be used as thisArg ---*/ var global = this; - function callbackfn(val, idx, obj) { - return this === global; - } + +function callbackfn(val, idx, obj) { + return this === global; +} assert([11].some(callbackfn, this), '[11].some(callbackfn, global) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-22.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-22.js index e61e97a4aeb0eb255515ae22fc33980adffcf21d..44809831212d72e58d68715594890af2b3c3e6b8 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-22.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-22.js @@ -7,8 +7,8 @@ es5id: 15.4.4.17-5-22 description: Array.prototype.some - boolean primitive can be used as thisArg ---*/ - function callbackfn(val, idx, obj) { - return this.valueOf() === false; - } +function callbackfn(val, idx, obj) { + return this.valueOf() === false; +} assert([11].some(callbackfn, false), '[11].some(callbackfn, false) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-23.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-23.js index 3ded5ff2597167b71ed4ed5072c2cbb02b4a8434..a5f030fafe2a6af20426efd04b798dedc62c3641 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-23.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-23.js @@ -7,8 +7,8 @@ es5id: 15.4.4.17-5-23 description: Array.prototype.some - number primitive can be used as thisArg ---*/ - function callbackfn(val, idx, obj) { - return this.valueOf() === 101; - } +function callbackfn(val, idx, obj) { + return this.valueOf() === 101; +} assert([11].some(callbackfn, 101), '[11].some(callbackfn, 101) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-24.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-24.js index 5daa055f1194bcbc8203c94a237c967ba4245146..a1d268d09bc5abe07e489a39df8aa66fb797d075 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-24.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-24.js @@ -7,8 +7,8 @@ es5id: 15.4.4.17-5-24 description: Array.prototype.some - string primitive can be used as thisArg ---*/ - function callbackfn(val, idx, obj) { - return this.valueOf() === "abc"; - } +function callbackfn(val, idx, obj) { + return this.valueOf() === "abc"; +} assert([11].some(callbackfn, "abc"), '[11].some(callbackfn, "abc") !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-25.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-25.js index a20dcd8ad527b8ec79124f020de092fbc46caf74..2c7c60a5a496f7fd05afcc28486a42db7de57754 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-25.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-25.js @@ -8,15 +8,15 @@ description: Array.prototype.some - thisArg not passed flags: [noStrict] ---*/ - function innerObj() { - this._15_4_4_17_5_25 = true; - var _15_4_4_17_5_25 = false; +function innerObj() { + this._15_4_4_17_5_25 = true; + var _15_4_4_17_5_25 = false; - function callbackfn(val, idx, obj) { - return this._15_4_4_17_5_25; - } - var arr = [1]; - this.retVal = !arr.some(callbackfn); - } + function callbackfn(val, idx, obj) { + return this._15_4_4_17_5_25; + } + var arr = [1]; + this.retVal = !arr.some(callbackfn); +} assert(new innerObj().retVal, 'new innerObj().retVal !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-3.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-3.js index 69a2180ccc244ff7bb81b174189a8d6ddc57e923..6e5d2f245e99a92a8c0c9890784d653215e1d1af 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-3.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-3.js @@ -7,14 +7,15 @@ es5id: 15.4.4.17-5-3 description: Array.prototype.some - thisArg is Array ---*/ - var res = false; - var a = new Array(); - a.res = true; - function callbackfn(val, idx, obj) - { - return this.res; - } +var res = false; +var a = new Array(); +a.res = true; - var arr = [1]; +function callbackfn(val, idx, obj) +{ + return this.res; +} + +var arr = [1]; assert.sameValue(arr.some(callbackfn, a), true, 'arr.some(callbackfn, a)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-4.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-4.js index 95351bc9abbfc2042a7bdfd548b92664ae1ffc79..32e813992a7db524794ec73f2728ca8f263e4555 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-4.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-4.js @@ -9,15 +9,16 @@ description: > template(prototype) ---*/ - var res = false; - function callbackfn(val, idx, obj) - { - return this.res; - } +var res = false; - function foo(){} - foo.prototype.res = true; - var f = new foo(); - var arr = [1]; +function callbackfn(val, idx, obj) +{ + return this.res; +} -assert.sameValue(arr.some(callbackfn,f), true, 'arr.some(callbackfn,f)'); +function foo() {} +foo.prototype.res = true; +var f = new foo(); +var arr = [1]; + +assert.sameValue(arr.some(callbackfn, f), true, 'arr.some(callbackfn,f)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-5.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-5.js index 3831816431def7d91bfa493daac51cff4c773bed..6b946e865a79c04ee49e56bd87c2756f41ef0a1d 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-5.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-5.js @@ -7,15 +7,16 @@ es5id: 15.4.4.17-5-5 description: Array.prototype.some - thisArg is object from object template ---*/ - var res = false; - function callbackfn(val, idx, obj) - { - return this.res; - } +var res = false; - function foo(){} - var f = new foo(); - f.res = true; - var arr = [1]; +function callbackfn(val, idx, obj) +{ + return this.res; +} -assert.sameValue(arr.some(callbackfn,f), true, 'arr.some(callbackfn,f)'); +function foo() {} +var f = new foo(); +f.res = true; +var arr = [1]; + +assert.sameValue(arr.some(callbackfn, f), true, 'arr.some(callbackfn,f)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-6.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-6.js index f7213225c0d0f7c4285ade5e032db4c120a6fb73..e0d0749176bf6a0ddc5eb1e816d9135195493cce 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-6.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-6.js @@ -7,14 +7,15 @@ es5id: 15.4.4.17-5-6 description: Array.prototype.some - thisArg is function ---*/ - var res = false; - function callbackfn(val, idx, obj) - { - return this.res; - } +var res = false; - function foo(){} - foo.res = true; - var arr = [1]; +function callbackfn(val, idx, obj) +{ + return this.res; +} -assert.sameValue(arr.some(callbackfn,foo), true, 'arr.some(callbackfn,foo)'); +function foo() {} +foo.res = true; +var arr = [1]; + +assert.sameValue(arr.some(callbackfn, foo), true, 'arr.some(callbackfn,foo)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-7.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-7.js index f4198a8b0624927665606295dde3135405bc3a18..ae6c1fd3d644bad1608a79bae3aff151815a5ee6 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-7.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-7.js @@ -7,8 +7,8 @@ es5id: 15.4.4.17-5-7 description: Array.prototype.some - built-in functions can be used as thisArg ---*/ - function callbackfn(val, idx, obj) { - return this === eval; - } +function callbackfn(val, idx, obj) { + return this === eval; +} assert([11].some(callbackfn, eval), '[11].some(callbackfn, eval) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-9.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-9.js index 501906bf9a1e11aaff42d4ec2252f476a522ec34..155ab3fd2af8a3746d678ae14f503f4a627d2fb3 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-9.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-9.js @@ -7,10 +7,10 @@ es5id: 15.4.4.17-5-9 description: Array.prototype.some - Function Object can be used as thisArg ---*/ - var objFunction = function () { }; +var objFunction = function() {}; - function callbackfn(val, idx, obj) { - return this === objFunction; - } +function callbackfn(val, idx, obj) { + return this === objFunction; +} assert([11].some(callbackfn, objFunction), '[11].some(callbackfn, objFunction) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-1.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-1.js index 5935681cbcffc904e230f5f6e366e6ad0cd40573..081c7a7889b1d154714941248dd55e6e4267b82f 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-1.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-1.js @@ -9,19 +9,19 @@ description: > it is called ---*/ - var calledForThree = false; +var calledForThree = false; - function callbackfn(val, idx, obj) - { - arr[2] = 3; - if(val !== 3) - calledForThree = true; +function callbackfn(val, idx, obj) +{ + arr[2] = 3; + if (val !== 3) + calledForThree = true; - return false; - } + return false; +} - var arr = [1,2,,4,5]; +var arr = [1, 2, , 4, 5]; - var val = arr.some(callbackfn); +var val = arr.some(callbackfn); assert(calledForThree, 'calledForThree !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-2.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-2.js index 8429933e0878e3a666bd89a009f6547f0b6a3d90..117aeb73863635c18e3a98f2700dde20c8c01632 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-2.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-2.js @@ -9,16 +9,16 @@ description: > after it is called ---*/ - function callbackfn(val, idx, obj) - { - arr[4] = 6; - if(val < 6) - return false; - else - return true; - } +function callbackfn(val, idx, obj) +{ + arr[4] = 6; + if (val < 6) + return false; + else + return true; +} - var arr = [1,2,3,4,5]; +var arr = [1, 2, 3, 4, 5]; assert.sameValue(arr.some(callbackfn), true, 'arr.some(callbackfn)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-3.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-3.js index d27cbb211ce40bcd5f5d5953b16e0c5e9635d0f7..8b193f9333d1b77de426653dfd573973ba50eddc 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-3.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-3.js @@ -9,16 +9,16 @@ description: > it is called ---*/ - function callbackfn(val, idx, obj) - { - delete arr[2]; - if(val !== 3) - return false; - else - return true; - } +function callbackfn(val, idx, obj) +{ + delete arr[2]; + if (val !== 3) + return false; + else + return true; +} - var arr = [1,2,3,4,5]; +var arr = [1, 2, 3, 4, 5]; assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-4.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-4.js index 5b060256f559f8141bb8af53e039338345da2872..7d683efcf8999de34535e3624c47549765c4f42a 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-4.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-4.js @@ -9,16 +9,16 @@ description: > Array.length is decreased ---*/ - function callbackfn(val, idx, obj) - { - arr.length = 3; - if(val < 4) - return false; - else - return true; - } +function callbackfn(val, idx, obj) +{ + arr.length = 3; + if (val < 4) + return false; + else + return true; +} - var arr = [1,2,3,4,6]; +var arr = [1, 2, 3, 4, 6]; assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-5.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-5.js index 89a9a1770e746f77bc2a4d6b12a36e8a8438b4b4..19fbb07fc599be50a665dba320bea929cd7d2129 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-5.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-5.js @@ -9,18 +9,18 @@ description: > sparse array ---*/ - function callbackfn(val, idx, obj) - { - arr[1000] = 5; - if(val < 5) - return false; - else - return true; - } +function callbackfn(val, idx, obj) +{ + arr[1000] = 5; + if (val < 5) + return false; + else + return true; +} - var arr = new Array(10); - arr[1] = 1; - arr[2] = 2; +var arr = new Array(10); +arr[1] = 1; +arr[2] = 2; assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-6.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-6.js index e8da5fae68cf56d2e96f2566b21756d07fb34e24..a5f38a483bfd4d863b75f61a99123510806e7997 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-6.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-6.js @@ -9,20 +9,20 @@ description: > call when same index is also present in prototype ---*/ - function callbackfn(val, idx, obj) - { - delete arr[4]; - if(val < 5) - return false; - else - return true; - } +function callbackfn(val, idx, obj) +{ + delete arr[4]; + if (val < 5) + return false; + else + return true; +} - Array.prototype[4] = 5; - var arr = [1,2,3,4,5]; +Array.prototype[4] = 5; +var arr = [1, 2, 3, 4, 5]; - var res = arr.some(callbackfn) ; - delete Array.prototype[4]; +var res = arr.some(callbackfn); +delete Array.prototype[4]; assert.sameValue(res, true, 'res'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-8.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-8.js index e257955c9cbcf5650f72cbdea76b5ffed2c901b7..2712e0c85bd455a6713c8036e61469c894137a1b 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-8.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-8.js @@ -7,14 +7,18 @@ es5id: 15.4.4.17-7-8 description: Array.prototype.some - no observable effects occur if length is 0 ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; - } +function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; +} - var obj = { 0: 11, 1: 12, length: 0 }; +var obj = { + 0: 11, + 1: 12, + length: 0 +}; assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-9.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-9.js index 312351df044d679fe493179c352fa2eb29e83a51..d07c519b087a1662f9c07930f509dc835226f43e 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-9.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-9.js @@ -9,22 +9,26 @@ description: > of iterations ---*/ - var called = 0; +var called = 0; - function callbackfn(val, idx, obj) { - called++; - return val > 10; - } +function callbackfn(val, idx, obj) { + called++; + return val > 10; +} - var obj = { 0: 9, 2: 12, length: 3 }; +var obj = { + 0: 9, + 2: 12, + length: 3 +}; - Object.defineProperty(obj, "1", { - get: function () { - obj.length = 2; - return 8; - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + obj.length = 2; + return 8; + }, + configurable: true +}); assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); assert.sameValue(called, 3, 'called'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-1.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-1.js index 997bac9825d765bdb9ddfcadc7a1db1b25b9bee8..b6b52b0996fb1ad9940c8635047f666aba23cc94 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-1.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-1.js @@ -9,15 +9,16 @@ description: > been assigned values ---*/ - var callCnt = 0; - function callbackfn(val, idx, obj) - { - callCnt++; - return false; - } +var callCnt = 0; - var arr = new Array(10); - arr[1] = undefined; - arr.some(callbackfn); +function callbackfn(val, idx, obj) +{ + callCnt++; + return false; +} + +var arr = new Array(10); +arr[1] = undefined; +arr.some(callbackfn); assert.sameValue(callCnt, 1, 'callCnt'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-10.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-10.js index acddf79b869a40f42073f4fe2df101a7cc51525b..008b55632cb7634c89974fd598342dcf6efd422d 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-10.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-10.js @@ -9,22 +9,26 @@ description: > prototype index property not to be visited on an Array-like Object ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return idx === 1; - } - var arr = { 2: 2, length: 20 }; +var accessed = false; - Object.defineProperty(arr, "0", { - get: function () { - delete Object.prototype[1]; - return 0; - }, - configurable: true - }); +function callbackfn(val, idx, obj) { + accessed = true; + return idx === 1; +} +var arr = { + 2: 2, + length: 20 +}; - Object.prototype[1] = 1; +Object.defineProperty(arr, "0", { + get: function() { + delete Object.prototype[1]; + return 0; + }, + configurable: true +}); + +Object.prototype[1] = 1; assert.sameValue(Array.prototype.some.call(arr, callbackfn), false, 'Array.prototype.some.call(arr, callbackfn)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-11.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-11.js index e7f1170a9e4439274d289683cdfddc9b95ce7636..3e457ac48ed7a3c8ac4e026ab53cdd9b76b329c9 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-11.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-11.js @@ -9,22 +9,23 @@ description: > prototype index property not to be visited on an Array ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return idx === 1; - } - var arr = [0, , 2]; +var accessed = false; - Object.defineProperty(arr, "0", { - get: function () { - delete Array.prototype[1]; - return 0; - }, - configurable: true - }); +function callbackfn(val, idx, obj) { + accessed = true; + return idx === 1; +} +var arr = [0, , 2]; - Array.prototype[1] = 1; +Object.defineProperty(arr, "0", { + get: function() { + delete Array.prototype[1]; + return 0; + }, + configurable: true +}); + +Array.prototype[1] = 1; assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-12.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-12.js index e575c9fd6dc07f697af67c7e6bddf8610c044a94..2eeb1e90c19ce4fdfd612de3cfd8910d5591c46a 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-12.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-12.js @@ -10,23 +10,28 @@ description: > Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 1) { - return true; - } else { - return false; - } - } - var arr = { 0: 0, 1: 111, 2: 2, length: 10 }; +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 1) { + return true; + } else { + return false; + } +} +var arr = { + 0: 0, + 1: 111, + 2: 2, + length: 10 +}; - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); - Object.prototype[1] = 1; +Object.prototype[1] = 1; assert(Array.prototype.some.call(arr, callbackfn), 'Array.prototype.some.call(arr, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-13.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-13.js index 4f1afb3af38c4fa0b0a42b398cde4bfc4a5a25ef..c15b1fade7625680ecc1eed32383db57cc76f6a7 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-13.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-13.js @@ -9,23 +9,23 @@ description: > property causes prototype index property to be visited on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 1) { - return true; - } else { - return false; - } - } - var arr = [0, 111, 2]; +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 1) { + return true; + } else { + return false; + } +} +var arr = [0, 111, 2]; - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); - Array.prototype[1] = 1; +Array.prototype[1] = 1; assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-14.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-14.js index db0bf87e45aa7f022dd24023fae15fe9e41da43c..ebcb32a5652f37c7d7d9389b9c563753b58202c5 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-14.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-14.js @@ -9,20 +9,21 @@ description: > property not to be visited ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return idx === 3; - } - var arr = [0, 1, 2, "last"]; +var accessed = false; - Object.defineProperty(arr, "0", { - get: function () { - arr.length = 3; - return 0; - }, - configurable: true - }); +function callbackfn(val, idx, obj) { + accessed = true; + return idx === 3; +} +var arr = [0, 1, 2, "last"]; + +Object.defineProperty(arr, "0", { + get: function() { + arr.length = 3; + return 0; + }, + configurable: true +}); assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-15.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-15.js index 7c46475047177f3af9f36b73d4406432192cbdbd..69f8f9a6c0ddcd8c2b6bc014f6fcf873b04d74b9 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-15.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-15.js @@ -9,28 +9,28 @@ description: > property causes prototype index property to be visited ---*/ - function callbackfn(val, idx, obj) { - if (idx === 2 && val === "prototype") { - return true; - } else { - return false; - } - } - var arr = [0, 1, 2]; +function callbackfn(val, idx, obj) { + if (idx === 2 && val === "prototype") { + return true; + } else { + return false; + } +} +var arr = [0, 1, 2]; - Object.defineProperty(Array.prototype, "2", { - get: function () { - return "prototype"; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "2", { + get: function() { + return "prototype"; + }, + configurable: true +}); - Object.defineProperty(arr, "1", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-16.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-16.js index 21fb924b0813247f46efd8fed2498891f78844ec..86c3b3c000ff8a41707de54964bd5c4e884bd6e2 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-16.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-16.js @@ -10,29 +10,29 @@ description: > flags: [noStrict] ---*/ - function callbackfn(val, idx, obj) { - if (idx === 2 && val === "unconfigurable") { - return true; - } else { - return false; - } - } +function callbackfn(val, idx, obj) { + if (idx === 2 && val === "unconfigurable") { + return true; + } else { + return false; + } +} - var arr = [0, 1, 2]; +var arr = [0, 1, 2]; - Object.defineProperty(arr, "2", { - get: function () { - return "unconfigurable"; - }, - configurable: false - }); +Object.defineProperty(arr, "2", { + get: function() { + return "unconfigurable"; + }, + configurable: false +}); - Object.defineProperty(arr, "1", { - get: function () { - arr.length = 2; - return 1; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + arr.length = 2; + return 1; + }, + configurable: true +}); assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-2.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-2.js index e1dedd411646e3c267ca46ad5f374804640dbb95..abf9b78b9852a3a4157eebc7e9ea9e6b8a0392ab 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-2.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-2.js @@ -7,22 +7,22 @@ es5id: 15.4.4.17-7-b-2 description: Array.prototype.some - added properties in step 2 are visible here ---*/ - function callbackfn(val, idx, obj) { - if (idx === 2 && val === "length") { - return true; - } else { - return false; - } - } +function callbackfn(val, idx, obj) { + if (idx === 2 && val === "length") { + return true; + } else { + return false; + } +} - var arr = { }; +var arr = {}; - Object.defineProperty(arr, "length", { - get: function () { - arr[2] = "length"; - return 3; - }, - configurable: true - }); +Object.defineProperty(arr, "length", { + get: function() { + arr[2] = "length"; + return 3; + }, + configurable: true +}); assert(Array.prototype.some.call(arr, callbackfn), 'Array.prototype.some.call(arr, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-3.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-3.js index fa54b0595c7319a1b0c86a8392901a49f7714eaa..2193d2469ba3c61dcfb229e8a2b5f8ff7743a80b 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-3.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-3.js @@ -9,20 +9,24 @@ description: > here ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return idx === 2; - } - var arr = { 2: 6.99, 8: 19}; +var accessed = false; - Object.defineProperty(arr, "length", { - get: function () { - delete arr[2]; - return 10; - }, - configurable: true - }); +function callbackfn(val, idx, obj) { + accessed = true; + return idx === 2; +} +var arr = { + 2: 6.99, + 8: 19 +}; + +Object.defineProperty(arr, "length", { + get: function() { + delete arr[2]; + return 10; + }, + configurable: true +}); assert.sameValue(Array.prototype.some.call(arr, callbackfn), false, 'Array.prototype.some.call(arr, callbackfn)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-4.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-4.js index 2f3a8122ddd586ba8b5b1168d081a2d724139265..8b02ca3362342998b9755d71a1adeaa33def759a 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-4.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-4.js @@ -9,27 +9,29 @@ description: > current position are visited on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 1) { - return true; - } else { - return false; - } - } +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 1) { + return true; + } else { + return false; + } +} - var arr = { length: 2 }; +var arr = { + length: 2 +}; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(arr, "1", { - get: function () { - return 1; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(arr, "1", { + get: function() { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); assert(Array.prototype.some.call(arr, callbackfn), 'Array.prototype.some.call(arr, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-5.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-5.js index c808200a94f8a79b44284a121288097dbd037a3e..ab0a8e637efd1f32c7df0f824e9b8a3d11fc3436 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-5.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-5.js @@ -9,27 +9,27 @@ description: > current position are visited on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 1) { - return true; - } else { - return false; - } - } +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 1) { + return true; + } else { + return false; + } +} - var arr = [0, , 2]; +var arr = [0, , 2]; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(arr, "1", { - get: function () { - return 1; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(arr, "1", { + get: function() { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-6.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-6.js index b57354dc52c3b39e411b45740d3320b690b3238d..804282bc152baf12bfe7a1c866fd52790fed7ffd 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-6.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-6.js @@ -9,26 +9,28 @@ description: > current position are visited on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 6.99) { - return true; - } else { - return false; - } - } - var arr = { length: 2 }; +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 6.99) { + return true; + } else { + return false; + } +} +var arr = { + length: 2 +}; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(Object.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(Object.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); assert(Array.prototype.some.call(arr, callbackfn), 'Array.prototype.some.call(arr, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-7.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-7.js index 5dd76771beaf9d2942cabd887b0a35be626bc2d1..921e832ae0f80b41019b8066258869d4e47ab8fd 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-7.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-7.js @@ -9,26 +9,26 @@ description: > current position are visited on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1 && val === 6.99) { - return true; - } else { - return false; - } - } - var arr = [0, , 2]; +function callbackfn(val, idx, obj) { + if (idx === 1 && val === 6.99) { + return true; + } else { + return false; + } +} +var arr = [0, , 2]; - Object.defineProperty(arr, "0", { - get: function () { - Object.defineProperty(Array.prototype, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + Object.defineProperty(Array.prototype, "1", { + get: function() { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true +}); assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-8.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-8.js index b99ca81540089a0b366762e034c1936e6dc39d96..0ec7f33936d5de4a76ac400dcc2544f1c4e3c86e 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-8.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-8.js @@ -9,27 +9,30 @@ description: > not to be visited on an Array-like object ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return idx === 1; - } - var arr = { length: 2 }; +var accessed = false; - Object.defineProperty(arr, "1", { - get: function () { - return 6.99; - }, - configurable: true - }); +function callbackfn(val, idx, obj) { + accessed = true; + return idx === 1; +} +var arr = { + length: 2 +}; - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + return 6.99; + }, + configurable: true +}); + +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); assert.sameValue(Array.prototype.some.call(arr, callbackfn), false, 'Array.prototype.some.call(arr, callbackfn)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-9.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-9.js index 389a129ad55c5726f80fcefb3f46fc8cc562066e..42272384d677b6c6baf3c8dbac04e0d86fdc786d 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-9.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-9.js @@ -9,27 +9,28 @@ description: > not to be visited on an Array ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return idx === 1; - } - var arr = [1, 2]; +var accessed = false; - Object.defineProperty(arr, "1", { - get: function () { - return "6.99"; - }, - configurable: true - }); +function callbackfn(val, idx, obj) { + accessed = true; + return idx === 1; +} +var arr = [1, 2]; - Object.defineProperty(arr, "0", { - get: function () { - delete arr[1]; - return 0; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + return "6.99"; + }, + configurable: true +}); + +Object.defineProperty(arr, "0", { + get: function() { + delete arr[1]; + return 0; + }, + configurable: true +}); assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-1.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-1.js index 7d22a36d5fc26c7c1ef0afcbd053b72e04da9afd..4f4115e5874780ffadf27dd95721fe4dac974084 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-1.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-1.js @@ -9,15 +9,18 @@ description: > property on an Array-like object ---*/ - var kValue = {}; +var kValue = {}; - function callbackfn(val, idx, obj) { - if (idx === 5) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 5) { + return val === kValue; + } + return false; +} - var obj = { 5: kValue, length: 100 }; +var obj = { + 5: kValue, + length: 100 +}; assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-10.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-10.js index 32488b4883cd7d58b62ffbc1d186a38ba8e73d86..85226cf16c9f8389dc1c3844238fc4e7694e50bc 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-10.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-10.js @@ -9,22 +9,22 @@ description: > property on an Array ---*/ - var kValue = "abc"; +var kValue = "abc"; - function callbackfn(val, idx, obj) { - if (idx === 10) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 10) { + return val === kValue; + } + return false; +} - var arr = []; +var arr = []; - Object.defineProperty(arr, "10", { - get: function () { - return kValue; - }, - configurable: true - }); +Object.defineProperty(arr, "10", { + get: function() { + return kValue; + }, + configurable: true +}); assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-11.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-11.js index bbd62f9dcb37537b183fae8ed0d40bf4da09dc66..f0c2c4a1501d9076a6fd9b519457f44c5b62e202 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-11.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-11.js @@ -10,28 +10,30 @@ description: > Array-like object ---*/ - var kValue = "abc"; - - function callbackfn(val, idx, obj) { - if (idx === 1) { - return val === kValue; - } - return false; - } - - var proto = { 1: 6 }; - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 10; - - Object.defineProperty(child, "1", { - get: function () { - return kValue; - }, - configurable: true - }); +var kValue = "abc"; + +function callbackfn(val, idx, obj) { + if (idx === 1) { + return val === kValue; + } + return false; +} + +var proto = { + 1: 6 +}; + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 10; + +Object.defineProperty(child, "1", { + get: function() { + return kValue; + }, + configurable: true +}); assert(Array.prototype.some.call(child, callbackfn), 'Array.prototype.some.call(child, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-12.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-12.js index 94c83d5545730557934afa24273fb6c28745ff4a..753d317a6d6827d01bb9791f9754f6a5688e9979 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-12.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-12.js @@ -9,23 +9,23 @@ description: > property that overrides an inherited data property on an Array ---*/ - var kValue = "abc"; +var kValue = "abc"; - function callbackfn(val, idx, obj) { - if (idx === 1) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + return val === kValue; + } + return false; +} - var arr = []; +var arr = []; - Array.prototype[1] = 100; - Object.defineProperty(arr, "1", { - get: function () { - return kValue; - }, - configurable: true - }); +Array.prototype[1] = 100; +Object.defineProperty(arr, "1", { + get: function() { + return kValue; + }, + configurable: true +}); assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-13.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-13.js index 329d300014c61ef742e99a75c18b9bd3af72a201..e358b560c7ba52159a31ab2137d93b6b3c412c56 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-13.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-13.js @@ -10,36 +10,36 @@ description: > Array-like object ---*/ - var kValue = "abc"; - - function callbackfn(val, idx, obj) { - if (idx === 1) { - return val === kValue; - } - return false; - } - - var proto = {}; - - Object.defineProperty(proto, "1", { - get: function () { - return 5; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 10; - - Object.defineProperty(child, "1", { - get: function () { - return kValue; - }, - configurable: true - }); +var kValue = "abc"; + +function callbackfn(val, idx, obj) { + if (idx === 1) { + return val === kValue; + } + return false; +} + +var proto = {}; + +Object.defineProperty(proto, "1", { + get: function() { + return 5; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 10; + +Object.defineProperty(child, "1", { + get: function() { + return kValue; + }, + configurable: true +}); assert(Array.prototype.some.call(child, callbackfn), 'Array.prototype.some.call(child, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-14.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-14.js index b96e60a53560f3f7f9c92f189b42034c2cce058c..bdb2d85ab3fef9988ffcd5a46f5dbbc6128a4223 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-14.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-14.js @@ -9,28 +9,28 @@ description: > property that overrides an inherited accessor property on an Array ---*/ - var kValue = "abc"; +var kValue = "abc"; - function callbackfn(val, idx, obj) { - if (idx === 1) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + return val === kValue; + } + return false; +} - var arr = []; - Object.defineProperty(arr, "1", { - get: function () { - return kValue; - }, - configurable: true - }); +var arr = []; +Object.defineProperty(arr, "1", { + get: function() { + return kValue; + }, + configurable: true +}); - Object.defineProperty(Array.prototype, "1", { - get: function () { - return 10; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "1", { + get: function() { + return 10; + }, + configurable: true +}); assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-15.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-15.js index 7f862aaad3a58538d8a96608761ddcaeaee816de..f357611b9b890a23c92b3b907161ae8e333a5823 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-15.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-15.js @@ -9,28 +9,28 @@ description: > accessor property on an Array-like object ---*/ - var kValue = "abc"; +var kValue = "abc"; - function callbackfn(val, idx, obj) { - if (idx === 1) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + return val === kValue; + } + return false; +} - var proto = {}; +var proto = {}; - Object.defineProperty(proto, "1", { - get: function () { - return kValue; - }, - configurable: true - }); +Object.defineProperty(proto, "1", { + get: function() { + return kValue; + }, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 20; +var child = new Con(); +child.length = 20; assert(Array.prototype.some.call(child, callbackfn), 'Array.prototype.some.call(child, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-16.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-16.js index ee3cf2adb0214c7feb51eae01cbdc82534d07904..f610a757ffc39d72a8913006b36df27fd5fd6a7a 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-16.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-16.js @@ -9,20 +9,20 @@ description: > accessor property on an Array ---*/ - var kValue = "abc"; +var kValue = "abc"; - function callbackfn(val, idx, obj) { - if (idx === 1) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + return val === kValue; + } + return false; +} - Object.defineProperty(Array.prototype, "1", { - get: function () { - return kValue; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "1", { + get: function() { + return kValue; + }, + configurable: true +}); assert([, , ].some(callbackfn), '[, , ].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-17.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-17.js index b4113bdbcd49e4864a922cd13bebf1f591727912..f3206fd63b6f9c093e12eb429c48be37806aa7ab 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-17.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-17.js @@ -9,17 +9,19 @@ description: > property without a get function on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1) { - return typeof val === "undefined"; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + return typeof val === "undefined"; + } + return false; +} - var obj = { length: 2 }; - Object.defineProperty(obj, "1", { - set: function () { }, - configurable: true - }); +var obj = { + length: 2 +}; +Object.defineProperty(obj, "1", { + set: function() {}, + configurable: true +}); assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-18.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-18.js index 41742e98153b88cd319585384b19054a1935ccd9..55f64f688a222447b09e1196ae1c65c3dcd15373 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-18.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-18.js @@ -9,18 +9,18 @@ description: > property without a get function on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return typeof val === "undefined"; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return typeof val === "undefined"; + } + return false; +} - var arr = []; +var arr = []; - Object.defineProperty(arr, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(arr, "0", { + set: function() {}, + configurable: true +}); assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-19.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-19.js index 7d45a552381bc323afd3ba000e82b5e9477cec05..859dc4022822e32b896d20ba9056ce2e44dbbbdc 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-19.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-19.js @@ -10,19 +10,21 @@ description: > accessor property on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1) { - return typeof val === "undefined"; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + return typeof val === "undefined"; + } + return false; +} - var obj = { length: 2 }; - Object.defineProperty(obj, "1", { - set: function () { }, - configurable: true - }); +var obj = { + length: 2 +}; +Object.defineProperty(obj, "1", { + set: function() {}, + configurable: true +}); - Object.prototype[1] = 10; +Object.prototype[1] = 10; assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-2.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-2.js index cd3c2ced7294a480acf793c990a011bda152ad3e..543d15db458b7ebcc2bd621b01a630aabb82f1fc 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-2.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-2.js @@ -9,13 +9,13 @@ description: > property on an Array ---*/ - var kValue = {}; +var kValue = {}; - function callbackfn(val, idx, obj) { - if (idx === 0) { - return kValue === val; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return kValue === val; + } + return false; +} assert([kValue].some(callbackfn), '[kValue].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-20.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-20.js index 320cb9899c3bd4ae08bb77bd48335e3d915e37e9..d39314005b88df9f2b158e9277cc46f79d39a7e0 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-20.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-20.js @@ -10,20 +10,20 @@ description: > accessor property on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return typeof val === "undefined"; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return typeof val === "undefined"; + } + return false; +} - var arr = []; +var arr = []; - Object.defineProperty(arr, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(arr, "0", { + set: function() {}, + configurable: true +}); - Array.prototype[0] = 100; +Array.prototype[0] = 100; assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-21.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-21.js index 18fc2abe15a4711aedbef1bc21e3590415f7fd7f..3365018fc60048a0c06b3f4890d70fb8aa67e03e 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-21.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-21.js @@ -9,23 +9,23 @@ description: > accessor property without a get function on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1) { - return typeof val === "undefined"; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + return typeof val === "undefined"; + } + return false; +} - var proto = {}; - Object.defineProperty(proto, "1", { - set: function () { }, - configurable: true - }); +var proto = {}; +Object.defineProperty(proto, "1", { + set: function() {}, + configurable: true +}); - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 2; +var child = new Con(); +child.length = 2; assert(Array.prototype.some.call(child, callbackfn), 'Array.prototype.some.call(child, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-22.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-22.js index a6086840bc41840468cffca2d2c36e33da9961de..5635c65aaae5a1775e2fba6f27d08dbc8e8b2fc8 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-22.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-22.js @@ -9,16 +9,16 @@ description: > accessor property without a get function on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return typeof val === "undefined"; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return typeof val === "undefined"; + } + return false; +} - Object.defineProperty(Array.prototype, "0", { - set: function () { }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + set: function() {}, + configurable: true +}); assert([, ].some(callbackfn), '[, ].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-25.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-25.js index 87a76dd0be33203d461ed29685dc0cfcabb9fcb6..fe7a12aad89bb77d0d5999c41fbd4de384286ff3 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-25.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-25.js @@ -10,15 +10,15 @@ description: > less than number of parameters) ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === 11; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 11; + } + return false; +} - var func = function (a, b) { - return Array.prototype.some.call(arguments, callbackfn); - }; +var func = function(a, b) { + return Array.prototype.some.call(arguments, callbackfn); +}; assert(func(11), 'func(11) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-26.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-26.js index 626c4fec9421d80f03a54e228c04a2136e08ed7b..8a0dd4b0ff1b67a722cbd77d9d55c0b08899c73c 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-26.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-26.js @@ -10,24 +10,24 @@ description: > number of parameters) ---*/ - var firstResult = false; - var secondResult = false; +var firstResult = false; +var secondResult = false; - function callbackfn(val, idx, obj) { - if (idx === 0) { - firstResult = (val === 11); - return false; - } else if (idx === 1) { - secondResult = (val === 9); - return false; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + firstResult = (val === 11); + return false; + } else if (idx === 1) { + secondResult = (val === 9); + return false; + } else { + return true; + } +} - var func = function (a, b) { - return Array.prototype.some.call(arguments, callbackfn); - }; +var func = function(a, b) { + return Array.prototype.some.call(arguments, callbackfn); +}; assert.sameValue(func(11, 9), false, 'func(11, 9)'); assert(firstResult, 'firstResult !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-27.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-27.js index de0a66b2510f900da2eaf39c2126ca488cd3c7d2..f54a10f05b496f35e235c78a74f53ad00c635090 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-27.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-27.js @@ -10,28 +10,28 @@ description: > greater than number of parameters) ---*/ - var firstResult = false; - var secondResult = false; - var thirdResult = false; +var firstResult = false; +var secondResult = false; +var thirdResult = false; - function callbackfn(val, idx, obj) { - if (idx === 0) { - firstResult = (val === 11); - return false; - } else if (idx === 1) { - secondResult = (val === 12); - return false; - } else if (idx === 2) { - thirdResult = (val === 9); - return false; - } else { - return true; - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + firstResult = (val === 11); + return false; + } else if (idx === 1) { + secondResult = (val === 12); + return false; + } else if (idx === 2) { + thirdResult = (val === 9); + return false; + } else { + return true; + } +} - var func = function (a, b) { - return Array.prototype.some.call(arguments, callbackfn); - }; +var func = function(a, b) { + return Array.prototype.some.call(arguments, callbackfn); +}; assert.sameValue(func(11, 12, 9), false, 'func(11, 12, 9)'); assert(firstResult, 'firstResult !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-28.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-28.js index da8a40f1e501e1e4d0d52deeed6df7b0b6222561..8e423c615531093fa7ff32273906bf4581c98a0d 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-28.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-28.js @@ -9,32 +9,32 @@ description: > iterations is observed on an Array ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1) { - return val === 12; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + return val === 12; + } + return false; +} - var arr = []; - var helpVerifyVar = 11; +var arr = []; +var helpVerifyVar = 11; - Object.defineProperty(arr, "1", { - get: function () { - return helpVerifyVar; - }, - set: function (args) { - helpVerifyVar = args; - }, - configurable: true - }); +Object.defineProperty(arr, "1", { + get: function() { + return helpVerifyVar; + }, + set: function(args) { + helpVerifyVar = args; + }, + configurable: true +}); - Object.defineProperty(arr, "0", { - get: function () { - arr[1] = 12; - return 9; - }, - configurable: true - }); +Object.defineProperty(arr, "0", { + get: function() { + arr[1] = 12; + return 9; + }, + configurable: true +}); assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-29.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-29.js index 416660ba05872d1e49bf42d54fba14365048072f..ac802b11281d2b1137dace38beb4d000d408f19c 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-29.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-29.js @@ -9,32 +9,34 @@ description: > iterations on an Array-like object ---*/ - function callbackfn(val, idx, obj) { - if (idx === 1) { - return val === 12; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 1) { + return val === 12; + } + return false; +} - var obj = { length: 2 }; - var helpVerifyVar = 11; +var obj = { + length: 2 +}; +var helpVerifyVar = 11; - Object.defineProperty(obj, "1", { - get: function () { - return helpVerifyVar; - }, - set: function (args) { - helpVerifyVar = args; - }, - configurable: true - }); +Object.defineProperty(obj, "1", { + get: function() { + return helpVerifyVar; + }, + set: function(args) { + helpVerifyVar = args; + }, + configurable: true +}); - Object.defineProperty(obj, "0", { - get: function () { - obj[1] = 12; - return 11; - }, - configurable: true - }); +Object.defineProperty(obj, "0", { + get: function() { + obj[1] = 12; + return 11; + }, + configurable: true +}); assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-3.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-3.js index e9b625ee73610516ed81cd1dbf3f01125b6a0aa4..05523157621eb5c468d91d3777a7ea24c7827d05 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-3.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-3.js @@ -10,22 +10,24 @@ description: > Array-like object ---*/ - var kValue = "abc"; +var kValue = "abc"; - function callbackfn(val, idx, obj) { - if (idx === 5) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 5) { + return val === kValue; + } + return false; +} - var proto = { 5: 100 }; +var proto = { + 5: 100 +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child[5] = kValue; - child.length = 10; +var child = new Con(); +child[5] = kValue; +child.length = 10; assert(Array.prototype.some.call(child, callbackfn), 'Array.prototype.some.call(child, callbackfn) !== 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 9803d3576129f5ccec1b1f78cf9fa51af8a2e672..4ce67a0b6ca9770c0556444b2ca35be934086646 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 @@ -9,22 +9,25 @@ description: > terminate iteration on an Array-like object ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - if (idx > 1) { - accessed = true; - } - return true; - } +var accessed = false; - var obj = { length: 20 }; - Object.defineProperty(obj, "1", { - get: function () { - throw new RangeError("unhandle exception happened in getter"); - }, - configurable: true - }); +function callbackfn(val, idx, obj) { + if (idx > 1) { + accessed = true; + } + return true; +} + +var obj = { + length: 20 +}; +Object.defineProperty(obj, "1", { + get: function() { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true +}); assert.throws(RangeError, function() { - Array.prototype.some.call(obj, callbackfn); + Array.prototype.some.call(obj, callbackfn); }); 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 5fe12afb7a29aa6c28bf1a60895a54e37156b235..9d9cc00c1c12610dad99a2ac50447b444ffc3caa 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 @@ -9,23 +9,24 @@ description: > terminate iteration on an Array ---*/ - var accessed = false; - function callbackfn(val, idx, obj) { - if (idx > 0) { - accessed = true; - } - return true; - } +var accessed = false; - var arr = []; - arr[10] = 100; - Object.defineProperty(arr, "0", { - get: function () { - throw new RangeError("unhandle exception happened in getter"); - }, - configurable: true - }); +function callbackfn(val, idx, obj) { + if (idx > 0) { + accessed = true; + } + return true; +} + +var arr = []; +arr[10] = 100; +Object.defineProperty(arr, "0", { + get: function() { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true +}); assert.throws(RangeError, function() { - arr.some(callbackfn); + arr.some(callbackfn); }); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-4.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-4.js index 8312a515b628652dc51649da9ac19688e474a23a..64dd495a9b136b60d9366a5b9b256258b367d050 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-4.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-4.js @@ -9,15 +9,15 @@ description: > property that overrides an inherited data property on an Array ---*/ - var kValue = "abc"; +var kValue = "abc"; - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; +} - Array.prototype[0] = 11; +Array.prototype[0] = 11; assert([kValue].some(callbackfn), '[kValue].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-5.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-5.js index 5d2c92a761196c359d30680fb25bbaee68445f93..d8fcfaf35a454860223809c9856b149dae24eb51 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-5.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-5.js @@ -10,32 +10,32 @@ description: > Array-like object ---*/ - var kValue = 1000; - - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === kValue; - } - return false; - } - - var proto = {}; - - Object.defineProperty(proto, "0", { - get: function () { - return 5; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 2; - Object.defineProperty(child, "0", { - value: kValue, - configurable: true - }); +var kValue = 1000; + +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; +} + +var proto = {}; + +Object.defineProperty(proto, "0", { + get: function() { + return 5; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 2; +Object.defineProperty(child, "0", { + value: kValue, + configurable: true +}); assert(Array.prototype.some.call(child, callbackfn), 'Array.prototype.some.call(child, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-6.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-6.js index 19eece56543fe66d2b54ccd500e3a0057cf3f706..ef5da14095a31070fda9b814a52619d30c42b7a6 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-6.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-6.js @@ -9,20 +9,20 @@ description: > property that overrides an inherited accessor property on an Array ---*/ - var kValue = 1000; +var kValue = 1000; - function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; +} - Object.defineProperty(Array.prototype, "0", { - get: function () { - return 9; - }, - configurable: true - }); +Object.defineProperty(Array.prototype, "0", { + get: function() { + return 9; + }, + configurable: true +}); assert([kValue].some(callbackfn), '[kValue].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-7.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-7.js index fe4c1e892d76b6f501d13a277315cc9b6a3e4fed..f346f92524eb7d999ade0455aa2cacd0dbfd7855 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-7.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-7.js @@ -9,21 +9,23 @@ description: > property on an Array-like object ---*/ - var kValue = 'abc'; +var kValue = 'abc'; - function callbackfn(val, idx, obj) { - if (5 === idx) { - return kValue === val; - } - return false; - } +function callbackfn(val, idx, obj) { + if (5 === idx) { + return kValue === val; + } + return false; +} - var proto = { 5: kValue }; +var proto = { + 5: kValue +}; - var Con = function () { }; - Con.prototype = proto; +var Con = function() {}; +Con.prototype = proto; - var child = new Con(); - child.length = 10; +var child = new Con(); +child.length = 10; assert(Array.prototype.some.call(child, callbackfn), 'Array.prototype.some.call(child, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-8.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-8.js index 7fdcc881618a7d51b6b05b072f846af01cd608a1..fb71d4fc7e87b9b1d4872b28b5d3a39055e68744 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-8.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-8.js @@ -9,15 +9,15 @@ description: > property on an Array ---*/ - var kValue = {}; +var kValue = {}; - function callbackfn(val, idx, obj) { - if (0 === idx) { - return kValue === val; - } - return false; - } +function callbackfn(val, idx, obj) { + if (0 === idx) { + return kValue === val; + } + return false; +} - Array.prototype[0] = kValue; +Array.prototype[0] = kValue; assert([, ].some(callbackfn), '[, ].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-9.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-9.js index fe3819ddddab38646cb01b5105a4d1d044bcb4e9..2081432745deb79174f13eedf40a35d2918e2407 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-9.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-9.js @@ -9,22 +9,24 @@ description: > property on an Array-like object ---*/ - var kValue = "abc"; +var kValue = "abc"; - function callbackfn(val, idx, obj) { - if (idx === 10) { - return val === kValue; - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx === 10) { + return val === kValue; + } + return false; +} - var obj = { length: 20 }; +var obj = { + length: 20 +}; - Object.defineProperty(obj, "10", { - get: function () { - return kValue; - }, - configurable: true - }); +Object.defineProperty(obj, "10", { + get: function() { + return kValue; + }, + configurable: true +}); assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-1.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-1.js index 5d83fff70b70f0ed481785374de10e4a2f58b4a4..c865faae21b71a5b3ba7f202665b8a16ec7900e3 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-1.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-1.js @@ -7,15 +7,15 @@ es5id: 15.4.4.17-7-c-ii-1 description: Array.prototype.some - callbackfn called with correct parameters ---*/ - function callbackfn(val, idx, obj) - { - if(obj[idx] === val) - return false; - else - return true; - } +function callbackfn(val, idx, obj) +{ + if (obj[idx] === val) + return false; + else + return true; +} - var arr = [0,1,2,3,4,5,6,7,8,9]; +var arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-10.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-10.js index b7bbd6e847b560524a4290e8420d0aa03dd9aee6..13301777baa6d14ae1e7212da50a5b242b79c1a6 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-10.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-10.js @@ -7,8 +7,8 @@ es5id: 15.4.4.17-7-c-ii-10 description: Array.prototype.some - callbackfn is called with 1 formal parameter ---*/ - function callbackfn(val) { - return val > 10; - } +function callbackfn(val) { + return val > 10; +} assert([11, 12].some(callbackfn), '[11, 12].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-11.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-11.js index c67f1645279ab940cf4a927f67bb65aaf6bef369..3bf00f445a5ab16b3254b57959f51a9a85331fac 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-11.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-11.js @@ -7,8 +7,8 @@ es5id: 15.4.4.17-7-c-ii-11 description: Array.prototype.some - callbackfn is called with 2 formal parameter ---*/ - function callbackfn(val, idx) { - return val > 10 && arguments[2][idx] === val; - } +function callbackfn(val, idx) { + return val > 10 && arguments[2][idx] === val; +} assert([9, 12].some(callbackfn), '[9, 12].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-12.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-12.js index 9fcb899c65763d0779da0612b2591629f7826d1d..a892afde5915c9500ec07209497622a008efe88d 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-12.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-12.js @@ -7,8 +7,8 @@ es5id: 15.4.4.17-7-c-ii-12 description: Array.prototype.some - callbackfn is called with 3 formal parameter ---*/ - function callbackfn(val, idx, obj) { - return val > 10 && obj[idx] === val; - } +function callbackfn(val, idx, obj) { + return val > 10 && obj[idx] === val; +} assert([9, 12].some(callbackfn), '[9, 12].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-13.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-13.js index 6d61b65b619b099e8af33d2fabb13ade1bca6f88..6917e26355054bf5afbf141f0e232aefd620bb31 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-13.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-13.js @@ -9,8 +9,8 @@ description: > get parameter value ---*/ - function callbackfn() { - return arguments[2][arguments[1]] === arguments[0]; - } +function callbackfn() { + return arguments[2][arguments[1]] === arguments[0]; +} assert([9, 12].some(callbackfn), '[9, 12].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-16.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-16.js index c1f58e55a1201a95785f7e6a26cf597163976015..d6fb5d60bc8d59c562e4a51f47653b4d212bcc5c 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-16.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-16.js @@ -9,10 +9,13 @@ description: > when 'T' is not an object ('T' is a boolean primitive) ---*/ - function callbackfn(val, idx, obj) { - return this.valueOf() === false; - } +function callbackfn(val, idx, obj) { + return this.valueOf() === false; +} - var obj = { 0: 11, length: 1 }; +var obj = { + 0: 11, + length: 1 +}; assert(Array.prototype.some.call(obj, callbackfn, false), 'Array.prototype.some.call(obj, callbackfn, false) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-17.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-17.js index 85a7f5b2ef9f071d1db6fa550cde3821561b6bb9..198346eb6e390c270cf560d7a9be7f9c19c7d3a5 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-17.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-17.js @@ -9,10 +9,13 @@ description: > when T is not an object (T is a number primitive) ---*/ - function callbackfn(val, idx, obj) { - return this.valueOf() === 5; - } +function callbackfn(val, idx, obj) { + return this.valueOf() === 5; +} - var obj = { 0: 11, length: 1 }; +var obj = { + 0: 11, + length: 1 +}; assert(Array.prototype.some.call(obj, callbackfn, 5), 'Array.prototype.some.call(obj, callbackfn, 5) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-18.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-18.js index e8edeec0258acb7f0514dfca9389e274ca98adbe..9498f8079c17dfd28cfe6a00103186953e2540b5 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-18.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-18.js @@ -9,10 +9,14 @@ description: > when T is not an object (T is a string primitive) ---*/ - function callbackfn(val, idx, obj) { - return this.valueOf() === "hello!"; - } +function callbackfn(val, idx, obj) { + return this.valueOf() === "hello!"; +} - var obj = { 0: 11, 1: 9, length: 2 }; +var obj = { + 0: 11, + 1: 9, + length: 2 +}; assert(Array.prototype.some.call(obj, callbackfn, "hello!"), 'Array.prototype.some.call(obj, callbackfn, "hello!") !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-19.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-19.js index 2e8a6f2130415b72b7e2910750a03dcda485b418..4d0063e47b755af44e52d7ab60216068931b6156 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-19.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-19.js @@ -7,14 +7,19 @@ es5id: 15.4.4.17-7-c-ii-19 description: Array.prototype.some - non-indexed properties are not called ---*/ - var called = 0; +var called = 0; - function callbackfn(val, idx, obj) { - called++; - return val === 11; - } +function callbackfn(val, idx, obj) { + called++; + return val === 11; +} - var obj = { 0: 9, 10: 8, non_index_property: 11, length: 20 }; +var obj = { + 0: 9, + 10: 8, + non_index_property: 11, + length: 20 +}; assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)'); assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-2.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-2.js index 0546acaa13b02c1b2f626919519c46ff0e61eab3..be738c154f5049fcab3f3f8d6b6f63af2b4ca86f 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-2.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-2.js @@ -7,16 +7,16 @@ es5id: 15.4.4.17-7-c-ii-2 description: Array.prototype.some - callbackfn takes 3 arguments ---*/ - function callbackfn(val, idx, obj) - { - if(arguments.length === 3) //verify if callbackfn was called with 3 parameters - return false; - else - return true; - } +function callbackfn(val, idx, obj) +{ + if (arguments.length === 3) //verify if callbackfn was called with 3 parameters + return false; + else + return true; +} - var arr = [0,1,true,null,new Object(),"five"]; - arr[999999] = -6.6; +var arr = [0, 1, true, null, new Object(), "five"]; +arr[999999] = -6.6; assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-20.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-20.js index 342f98b380122e4972f3748c78a803e824eb1d80..899fb2efb7e75e75e0449aa79249df7591538ac1 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-20.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-20.js @@ -9,12 +9,17 @@ description: > (thisArg is correct) ---*/ - var thisArg = { threshold: 10 }; +var thisArg = { + threshold: 10 +}; - function callbackfn(val, idx, obj) { - return this === thisArg; - } +function callbackfn(val, idx, obj) { + return this === thisArg; +} - var obj = { 0: 11, length: 2 }; +var obj = { + 0: 11, + length: 2 +}; assert(Array.prototype.some.call(obj, callbackfn, thisArg), 'Array.prototype.some.call(obj, callbackfn, thisArg) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-21.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-21.js index 2e95550123526b8337e73c075abdd97d77789084..31d3af3b033120c70cd8edcabaede53eab6fed5c 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-21.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-21.js @@ -9,21 +9,25 @@ description: > (kValue is correct) ---*/ - var firstIndex = false; - var secondIndex = false; +var firstIndex = false; +var secondIndex = false; - function callbackfn(val, idx, obj) { - if (idx === 0) { - firstIndex = (val === 11); - return false; - } - if (idx === 1) { - secondIndex = (val === 12); - return false; - } - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + firstIndex = (val === 11); + return false; + } + if (idx === 1) { + secondIndex = (val === 12); + return false; + } +} - var obj = { 0: 11, 1: 12, length: 2 }; +var obj = { + 0: 11, + 1: 12, + length: 2 +}; assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)'); assert(firstIndex, 'firstIndex !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-22.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-22.js index 00f6a963c1be4743fe0d9d956e9903087e530b19..e01efeac2bdd5c042699336ec5838fa993e94cd9 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-22.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-22.js @@ -9,21 +9,25 @@ description: > (the index k is correct) ---*/ - var firstIndex = false; - var secondIndex = false; +var firstIndex = false; +var secondIndex = false; - function callbackfn(val, idx, obj) { - if (val === 11) { - firstIndex = (idx === 0); - return false; - } - if (val === 12) { - secondIndex = (idx === 1); - return false; - } - } +function callbackfn(val, idx, obj) { + if (val === 11) { + firstIndex = (idx === 0); + return false; + } + if (val === 12) { + secondIndex = (idx === 1); + return false; + } +} - var obj = { 0: 11, 1: 12, length: 2 }; +var obj = { + 0: 11, + 1: 12, + length: 2 +}; assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)'); assert(firstIndex, 'firstIndex !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-23.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-23.js index b5baef3173af46490dea4483fc06fc83e0955414..58c4b0ef2c8aae1009e9911d9fd49c15e2e90468 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-23.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-23.js @@ -9,10 +9,14 @@ description: > (this object O is correct) ---*/ - var obj = { 0: 11, 1: 12, length: 2 }; +var obj = { + 0: 11, + 1: 12, + length: 2 +}; - function callbackfn(val, idx, o) { - return obj === o; - } +function callbackfn(val, idx, o) { + return obj === o; +} assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-3.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-3.js index 8e784584d6e6d89569ad766b52510279a2c297dc..fb0265b5e2a19101e2418385e88fd832d5dbde64 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-3.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-3.js @@ -9,17 +9,18 @@ description: > returns true ---*/ - var callCnt = 0; - function callbackfn(val, idx, obj) - { - callCnt++; - if(idx > 5) - return true; - else - return false; - } +var callCnt = 0; - var arr = [0,1,2,3,4,5,6,7,8,9]; +function callbackfn(val, idx, obj) +{ + callCnt++; + if (idx > 5) + return true; + else + return false; +} + +var arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; assert.sameValue(arr.some(callbackfn), true, 'arr.some(callbackfn)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-4.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-4.js index c9c277ef3a4c21167907d656bd503c2f3769da8a..8642acfdbc851633606f9b29982a073f03aa54fd 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-4.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-4.js @@ -9,19 +9,19 @@ description: > order ---*/ - var arr = [0, 1, 2, 3, 4, 5]; - var lastIdx = 0; - var called = 0; +var arr = [0, 1, 2, 3, 4, 5]; +var lastIdx = 0; +var called = 0; - function callbackfn(val, idx, o) { - called++; - if (lastIdx !== idx) { - return true; - } else { - lastIdx++; - return false; - } - } +function callbackfn(val, idx, o) { + called++; + if (lastIdx !== idx) { + return true; + } else { + lastIdx++; + return false; + } +} assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)'); assert.sameValue(arr.length, called, 'arr.length'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-5.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-5.js index bfac0f46811c403736163711ce39f8422cb30c66..5b80ddcded9450e83b4423d7d87ffacc87ee756f 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-5.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-5.js @@ -9,21 +9,21 @@ description: > and not prior to starting the loop ---*/ - var kIndex = []; +var kIndex = []; - //By below way, we could verify that k would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time. - function callbackfn(val, idx, obj) { - //Each position should be visited one time, which means k is accessed one time during iterations. - if (typeof kIndex[idx] === "undefined") { - //when current position is visited, its previous index should has been visited. - if (idx !== 0 && typeof kIndex[idx - 1] === "undefined") { - return true; - } - kIndex[idx] = 1; - return false; - } else { - return true; - } - } +//By below way, we could verify that k would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time. +function callbackfn(val, idx, obj) { + //Each position should be visited one time, which means k is accessed one time during iterations. + if (typeof kIndex[idx] === "undefined") { + //when current position is visited, its previous index should has been visited. + if (idx !== 0 && typeof kIndex[idx - 1] === "undefined") { + return true; + } + kIndex[idx] = 1; + return false; + } else { + return true; + } +} assert.sameValue([11, 12, 13, 14].some(callbackfn, undefined), false, '[11, 12, 13, 14].some(callbackfn, undefined)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-6.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-6.js index 8700b391a5af2628d4caad463818122cf1f1ec06..f67b3e415cb837e8b15e6b7650162af0622e262c 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-6.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-6.js @@ -7,11 +7,14 @@ es5id: 15.4.4.17-7-c-ii-6 description: Array.prototype.some - arguments to callbackfn are self consistent ---*/ - var obj = { 0: 11, length: 1 }; - var thisArg = {}; +var obj = { + 0: 11, + length: 1 +}; +var thisArg = {}; - function callbackfn() { - return this === thisArg && arguments[0] === 11 && arguments[1] === 0 && arguments[2] === obj; - } +function callbackfn() { + return this === thisArg && arguments[0] === 11 && arguments[1] === 0 && arguments[2] === obj; +} assert(Array.prototype.some.call(obj, callbackfn, thisArg), 'Array.prototype.some.call(obj, callbackfn, thisArg) !== true'); 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 a8742d69f251e3a1548e67d8a97012b2005e49ec..ff362211be57637ae825f747134ecded3073cebe 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 @@ -9,20 +9,25 @@ description: > terminate iteration ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - if (idx > 0) { - accessed = true; - } - if (idx === 0) { - throw new Error("Exception occurred in callbackfn"); - } - return false; - } +function callbackfn(val, idx, obj) { + if (idx > 0) { + accessed = true; + } + if (idx === 0) { + throw new Error("Exception occurred in callbackfn"); + } + return false; +} - var obj = { 0: 9, 1: 100, 10: 11, length: 20 }; +var obj = { + 0: 9, + 1: 100, + 10: 11, + length: 20 +}; assert.throws(Error, function() { - Array.prototype.some.call(obj, callbackfn); + Array.prototype.some.call(obj, callbackfn); }); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-8.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-8.js index 9c926f28a9c3e1764eb802e22a5c8db34b5dc9ba..451d0b3d378c72e643ed016b18b89a87e7521821 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-8.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-8.js @@ -9,13 +9,17 @@ description: > iterations is observed ---*/ - function callbackfn(val, idx, obj) { - if (idx === 0) { - obj[idx + 1] = 11; - } - return val > 10; - } +function callbackfn(val, idx, obj) { + if (idx === 0) { + obj[idx + 1] = 11; + } + return val > 10; +} - var obj = { 0: 9, 1: 8, length: 2 }; +var obj = { + 0: 9, + 1: 8, + length: 2 +}; assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-9.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-9.js index a49cd35a6a0a53bfe5eefb1182760a312e3e40bd..b9c6c8eda9a6672201456260fa91e7376e293562 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-9.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-9.js @@ -7,8 +7,8 @@ es5id: 15.4.4.17-7-c-ii-9 description: Array.prototype.some - callbackfn is called with 0 formal parameter ---*/ - function callbackfn() { - return true; - } +function callbackfn() { + return true; +} assert([11, 12].some(callbackfn), '[11, 12].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-1.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-1.js index 5acfb38bf3655eaac17a3593e25814abe6a1bcc1..4e2074291e98b241ebf51909baa2d64bd5c91372 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-1.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-1.js @@ -7,14 +7,17 @@ es5id: 15.4.4.17-7-c-iii-1 description: Array.prototype.some - return value of callbackfn is undefined ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return undefined; - } +function callbackfn(val, idx, obj) { + accessed = true; + return undefined; +} - var obj = { 0: 11, length: 2 }; +var obj = { + 0: 11, + length: 2 +}; assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-10.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-10.js index 0b26acd258d9e7cde5e242c8595295c559e50112..d561708440fbfde228524b01a115011f952307c6 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-10.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-10.js @@ -9,8 +9,8 @@ description: > (value is Infinity) ---*/ - function callbackfn(val, idx, obj) { - return Infinity; - } +function callbackfn(val, idx, obj) { + return Infinity; +} assert([11].some(callbackfn), '[11].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-11.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-11.js index e17e0f6ff5c2c61d07bd2ae5c827c41c36560956..1defdc292cef79d5f8cd7ad08fdc24270bc16785 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-11.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-11.js @@ -9,8 +9,8 @@ description: > (value is -Infinity) ---*/ - function callbackfn(val, idx, obj) { - return -Infinity; - } +function callbackfn(val, idx, obj) { + return -Infinity; +} assert([11].some(callbackfn), '[11].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-12.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-12.js index 1eaab0e8aa23dbc9c9e0ffb825077bd3105f5cf1..adfd8efbf5cc34471387d6ced223d84f7f874464 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-12.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-12.js @@ -9,11 +9,11 @@ description: > (value is NaN) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return NaN; - } +function callbackfn(val, idx, obj) { + accessed = true; + return NaN; +} assert.sameValue([11].some(callbackfn), false, '[11].some(callbackfn)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-13.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-13.js index 5690c14b484aa7e84d86568b8fceb35fe98db2a9..2e20fa5ba0b984e68bace1fbbdbe935b5393b6c5 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-13.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-13.js @@ -9,12 +9,12 @@ description: > string ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return ""; - } +function callbackfn(val, idx, obj) { + accessed = true; + return ""; +} assert.sameValue([11].some(callbackfn), false, '[11].some(callbackfn)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-14.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-14.js index c0776e90f2b610888c71c91f4afe80dcab4ff286..a15cbed88ad321a1ec9eced74199303001eae9e2 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-14.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-14.js @@ -9,8 +9,8 @@ description: > string ---*/ - function callbackfn(val, idx, obj) { - return "non-empty string"; - } +function callbackfn(val, idx, obj) { + return "non-empty string"; +} assert([11].some(callbackfn), '[11].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-15.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-15.js index 37974b816e7dcb02f471d4c81157c18ad566b6f9..1de47b0a3e1781defb779a3b5a5731cf9e03f139 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-15.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-15.js @@ -9,8 +9,8 @@ description: > object ---*/ - function callbackfn(val, idx, obj) { - return function () { }; - } +function callbackfn(val, idx, obj) { + return function() {}; +} assert([11].some(callbackfn), '[11].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-16.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-16.js index dc3c10f8977aa539c2a52a1d90bf3d6785e88a50..f0b7db75d4c926cc78048f9b302ff1a22bdfc6f4 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-16.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-16.js @@ -9,8 +9,8 @@ description: > object ---*/ - function callbackfn(val, idx, obj) { - return new Array(10); - } +function callbackfn(val, idx, obj) { + return new Array(10); +} assert([11].some(callbackfn), '[11].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-17.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-17.js index ba9188b146e982498ce10c91fa86b554ef6351d8..a2be9ec374edddec4ec5df8b979b7e8f7da2234d 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-17.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-17.js @@ -9,8 +9,8 @@ description: > object ---*/ - function callbackfn(val, idx, obj) { - return new String(); - } +function callbackfn(val, idx, obj) { + return new String(); +} assert([11].some(callbackfn), '[11].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-18.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-18.js index 871b4a2171d891fd5ba03a2b45bd2676ca77939f..7d273f4ec4f319eed31141c0be2e43bc5b9d3902 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-18.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-18.js @@ -9,8 +9,8 @@ description: > object ---*/ - function callbackfn(val, idx, obj) { - return new Boolean(); - } +function callbackfn(val, idx, obj) { + return new Boolean(); +} assert([11].some(callbackfn), '[11].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-19.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-19.js index 0c71f548678b327ac0826ef48dfa22bfec27687c..a87205ead301adf6773e537a508f710750f1d752 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-19.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-19.js @@ -9,8 +9,8 @@ description: > object ---*/ - function callbackfn(val, idx, obj) { - return new Number(); - } +function callbackfn(val, idx, obj) { + return new Number(); +} assert([11].some(callbackfn), '[11].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-2.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-2.js index 19318e4b67f8bc8ad0c1719d78db03e4794b4273..b52aff5276a93155db0cf4c14f1985fe6ddb7c28 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-2.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-2.js @@ -7,14 +7,17 @@ es5id: 15.4.4.17-7-c-iii-2 description: Array.prototype.some - return value of callbackfn is null ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return null; - } +function callbackfn(val, idx, obj) { + accessed = true; + return null; +} - var obj = { 0: 11, length: 2 }; +var obj = { + 0: 11, + length: 2 +}; assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-20.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-20.js index 481f06fc785eeb716a7e3c9526fa446ec68a43c0..2911f87bcb77d6db3daa2e19b7aec308a700bc98 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-20.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-20.js @@ -9,8 +9,8 @@ description: > object ---*/ - function callbackfn(val, idx, obj) { - return Math; - } +function callbackfn(val, idx, obj) { + return Math; +} assert([11].some(callbackfn), '[11].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-21.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-21.js index 04a02a0da6c98fddc3d823e906debd0e35a32bf1..068cd5d0da50a5a50cc708099a2a9e5d9e37a138 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-21.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-21.js @@ -7,8 +7,8 @@ es5id: 15.4.4.17-7-c-iii-21 description: Array.prototype.some - return value of callbackfn is a Date object ---*/ - function callbackfn(val, idx, obj) { - return new Date(); - } +function callbackfn(val, idx, obj) { + return new Date(); +} assert([11].some(callbackfn), '[11].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-22.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-22.js index 706a94dad871fa9a12178a9935e52c0b1571617d..b71d8463581a289d29e79477190b025d4433f742 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-22.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-22.js @@ -9,8 +9,8 @@ description: > object ---*/ - function callbackfn(val, idx, obj) { - return new RegExp(); - } +function callbackfn(val, idx, obj) { + return new RegExp(); +} assert([11].some(callbackfn), '[11].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-23.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-23.js index d90675753010f37a7781d122eac10a1d3dbebb20..c0316a94b412d2bf9919734c597aa02332a51303 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-23.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-23.js @@ -9,8 +9,8 @@ description: > object ---*/ - function callbackfn(val, idx, obj) { - return JSON; - } +function callbackfn(val, idx, obj) { + return JSON; +} assert([11].some(callbackfn), '[11].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-24.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-24.js index 55f76e23dca9bb974aeedfa9793b51b1f6debcc5..f8ff2dc7f4921f11d85f2640b73da3675cfbc362 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-24.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-24.js @@ -9,8 +9,8 @@ description: > object ---*/ - function callbackfn(val, idx, obj) { - return new EvalError(); - } +function callbackfn(val, idx, obj) { + return new EvalError(); +} assert([11].some(callbackfn), '[11].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-25.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-25.js index b3aaf63669abacf0a75795cab0fc5e2020bbd441..f0237397dbf317e40968adfaaf58ad4ee53c5129 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-25.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-25.js @@ -9,8 +9,8 @@ description: > object ---*/ - function callbackfn(val, idx, obj) { - return arguments; - } +function callbackfn(val, idx, obj) { + return arguments; +} assert([11].some(callbackfn), '[11].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-26.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-26.js index e8119a33dcf2be6b0b3450a46e9ff96bcd6f502d..d96e7e78346ccb93a3d7d31ff391b8b0c0e9b6c3 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-26.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-26.js @@ -10,8 +10,9 @@ description: > ---*/ var global = this; - function callbackfn(val, idx, obj) { - return global; - } + +function callbackfn(val, idx, obj) { + return global; +} assert([11].some(callbackfn), '[11].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-28.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-28.js index 3206596514013c21aa4c0ff45c525027defa71d8..e971d690dd559698ec44326c3650c8bfc7537ef8 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-28.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-28.js @@ -7,37 +7,40 @@ es5id: 15.4.4.17-7-c-iii-28 description: Array.prototype.some - true prevents further side effects ---*/ - var result = false; - function callbackfn(val, idx, obj) { - if (idx > 1) { - result = true; - } - return val > 10; - } - - var obj = { length: 20 }; - - Object.defineProperty(obj, "0", { - get: function () { - return 8; - }, - configurable: true - }); - - Object.defineProperty(obj, "1", { - get: function () { - return 11; - }, - configurable: true - }); - - Object.defineProperty(obj, "2", { - get: function () { - result = true; - return 11; - }, - configurable: true - }); +var result = false; + +function callbackfn(val, idx, obj) { + if (idx > 1) { + result = true; + } + return val > 10; +} + +var obj = { + length: 20 +}; + +Object.defineProperty(obj, "0", { + get: function() { + return 8; + }, + configurable: true +}); + +Object.defineProperty(obj, "1", { + get: function() { + return 11; + }, + configurable: true +}); + +Object.defineProperty(obj, "2", { + get: function() { + result = true; + return 11; + }, + configurable: true +}); assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); assert.sameValue(result, false, 'result'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-29.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-29.js index cb3c75c0d0ac22746f6d3c9feb9732f94ce38d4d..d0d8b0cdeaf1cfc1f52abb86f0596df8059fda16 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-29.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-29.js @@ -9,8 +9,8 @@ description: > callbackfn is treated as true value ---*/ - function callbackfn() { - return new Boolean(false); - } +function callbackfn() { + return new Boolean(false); +} assert([11].some(callbackfn), '[11].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-3.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-3.js index b5c6ee0eeb2a6a632877f024cf84326a8a4815b7..ab3d088db463b2eee67752c86aa721ef67145d76 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-3.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-3.js @@ -9,14 +9,17 @@ description: > (value is false) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return false; - } +function callbackfn(val, idx, obj) { + accessed = true; + return false; +} - var obj = { 0: 11, length: 2 }; +var obj = { + 0: 11, + length: 2 +}; assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-4.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-4.js index ff056a32595005ee87e6b64e18617f128e2143fd..9b885029ceb1167434def902bc78a4f68174c9f2 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-4.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-4.js @@ -9,10 +9,13 @@ description: > (value is true) ---*/ - function callbackfn(val, idx, obj) { - return true; - } +function callbackfn(val, idx, obj) { + return true; +} - var obj = { 0: 11, length: 2 }; +var obj = { + 0: 11, + length: 2 +}; assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-5.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-5.js index 6b0b20e3d5611df0237f63aa55781986509671d5..f67054b66aae0de7220825fa93df79110f46fd5a 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-5.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-5.js @@ -9,12 +9,12 @@ description: > (value is 0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return 0; - } +function callbackfn(val, idx, obj) { + accessed = true; + return 0; +} assert.sameValue([11].some(callbackfn), false, '[11].some(callbackfn)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-6.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-6.js index f54c2e9a7898b2d5b181d7135cde044689353ae9..af669942452f68ce8181aad3181ab961fa1da66b 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-6.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-6.js @@ -9,12 +9,12 @@ description: > (value is +0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return +0; - } +function callbackfn(val, idx, obj) { + accessed = true; + return +0; +} assert.sameValue([11].some(callbackfn), false, '[11].some(callbackfn)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-7.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-7.js index eae2d4fcbadebc1039b6d0b0e2f69a0970b66231..ddb2d1df61e23f32e5240c160bbe9bfbdb555b31 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-7.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-7.js @@ -9,12 +9,12 @@ description: > (value is -0) ---*/ - var accessed = false; +var accessed = false; - function callbackfn(val, idx, obj) { - accessed = true; - return -0; - } +function callbackfn(val, idx, obj) { + accessed = true; + return -0; +} assert.sameValue([11].some(callbackfn), false, '[11].some(callbackfn)'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-8.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-8.js index a5fc01f223e0fb2fa87de01f481ed36e5708ada6..ce913320012ab292430ef2425c0163733c12fb55 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-8.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-8.js @@ -9,8 +9,8 @@ description: > (value is positive number) ---*/ - function callbackfn(val, idx, obj) { - return 5; - } +function callbackfn(val, idx, obj) { + return 5; +} assert([11].some(callbackfn), '[11].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-9.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-9.js index 2d966cbd0232aa1ef618742b266f168fbc01bf36..3f389202c62f7c9a49cd37c1838ebe4ff56cd8ef 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-9.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-iii-9.js @@ -9,8 +9,8 @@ description: > (value is negative number) ---*/ - function callbackfn(val, idx, obj) { - return -5; - } +function callbackfn(val, idx, obj) { + return -5; +} assert([11].some(callbackfn), '[11].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-8-1.js b/test/built-ins/Array/prototype/some/15.4.4.17-8-1.js index 0546141f505017bc34fe40123dbd0363935d13f7..d37fa7cb254c27e38ecf0f92fb3815ce023d68b5 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-8-1.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-8-1.js @@ -7,7 +7,7 @@ es5id: 15.4.4.17-8-1 description: Array.prototype.some returns false if 'length' is 0 (empty array) ---*/ - function cb(){} - var i = [].some(cb); +function cb() {} +var i = [].some(cb); assert.sameValue(i, false, 'i'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-8-10.js b/test/built-ins/Array/prototype/some/15.4.4.17-8-10.js index d3da6def0dc4fd548a5d93f2d17f9226c54b475c..bb8b38ba1e4fc0867c8c341b3657d534e3a6d494 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-8-10.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-8-10.js @@ -7,19 +7,20 @@ es5id: 15.4.4.17-8-10 description: Array.prototype.some - subclassed array when length is reduced ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = 2; +foo.prototype = new Array(1, 2, 3); - function cb(val) - { - if(val > 2) - return true; - else - return false; - } - var i = f.some(cb); +function foo() {} +var f = new foo(); +f.length = 2; + +function cb(val) +{ + if (val > 2) + return true; + else + return false; +} +var i = f.some(cb); assert.sameValue(i, false, 'i'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-8-11.js b/test/built-ins/Array/prototype/some/15.4.4.17-8-11.js index 8d5f1a786ce6c3007b84f96e97a78eea6122121b..c5914d1a6d8e10f280419636c4543eaa22f889ed 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-8-11.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-8-11.js @@ -9,14 +9,15 @@ description: > return false ---*/ - var callCnt = 0; - function callbackfn(val, idx, obj) - { - callCnt++; - return false; - } +var callCnt = 0; - var arr = [0,1,2,3,4,5,6,7,8,9]; +function callbackfn(val, idx, obj) +{ + callCnt++; + return false; +} + +var arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-8-12.js b/test/built-ins/Array/prototype/some/15.4.4.17-8-12.js index 5912e36c429bdba9c2ab9c847ce050e7be24d11a..0ba4ed10fb0d5b591cf9c0c7ffde81a13fd0f93b 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-8-12.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-8-12.js @@ -9,12 +9,12 @@ description: > called on ---*/ - function callbackfn(val, idx, obj) - { - return true; - } - var arr = [1,2,3,4,5]; - arr.some(callbackfn); +function callbackfn(val, idx, obj) +{ + return true; +} +var arr = [1, 2, 3, 4, 5]; +arr.some(callbackfn); assert.sameValue(arr[0], 1, 'arr[0]'); assert.sameValue(arr[1], 2, 'arr[1]'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-8-13.js b/test/built-ins/Array/prototype/some/15.4.4.17-8-13.js index 7ef5af8be4c49a81044258003d392fcd74e2ad1d..863317f9847dd0d280a329227208b649bf3445bb 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-8-13.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-8-13.js @@ -7,16 +7,17 @@ es5id: 15.4.4.17-8-13 description: Array.prototype.some doesn't visit expandos ---*/ - var callCnt = 0; - function callbackfn(val, idx, obj) - { - callCnt++; - return false; - } +var callCnt = 0; - var arr = [0,1,2,3,4,5,6,7,8,9]; - arr["i"] = 10; - arr[true] = 11; +function callbackfn(val, idx, obj) +{ + callCnt++; + return false; +} + +var arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; +arr["i"] = 10; +arr[true] = 11; assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-8-2.js b/test/built-ins/Array/prototype/some/15.4.4.17-8-2.js index da760e89458aa1330469842001003be72451bfc7..90ab6cb602f9dbe78080c87028f34a21461f3dc8 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-8-2.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-8-2.js @@ -9,13 +9,14 @@ description: > Array, length overridden to null (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = null; +foo.prototype = new Array(1, 2, 3); - function cb(){} - var i = f.some(cb); +function foo() {} +var f = new foo(); +f.length = null; + +function cb() {} +var i = f.some(cb); assert.sameValue(i, false, 'i'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-8-3.js b/test/built-ins/Array/prototype/some/15.4.4.17-8-3.js index f35fe21966c272842b30ab83f427bb2378c77861..efe0afb0c0ca60a2d08aea442d9564567d7540c3 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-8-3.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-8-3.js @@ -9,13 +9,14 @@ description: > Array, length overridden to false (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = false; +foo.prototype = new Array(1, 2, 3); - function cb(){} - var i = f.some(cb); +function foo() {} +var f = new foo(); +f.length = false; + +function cb() {} +var i = f.some(cb); assert.sameValue(i, false, 'i'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-8-4.js b/test/built-ins/Array/prototype/some/15.4.4.17-8-4.js index 5b6d7153e1a4c7721d13bbe89f6fb74217bff220..32bfde408049478e3d1cb1e4ac5dc174f372071f 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-8-4.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-8-4.js @@ -9,13 +9,14 @@ description: > Array, length overridden to 0 (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = 0; +foo.prototype = new Array(1, 2, 3); - function cb(){} - var i = f.some(cb); +function foo() {} +var f = new foo(); +f.length = 0; + +function cb() {} +var i = f.some(cb); assert.sameValue(i, false, 'i'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-8-5.js b/test/built-ins/Array/prototype/some/15.4.4.17-8-5.js index e66aa4802984b391628bdc9e90a39669026e0c8d..1e2fe9b3bfd3fae45e83540bad55321b22602c43 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-8-5.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-8-5.js @@ -9,13 +9,14 @@ description: > Array, length overridden to '0' (type conversion)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - f.length = '0'; +foo.prototype = new Array(1, 2, 3); - function cb(){} - var i = f.some(cb); +function foo() {} +var f = new foo(); +f.length = '0'; + +function cb() {} +var i = f.some(cb); assert.sameValue(i, false, 'i'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-8-6.js b/test/built-ins/Array/prototype/some/15.4.4.17-8-6.js index 5607fad05ca75a7dc2e0a41fdb599a19ce4acf27..546c43f500fd36d732fe61cf4c6a26790433f025 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-8-6.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-8-6.js @@ -9,15 +9,20 @@ description: > Array, length overridden with obj with valueOf) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - var o = { valueOf: function () { return 0;}}; - f.length = o; +function foo() {} +var f = new foo(); - function cb(){} - var i = f.some(cb); +var o = { + valueOf: function() { + return 0; + } +}; +f.length = o; + +function cb() {} +var i = f.some(cb); assert.sameValue(i, false, 'i'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-8-7.js b/test/built-ins/Array/prototype/some/15.4.4.17-8-7.js index c483ee3d6e36fbd316e6bd58b4a4e480332f3e56..1b4d757c00c24188370f55ee3c01b6ef659665af 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-8-7.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-8-7.js @@ -9,21 +9,26 @@ description: > Array, length overridden with obj w/o valueOf (toString)) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - var o = { toString: function () { return '0';}}; - f.length = o; +function foo() {} +var f = new foo(); - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. +var o = { + toString: function() { + return '0'; + } +}; +f.length = o; - function cb(){} - var i = f.some(cb); +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. + +function cb() {} +var i = f.some(cb); assert.sameValue(i, false, 'i'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-8-8.js b/test/built-ins/Array/prototype/some/15.4.4.17-8-8.js index 14dd2908f98ac17372025e83cb1eadb24990cc78..1365c1fafb33fdee75e744de742b78de36782ba2 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-8-8.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-8-8.js @@ -9,28 +9,29 @@ description: > Array, length overridden with [] ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); - - f.length = []; - - // objects inherit the default valueOf method of the Object object; - // that simply returns the itself. Since the default valueOf() method - // does not return a primitive value, ES next tries to convert the object - // to a number by calling its toString() method and converting the - // resulting string to a number. - // - // The toString( ) method on Array converts the array elements to strings, - // then returns the result of concatenating these strings, with commas in - // between. An array with no elements converts to the empty string, which - // converts to the number 0. If an array has a single element that is a - // number n, the array converts to a string representation of n, which is - // then converted back to n itself. If an array contains more than one element, - // or if its one element is not a number, the array converts to NaN. - - function cb(){} - var i = f.some(cb); +foo.prototype = new Array(1, 2, 3); + +function foo() {} +var f = new foo(); + +f.length = []; + +// objects inherit the default valueOf method of the Object object; +// that simply returns the itself. Since the default valueOf() method +// does not return a primitive value, ES next tries to convert the object +// to a number by calling its toString() method and converting the +// resulting string to a number. +// +// The toString( ) method on Array converts the array elements to strings, +// then returns the result of concatenating these strings, with commas in +// between. An array with no elements converts to the empty string, which +// converts to the number 0. If an array has a single element that is a +// number n, the array converts to a string representation of n, which is +// then converted back to n itself. If an array contains more than one element, +// or if its one element is not a number, the array converts to NaN. + +function cb() {} +var i = f.some(cb); assert.sameValue(i, false, 'i'); diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A1.2_T2.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A1.2_T2.js index 4dbefaaf61026c511e4a1f5f70b63661921a0951..b4321097875b125e706d48109de9229b90ed7b0d 100644 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A1.2_T2.js +++ b/test/built-ins/Array/prototype/sort/S15.4.4.11_A1.2_T2.js @@ -11,7 +11,7 @@ es5id: 15.4.4.11_A1.2_T2 description: If comparefn is not undefined ---*/ -var myComparefn = function(x,y) { +var myComparefn = function(x, y) { if (x === undefined) return -1; if (y === undefined) return 1; return 0; diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A1.4_T2.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A1.4_T2.js index 2a141dba519ac4671d7aa6b1d954c01cd882928e..0f6a2735713a62b46ba6031bd8dd398d95b02e26 100644 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A1.4_T2.js +++ b/test/built-ins/Array/prototype/sort/S15.4.4.11_A1.4_T2.js @@ -10,7 +10,7 @@ es5id: 15.4.4.11_A1.4_T2 description: If comparefn is not undefined ---*/ -var myComparefn = function(x,y) { +var myComparefn = function(x, y) { if (x === undefined) return -1; if (y === undefined) return 1; return 0; diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A1.5_T1.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A1.5_T1.js index 334aa6263e9ba2600f1c619fa2e9fb755f07ae8c..321b6f63ff58964b0a6591bd5fc2f0964ae6e7b3 100644 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A1.5_T1.js +++ b/test/built-ins/Array/prototype/sort/S15.4.4.11_A1.5_T1.js @@ -8,7 +8,7 @@ es5id: 15.4.4.11_A1.5_T1 description: Checking sort() and sort(undefined) ---*/ -var x = new Array(1,0); +var x = new Array(1, 0); x.sort(); //CHECK#1 @@ -26,7 +26,7 @@ if (x[1] !== 1) { $ERROR('#3: var x = new Array(1,0); x.sort(); x[1] === 1. Actual: ' + (x[1])); } -var x = new Array(1,0); +var x = new Array(1, 0); x.sort(undefined); //CHECK#4 diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A2.1_T2.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A2.1_T2.js index 336bcadfffac072642ca6f1ea708dd8927b58d50..044858b0ab1be21eeed3a4df4c532e767775d12d 100644 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A2.1_T2.js +++ b/test/built-ins/Array/prototype/sort/S15.4.4.11_A2.1_T2.js @@ -12,7 +12,7 @@ description: Checking RUSSIAN ALPHABET ---*/ var alphabetR = ["Ñ‘", "Ñ", "ÑŽ", "Ñ", "ÑŒ", "Ñ‹", "ÑŠ", "щ", "ш", "ч", "ц", "Ñ…", "Ñ„", "у", "Ñ‚", "Ñ", "Ñ€", "П", "О", "Ð", "Ðœ", "Л", "К", "Й", "И", "З", "Ж", "Е", "Д", "Г", "Ð’", "Б", "Ð"]; -var alphabet = ["Ð", "Б", "Ð’", "Г", "Д", "Е", "Ж", "З", "И", "Й", "К", "Л", "Ðœ", "Ð", "О", "П", "Ñ€", "Ñ", "Ñ‚", "у", "Ñ„", "Ñ…", "ц", "ч", "ш", "щ", "ÑŠ", "Ñ‹", "ÑŒ", "Ñ", "ÑŽ", "Ñ", "Ñ‘"]; +var alphabet = ["Ð", "Б", "Ð’", "Г", "Д", "Е", "Ж", "З", "И", "Й", "К", "Л", "Ðœ", "Ð", "О", "П", "Ñ€", "Ñ", "Ñ‚", "у", "Ñ„", "Ñ…", "ц", "ч", "ш", "щ", "ÑŠ", "Ñ‹", "ÑŒ", "Ñ", "ÑŽ", "Ñ", "Ñ‘"]; //CHECK#1 alphabetR.sort(); diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A2.1_T3.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A2.1_T3.js index de262fd3ca3cbf6f3e82b20b4798f3de9acc66c7..c2bfb061552ec82cc93584bdd22efcf21e89fbbf 100644 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A2.1_T3.js +++ b/test/built-ins/Array/prototype/sort/S15.4.4.11_A2.1_T3.js @@ -11,9 +11,16 @@ es5id: 15.4.4.11_A2.1_T3 description: Checking ToString operator ---*/ -var obj = {valueOf: function() {return 1}, toString: function() {return -2}}; +var obj = { + valueOf: function() { + return 1 + }, + toString: function() { + return -2 + } +}; var alphabetR = [undefined, 2, 1, "X", -1, "a", true, obj, NaN, Infinity]; -var alphabet = [-1, obj, 1, 2, Infinity, NaN, "X", "a", true, undefined]; +var alphabet = [-1, obj, 1, 2, Infinity, NaN, "X", "a", true, undefined]; //CHECK#1 alphabetR.sort(); diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A2.2_T1.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A2.2_T1.js index 537e1be33d1ffda3db256bae80242b9d941b038d..771eba4c84e406c208dfa5a7c5d370a67cdc0691 100644 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A2.2_T1.js +++ b/test/built-ins/Array/prototype/sort/S15.4.4.11_A2.2_T1.js @@ -9,9 +9,9 @@ description: Checking ENGLISH ALPHABET ---*/ var alphabetR = ["z", "y", "x", "w", "v", "u", "t", "s", "r", "q", "p", "o", "n", "M", "L", "K", "J", "I", "H", "G", "F", "E", "D", "C", "B", "A"]; -var alphabet = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; +var alphabet = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; -var myComparefn = function(x,y) { +var myComparefn = function(x, y) { var xS = String(x); var yS = String(y); if (xS < yS) return 1 diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A2.2_T2.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A2.2_T2.js index 2c67068aefa0f0d5ed62f8b4ad50858e14e69524..0075ca2990482b29bd1a86fc5831b1091585743d 100644 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A2.2_T2.js +++ b/test/built-ins/Array/prototype/sort/S15.4.4.11_A2.2_T2.js @@ -9,9 +9,9 @@ description: Checking RUSSIAN ALPHABET ---*/ var alphabetR = ["Ñ‘", "Ñ", "ÑŽ", "Ñ", "ÑŒ", "Ñ‹", "ÑŠ", "щ", "ш", "ч", "ц", "Ñ…", "Ñ„", "у", "Ñ‚", "Ñ", "Ñ€", "П", "О", "Ð", "Ðœ", "Л", "К", "Й", "И", "З", "Ж", "Е", "Д", "Г", "Ð’", "Б", "Ð"]; -var alphabet = ["Ð", "Б", "Ð’", "Г", "Д", "Е", "Ж", "З", "И", "Й", "К", "Л", "Ðœ", "Ð", "О", "П", "Ñ€", "Ñ", "Ñ‚", "у", "Ñ„", "Ñ…", "ц", "ч", "ш", "щ", "ÑŠ", "Ñ‹", "ÑŒ", "Ñ", "ÑŽ", "Ñ", "Ñ‘"]; +var alphabet = ["Ð", "Б", "Ð’", "Г", "Д", "Е", "Ж", "З", "И", "Й", "К", "Л", "Ðœ", "Ð", "О", "П", "Ñ€", "Ñ", "Ñ‚", "у", "Ñ„", "Ñ…", "ц", "ч", "ш", "щ", "ÑŠ", "Ñ‹", "ÑŒ", "Ñ", "ÑŽ", "Ñ", "Ñ‘"]; -var myComparefn = function(x,y) { +var myComparefn = function(x, y) { var xS = String(x); var yS = String(y); if (xS < yS) return 1 diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A2.2_T3.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A2.2_T3.js index ddc5354f08385aa4cdfee8fbf6a703575f53a115..6e5df4ec45731b299eb763b27132c9f6b7dd2960 100644 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A2.2_T3.js +++ b/test/built-ins/Array/prototype/sort/S15.4.4.11_A2.2_T3.js @@ -8,11 +8,18 @@ es5id: 15.4.4.11_A2.2_T3 description: Checking ToString operator ---*/ -var obj = {valueOf: function() {return 1}, toString: function() {return -2}}; +var obj = { + valueOf: function() { + return 1 + }, + toString: function() { + return -2 + } +}; var alphabetR = [undefined, 2, 1, "X", -1, "a", true, obj, NaN, Infinity]; var alphabet = [true, "a", "X", NaN, Infinity, 2, 1, obj, -1, undefined]; -var myComparefn = function(x,y) { +var myComparefn = function(x, y) { var xS = String(x); var yS = String(y); if (xS < yS) return 1 diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A3_T1.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A3_T1.js index d4598f7c03451efb5457d04bdea823f191ead059..c8fe6d58f252f73e8eb4436b284db8004eb89197 100644 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A3_T1.js +++ b/test/built-ins/Array/prototype/sort/S15.4.4.11_A3_T1.js @@ -10,15 +10,33 @@ es5id: 15.4.4.11_A3_T1 description: If comparefn is undefined, use SortCompare operator ---*/ -var obj = {valueOf: function() {return 1}, toString: function() {return -2}}; -var alphabetR = {0:undefined, 1:2, 2:1, 3:"X", 4:-1, 5:"a", 6:true, 7:obj, 8:NaN, 9:Infinity}; +var obj = { + valueOf: function() { + return 1 + }, + toString: function() { + return -2 + } +}; +var alphabetR = { + 0: undefined, + 1: 2, + 2: 1, + 3: "X", + 4: -1, + 5: "a", + 6: true, + 7: obj, + 8: NaN, + 9: Infinity +}; alphabetR.sort = Array.prototype.sort; alphabetR.length = 10; var alphabet = [-1, obj, 1, 2, Infinity, NaN, "X", "a", true, undefined]; alphabetR.sort(); - //CHECK#0 +//CHECK#0 alphabetR.getClass = Object.prototype.toString; if (alphabetR.getClass() !== "[object " + "Object" + "]") { $ERROR('#0: alphabetR.sort() is Object object, not Array object'); diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A3_T2.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A3_T2.js index e5c56d65d36136e0511ec016e6e565ae114ff23a..5da87d3d439181761bcd7538fb93f339218b86d4 100644 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A3_T2.js +++ b/test/built-ins/Array/prototype/sort/S15.4.4.11_A3_T2.js @@ -10,13 +10,31 @@ es5id: 15.4.4.11_A3_T2 description: If comparefn is not undefined ---*/ -var obj = {valueOf: function() {return 1}, toString: function() {return -2}}; -var alphabetR = {0:undefined, 1:2, 2:1, 3:"X", 4:-1, 5:"a", 6:true, 7:obj, 8:NaN, 9:Infinity}; +var obj = { + valueOf: function() { + return 1 + }, + toString: function() { + return -2 + } +}; +var alphabetR = { + 0: undefined, + 1: 2, + 2: 1, + 3: "X", + 4: -1, + 5: "a", + 6: true, + 7: obj, + 8: NaN, + 9: Infinity +}; alphabetR.sort = Array.prototype.sort; alphabetR.length = 10; var alphabet = [true, "a", "X", NaN, Infinity, 2, 1, obj, -1, undefined]; - var myComparefn = function(x,y) { +var myComparefn = function(x, y) { var xS = String(x); var yS = String(y); if (xS < yS) return 1 @@ -26,7 +44,7 @@ var alphabet = [true, "a", "X", NaN, Infinity, 2, 1, obj, -1, undefined]; alphabetR.sort(myComparefn); - //CHECK#0 +//CHECK#0 alphabetR.getClass = Object.prototype.toString; if (alphabetR.getClass() !== "[object " + "Object" + "]") { $ERROR('#0: alphabetR.sort() is Object object, not Array object'); diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A5_T1.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A5_T1.js index b1549f26e688d69612cb6f768866f2f467e5468c..32ddbcd187fb17352d8f5c09efbe5e73b06407a0 100644 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A5_T1.js +++ b/test/built-ins/Array/prototype/sort/S15.4.4.11_A5_T1.js @@ -9,14 +9,14 @@ description: comparefn function throw "error" ---*/ //CHECK#1 -var myComparefn = function(x,y) { +var myComparefn = function(x, y) { throw "error"; } -var x = [1,0]; +var x = [1, 0]; try { x.sort(myComparefn) $ERROR('#1.1: Array.sort should not eat exceptions'); -} catch(e) { +} catch (e) { if (e !== "error") { $ERROR('#1.2: Array.sort should not eat exceptions'); } diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A6_T2.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A6_T2.js index 4b623ca34b03fd40806626dc5ee74d9966cf72fb..4d26b4701334960e4a9031eff891b5035a212475 100644 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A6_T2.js +++ b/test/built-ins/Array/prototype/sort/S15.4.4.11_A6_T2.js @@ -11,7 +11,7 @@ description: > ---*/ Array.prototype[1] = -1; -var x = [1,0]; +var x = [1, 0]; x.length = 2; x.sort(); @@ -40,7 +40,10 @@ if (x[1] !== -1) { Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.sort = Array.prototype.sort; -x = {0:1,1:0}; +x = { + 0: 1, + 1: 0 +}; x.sort(); //CHECK#5 diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A8.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A8.js index 289887f032dd5667ff09393b96e17d179efa5a60..bfa49d90aeab059c382f69a567bf9d12902836e1 100644 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A8.js +++ b/test/built-ins/Array/prototype/sort/S15.4.4.11_A8.js @@ -10,7 +10,7 @@ flags: [noStrict] ---*/ var global = this; -[2,3].sort(function(x,y) { +[2, 3].sort(function(x, y) { "use strict"; if (this === global) { @@ -18,7 +18,7 @@ var global = this; } if (this !== undefined) { $ERROR('#2: Sort comparefn should be called with this===undefined. ' + - 'Actual: ' + this); + 'Actual: ' + this); } return x - y; }); diff --git a/test/built-ins/Array/prototype/sort/bug_596_1.js b/test/built-ins/Array/prototype/sort/bug_596_1.js index 1c6e4d724d8842c7baf7bfda15d9b28649f8970b..a144d9fcde5d2882915dbe68b802c1706deecece 100644 --- a/test/built-ins/Array/prototype/sort/bug_596_1.js +++ b/test/built-ins/Array/prototype/sort/bug_596_1.js @@ -11,10 +11,10 @@ author: Thomas Dahlstrom (tdahlstrom@gmail.com) var counter = 0; var object = { - toString: function(){ - counter++; - return ""; - } + toString: function() { + counter++; + return ""; + } }; [object, object].sort(); diff --git a/test/built-ins/Array/prototype/sort/bug_596_2.js b/test/built-ins/Array/prototype/sort/bug_596_2.js index 1fbcd77cebe2a75120c66df5c6d479d3f8a92637..ec571de20bb31d587408915f85b2faf0aafeddf7 100644 --- a/test/built-ins/Array/prototype/sort/bug_596_2.js +++ b/test/built-ins/Array/prototype/sort/bug_596_2.js @@ -10,46 +10,46 @@ description: > author: Thomas Dahlstrom (tdahlstrom@gmail.com) ---*/ -var array = ['a',,void 0]; +var array = ['a', , void 0]; //CHECK#1 if (array.length !== 3) { - $ERROR('#1: array.length !== 3. Actual: ' + (array.length)) + $ERROR('#1: array.length !== 3. Actual: ' + (array.length)) } //CHECK#2 if (array.hasOwnProperty('0') !== true) { - $ERROR("#2: array.hasOwnProperty('0'). Actual: " + array.hasOwnProperty('0')); + $ERROR("#2: array.hasOwnProperty('0'). Actual: " + array.hasOwnProperty('0')); } //CHECK#3 if (array.hasOwnProperty('1') !== false) { - $ERROR("#3: array.hasOwnProperty('1'). Actual: " + array.hasOwnProperty('1')); + $ERROR("#3: array.hasOwnProperty('1'). Actual: " + array.hasOwnProperty('1')); } //CHECK#4 if (array.hasOwnProperty('2') !== true) { - $ERROR("#4: array.hasOwnProperty('2'). Actual: " + array.hasOwnProperty('2')); + $ERROR("#4: array.hasOwnProperty('2'). Actual: " + array.hasOwnProperty('2')); } array.sort(); //CHECK#5 if (array.length !== 3) { - $ERROR('#5: array.length !== 3. Actual: ' + (array.length)) + $ERROR('#5: array.length !== 3. Actual: ' + (array.length)) } //CHECK#6 if (array.hasOwnProperty('0') !== true) { - $ERROR("#6: array.hasOwnProperty('0'). Actual: " + array.hasOwnProperty('0')); + $ERROR("#6: array.hasOwnProperty('0'). Actual: " + array.hasOwnProperty('0')); } //CHECK#7 if (array.hasOwnProperty('1') !== true) { - $ERROR("#7: array.hasOwnProperty('1'). Actual: " + array.hasOwnProperty('1')); + $ERROR("#7: array.hasOwnProperty('1'). Actual: " + array.hasOwnProperty('1')); } //CHECK#8 if (array.hasOwnProperty('2') !== false) { - $ERROR("#8: array.hasOwnProperty('2'). Actual: " + array.hasOwnProperty('2')); + $ERROR("#8: array.hasOwnProperty('2'). Actual: " + array.hasOwnProperty('2')); } diff --git a/test/built-ins/Array/prototype/sort/comparefn-nonfunction-call-throws.js b/test/built-ins/Array/prototype/sort/comparefn-nonfunction-call-throws.js index c35b0f876e68a2d11e0ae088119241f5de8782c1..62ab296449af37c1fe411d87e9b4dcf769643073 100644 --- a/test/built-ins/Array/prototype/sort/comparefn-nonfunction-call-throws.js +++ b/test/built-ins/Array/prototype/sort/comparefn-nonfunction-call-throws.js @@ -23,7 +23,7 @@ var poisoned = { }; assert.throws(TypeError, function() { - sample.sort(null); + sample.sort(null); }, "sample.sort(null);"); assert.throws(TypeError, function() { diff --git a/test/built-ins/Array/prototype/splice/15.4.4.12-9-a-1.js b/test/built-ins/Array/prototype/splice/15.4.4.12-9-a-1.js index 8ec20c11c84e5ae6a051b5a3c9ac907bc7225c55..0e0d144a6a6d15e0b5bdfa3b44c8a5c15cf11886 100644 --- a/test/built-ins/Array/prototype/splice/15.4.4.12-9-a-1.js +++ b/test/built-ins/Array/prototype/splice/15.4.4.12-9-a-1.js @@ -9,8 +9,8 @@ description: > ToString(actualStart+k) in an Array ---*/ - var arrObj = [1, 2, 3]; - var newArrObj = arrObj.splice(-2, 1); +var arrObj = [1, 2, 3]; +var newArrObj = arrObj.splice(-2, 1); assert.sameValue(newArrObj.length, 1, 'newArrObj.length'); assert.sameValue(newArrObj[0], 2, 'newArrObj[0]'); diff --git a/test/built-ins/Array/prototype/splice/15.4.4.12-9-c-ii-1.js b/test/built-ins/Array/prototype/splice/15.4.4.12-9-c-ii-1.js index e911470f0104f5e70f011ab24cc4e820e31048d4..ab59bcf6f59e4176780127d2e90c0386049d51cf 100644 --- a/test/built-ins/Array/prototype/splice/15.4.4.12-9-c-ii-1.js +++ b/test/built-ins/Array/prototype/splice/15.4.4.12-9-c-ii-1.js @@ -10,28 +10,28 @@ description: > less than 'actualDeleteCount (Step 9.c.ii) ---*/ - var arr = ["a", "b", "c"]; - Array.prototype[0] = "test"; - var newArr = arr.splice(2, 1, "d"); +var arr = ["a", "b", "c"]; +Array.prototype[0] = "test"; +var newArr = arr.splice(2, 1, "d"); - var verifyValue = false; - verifyValue = arr.length === 3 && arr[0] === "a" && arr[1] === "b" && arr[2] === "d" - && newArr[0] === "c" && newArr.length === 1; +var verifyValue = false; +verifyValue = arr.length === 3 && arr[0] === "a" && arr[1] === "b" && arr[2] === "d" && + newArr[0] === "c" && newArr.length === 1; - var verifyEnumerable = false; - for (var p in newArr) { - if (newArr.hasOwnProperty("0") && p === "0") { - verifyEnumerable = true; - } - } +var verifyEnumerable = false; +for (var p in newArr) { + if (newArr.hasOwnProperty("0") && p === "0") { + verifyEnumerable = true; + } +} - var verifyWritable = false; - newArr[0] = 12; - verifyWritable = newArr[0] === 12; +var verifyWritable = false; +newArr[0] = 12; +verifyWritable = newArr[0] === 12; - var verifyConfigurable = false; - delete newArr[0]; - verifyConfigurable = newArr.hasOwnProperty("0"); +var verifyConfigurable = false; +delete newArr[0]; +verifyConfigurable = newArr.hasOwnProperty("0"); assert(verifyValue, 'verifyValue !== true'); assert.sameValue(verifyConfigurable, false, 'verifyConfigurable'); diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T1.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T1.js index 27bc884add4edc74b022f840fb89199d571030eb..5cdd55a4ee9fb7bdab1cc12839c140c6dc9a13ee 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T1.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T1.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.1_T1 description: length > deleteCount > start = 0, itemCount = 0 ---*/ -var x = [0,1,2,3]; -var arr = x.splice(0,3); +var x = [0, 1, 2, 3]; +var arr = x.splice(0, 3); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T2.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T2.js index 12cd147ecf3a8c39fabc3f29c89c3c5324881252..3685147d672d57cc6c4dbc909a8e5ea227b8814f 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T2.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T2.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.1_T2 description: length > deleteCount > start = 0, itemCount > 0 ---*/ -var x = [0,1,2,3]; -var arr = x.splice(0,3,4,5); +var x = [0, 1, 2, 3]; +var arr = x.splice(0, 3, 4, 5); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T3.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T3.js index 118d0a82a956f9e60a53422a688a4518adbc4b84..713f6a0416a61720bd496d63803004d10c6a15e3 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T3.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T3.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.1_T3 description: length = deleteCount > start = 0 ---*/ -var x = [0,1,2,3]; -var arr = x.splice(0,4); +var x = [0, 1, 2, 3]; +var arr = x.splice(0, 4); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T4.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T4.js index 5fb23994248255e86667e56ab9a14cc8dfbfdd8d..0eb829e794d43c104448fe4ce88eb83fac95f11b 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T4.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T4.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.1_T4 description: length > deleteCount > start > 0, itemCount > 0 ---*/ -var x = [0,1,2,3]; -var arr = x.splice(1,3,4,5); +var x = [0, 1, 2, 3]; +var arr = x.splice(1, 3, 4, 5); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T5.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T5.js index 9e2dac61f73dedda8f287689087460e856930338..652524bd110a34c52c9583a1698792d45b6f916c 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T5.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T5.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.1_T5 description: deleteCount > length > start = 0, itemCount = 0 ---*/ -var x = [0,1,2,3]; -var arr = x.splice(0,5); +var x = [0, 1, 2, 3]; +var arr = x.splice(0, 5); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T6.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T6.js index 0ea1d8bcee5e82d4167806e75682365231a79958..91253b80f131c33a55e4a137f478183bea04d765 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T6.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.1_T6.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.1_T6 description: length = deleteCount > start > 0, itemCount > 0 ---*/ -var x = [0,1,2,3]; -var arr = x.splice(1,4,4,5); +var x = [0, 1, 2, 3]; +var arr = x.splice(1, 4, 4, 5); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.2_T1.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.2_T1.js index 1929add9474090f116856459ecb05214d95980a8..0db991b3ecb49b09e0cbc9f05fbe59cb11018cd7 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.2_T1.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.2_T1.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.2_T1 description: -length = start < deleteCount < 0, itemCount = 0 ---*/ -var x = [0,1]; -var arr = x.splice(-2,-1); +var x = [0, 1]; +var arr = x.splice(-2, -1); //CHECK#0 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.2_T2.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.2_T2.js index fddd02dc840ac1ee416027fb664f267ce12215f3..0be3d2398cbb5a4510ed9867dd57282964e9198e 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.2_T2.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.2_T2.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.2_T2 description: -length < start = deleteCount < 0, itemCount = 0 ---*/ -var x = [0,1]; -var arr = x.splice(-1,-1); +var x = [0, 1]; +var arr = x.splice(-1, -1); //CHECK#0 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.2_T3.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.2_T3.js index f5d24cac350a7d2caf1846c80d9aa005ca95c6ea..89e1ee2b5b9be7964565fef274c737e1a5a92d3f 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.2_T3.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.2_T3.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.2_T3 description: -length = start < deleteCount < 0, itemCount > 0 ---*/ -var x = [0,1]; -var arr = x.splice(-2,-1,2,3); +var x = [0, 1]; +var arr = x.splice(-2, -1, 2, 3); //CHECK#0 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.2_T4.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.2_T4.js index bb68a76802ac263a256b4960feb7bf501313bfcb..02e2dbea8419188f9ca01a43436f815c37f5f602 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.2_T4.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.2_T4.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.2_T4 description: -length < start = deleteCount < 0, itemCount > 0 ---*/ -var x = [0,1]; -var arr = x.splice(-1,-1,2,3); +var x = [0, 1]; +var arr = x.splice(-1, -1, 2, 3); //CHECK#0 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.2_T5.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.2_T5.js index f8fc1eccbc20114d8095d4d9993b4f04d6c37178..ed8efafe781cfd9dfb729116cde2f5c20d31bf55 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.2_T5.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.2_T5.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.2_T5 description: start < -length < deleteCount < 0, itemCount > 0 ---*/ -var x = [0,1]; -var arr = x.splice(-3,-1,2,3); +var x = [0, 1]; +var arr = x.splice(-3, -1, 2, 3); //CHECK#0 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.3_T1.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.3_T1.js index 909d270ac1db00fb87e7dbd1c07dbdf41be8f999..66c3d55e21b230aba6dfc008ce37395afec0bd1d 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.3_T1.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.3_T1.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.3_T1 description: -length < deleteCount < start = 0, itemCount = 0 ---*/ -var x = [0,1]; -var arr = x.splice(0,-1); +var x = [0, 1]; +var arr = x.splice(0, -1); //CHECK#0 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.3_T2.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.3_T2.js index 44917a67fabd5ad70599faa0cbe9925056aa8b2e..089a2ce8c3022c05f0ae795d1c49e4b1bb1e540c 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.3_T2.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.3_T2.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.3_T2 description: -length = -start < deleteCount < 0, itemCount = 0 ---*/ -var x = [0,1]; -var arr = x.splice(2,-1); +var x = [0, 1]; +var arr = x.splice(2, -1); //CHECK#0 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.3_T3.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.3_T3.js index f4f2678ad97f4c7a5e436aa53923340925dbc8b3..5c56b995ac5d0cd1c0518f5c8267e09aa90f0776 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.3_T3.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.3_T3.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.3_T3 description: -length < deleteCount < start = 0, itemCount > 0 ---*/ -var x = [0,1]; -var arr = x.splice(0,-1,2,3); +var x = [0, 1]; +var arr = x.splice(0, -1, 2, 3); //CHECK#0 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.3_T4.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.3_T4.js index 13325745382e30d8a2ee52b141f2cdc830d06806..828e21cbbb24a86b63e3e2e4f7a663fabcde8115 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.3_T4.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.3_T4.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.3_T4 description: -length = -start < deleteCount < 0, itemCount > 0 ---*/ -var x = [0,1]; -var arr = x.splice(2,-1,2,3); +var x = [0, 1]; +var arr = x.splice(2, -1, 2, 3); //CHECK#0 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.3_T5.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.3_T5.js index 8c4475cd7eb29365be38837c5fc6876e883140cf..cd2ccab2ca4a8d0d08a36b472dafa6a21135511a 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.3_T5.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.3_T5.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.3_T5 description: -start < -length < deleteCount < 0, itemCount > 0 ---*/ -var x = [0,1]; -var arr = x.splice(3,-1,2,3); +var x = [0, 1]; +var arr = x.splice(3, -1, 2, 3); //CHECK#0 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T1.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T1.js index 01605c746de0e5c626243f2b2f811847c9c0d0df..9b4cd2228c4f7a6da7999b8311d8d3ed2ffb35f0 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T1.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T1.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.4_T1 description: length = -start > deleteCount > 0, itemCount = 0 ---*/ -var x = [0,1,2,3]; -var arr = x.splice(-4,3); +var x = [0, 1, 2, 3]; +var arr = x.splice(-4, 3); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T2.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T2.js index 2862b3f60d0b3019f170c8a023a0f937991056da..d531be2ee14e3429d795cd39db3aeb8b4d8ea3cc 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T2.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T2.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.4_T2 description: length = -start > deleteCount > 0, itemCount > 0 ---*/ -var x = [0,1,2,3]; -var arr = x.splice(-4,3,4,5); +var x = [0, 1, 2, 3]; +var arr = x.splice(-4, 3, 4, 5); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T3.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T3.js index 4be6a0b978d453d5cf515f3e73be7d81df1f3640..318d33a440040506328715aa3ce75e4cbb31df21 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T3.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T3.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.4_T3 description: -start > length = deleteCount > 0, itemCount = 0 ---*/ -var x = [0,1,2,3]; -var arr = x.splice(-5,4); +var x = [0, 1, 2, 3]; +var arr = x.splice(-5, 4); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T4.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T4.js index 2dffe18b3d97a707ad14a8d68b6e83d89e2e4d7f..9c2e3c579865d6bb8615ea33e0a993f549dcf9da 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T4.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T4.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.4_T4 description: length > -start = deleteCount > 0, itemCount > 0 ---*/ -var x = [0,1,2,3]; -var arr = x.splice(-3,3,4,5); +var x = [0, 1, 2, 3]; +var arr = x.splice(-3, 3, 4, 5); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T5.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T5.js index 37ec9f17f0e720658bbe48a2628a2867fd5e12d4..4d051f44c385b0e8082fe59a4ea0975749d88d94 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T5.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T5.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.4_T5 description: -start > deleteCount > length > 0, itemCount = 0 ---*/ -var x = [0,1,2,3]; -var arr = x.splice(-9,5); +var x = [0, 1, 2, 3]; +var arr = x.splice(-9, 5); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T6.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T6.js index 4fa9aed73e590b5dccbb6d36dc468f03f7aeb647..779089de147a2fbf7831ca3021b46f6a5f50fd20 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T6.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.4_T6.js @@ -10,8 +10,8 @@ es5id: 15.4.4.12_A1.4_T6 description: length = deleteCount > -start > 0, itemCount > 0 ---*/ -var x = [0,1,2,3]; -var arr = x.splice(-3,4,4,5); +var x = [0, 1, 2, 3]; +var arr = x.splice(-3, 4, 4, 5); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.5_T1.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.5_T1.js index ec581518de97bc638188472f0b5d6070bd0bdd96..046f111f8c6dc1d8f717c7a46fba106132546c7e 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.5_T1.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.5_T1.js @@ -8,7 +8,7 @@ es5id: 15.4.4.12_A1.5_T1 description: start === undefined, end === undefined ---*/ -var x = [0,1,2,3]; +var x = [0, 1, 2, 3]; var arr = x.splice(undefined, undefined); //CHECK#1 diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.5_T2.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.5_T2.js index 5551f3596cc5913c56e73252d69455ca7248ed22..4741352b58188112ee9095e01796d0a6b07c1216 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.5_T2.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A1.5_T2.js @@ -8,8 +8,8 @@ es5id: 15.4.4.12_A1.5_T2 description: end === undefined ---*/ -var x = [0,1,2,3]; -var arr = x.splice(1,undefined); +var x = [0, 1, 2, 3]; +var arr = x.splice(1, undefined); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.1_T1.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.1_T1.js index 32848cc6fbf65de734483ad301f70cdbc9a86f1b..2e66e7f34bacac6e56c6e59c26ac12bef2b1847e 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.1_T1.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.1_T1.js @@ -8,8 +8,8 @@ es5id: 15.4.4.12_A2.1_T1 description: start is not integer ---*/ -var x = [0,1,2,3]; -var arr = x.splice(1.5,3); +var x = [0, 1, 2, 3]; +var arr = x.splice(1.5, 3); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.1_T2.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.1_T2.js index 4e379cda8f146fce399b2c58f0c001da732fa0ae..94ef13972064af94a2f3a2689838bf2b1f06a01c 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.1_T2.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.1_T2.js @@ -8,8 +8,8 @@ es5id: 15.4.4.12_A2.1_T2 description: start = NaN ---*/ -var x = [0,1,2,3]; -var arr = x.splice(NaN,3); +var x = [0, 1, 2, 3]; +var arr = x.splice(NaN, 3); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.1_T3.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.1_T3.js index 807c0a41ad0b9b05721ec2a6256c2c0df8abb2c4..eaf3c07a1b4fe05363d3f1a50e288d876637957d 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.1_T3.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.1_T3.js @@ -8,8 +8,8 @@ es5id: 15.4.4.12_A2.1_T3 description: start = Infinity ---*/ -var x = [0,1,2,3]; -var arr = x.splice(Number.POSITIVE_INFINITY,3); +var x = [0, 1, 2, 3]; +var arr = x.splice(Number.POSITIVE_INFINITY, 3); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.1_T4.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.1_T4.js index 083ed9ca89a74b111033b97de5c437c52de34736..939454e4887d6cd60e4f5197d503ee1ffb022e8b 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.1_T4.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.1_T4.js @@ -8,8 +8,8 @@ es5id: 15.4.4.12_A2.1_T4 description: start = -Infinity ---*/ -var x = [0,1,2,3]; -var arr = x.splice(Number.NEGATIVE_INFINITY,3); +var x = [0, 1, 2, 3]; +var arr = x.splice(Number.NEGATIVE_INFINITY, 3); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.1_T5.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.1_T5.js index 51a7aa7654ca1b35bff599ce19e4a3637e22ebd3..9cf978a5867e9ed380e51e6376887f743f4c1303 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.1_T5.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.1_T5.js @@ -8,8 +8,15 @@ es5id: 15.4.4.12_A2.1_T5 description: ToInteger use ToNumber ---*/ -var x = [0,1,2,3]; -var arr = x.splice({valueOf: function() {return 0}, toString: function() {return 3}},3); +var x = [0, 1, 2, 3]; +var arr = x.splice({ + valueOf: function() { + return 0 + }, + toString: function() { + return 3 + } +}, 3); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.2_T1.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.2_T1.js index 8a8cc929dc6ffbcdba4cb610e3b0fa26d3392ec3..4212e9e1f10f2db372e5475d60c97c0445711735 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.2_T1.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.2_T1.js @@ -8,8 +8,8 @@ es5id: 15.4.4.12_A2.2_T1 description: deleteCount is not integer ---*/ -var x = [0,1,2,3]; -var arr = x.splice(1,3.5); +var x = [0, 1, 2, 3]; +var arr = x.splice(1, 3.5); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.2_T2.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.2_T2.js index c97e14734c970dbeaaedbf40b7483a033b56164b..cbe0fbb78fb0247cf11f64e4a5bfc6073c211505 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.2_T2.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.2_T2.js @@ -8,8 +8,8 @@ es5id: 15.4.4.12_A2.2_T2 description: deleteCount = NaN ---*/ -var x = [0,1]; -var arr = x.splice(0,NaN); +var x = [0, 1]; +var arr = x.splice(0, NaN); //CHECK#0 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.2_T3.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.2_T3.js index 8622ff7654e0079a33d03642ea670aad528b2182..1a2e4fb1e7fdfb5294b9114e7c06dd59c3a83e62 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.2_T3.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.2_T3.js @@ -8,8 +8,8 @@ es5id: 15.4.4.12_A2.2_T3 description: deleteCount = Infinity ---*/ -var x = [0,1,2,3]; -var arr = x.splice(0,Number.POSITIVE_INFINITY); +var x = [0, 1, 2, 3]; +var arr = x.splice(0, Number.POSITIVE_INFINITY); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.2_T4.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.2_T4.js index 6c3008074f772f03da0b67b5cec70d951747c63f..d0ec317ce6eadcba8e0ca82bab60d8fb3b09fd03 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.2_T4.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.2_T4.js @@ -8,8 +8,8 @@ es5id: 15.4.4.12_A2.2_T4 description: deleteCount = -Infinity ---*/ -var x = [0,1]; -var arr = x.splice(0,Number.NEGATIVE_INFINITY); +var x = [0, 1]; +var arr = x.splice(0, Number.NEGATIVE_INFINITY); //CHECK#0 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.2_T5.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.2_T5.js index d42f023fc9f66384c37ebaab4c2927d1bd18095d..911ee8defc8d1982a8d963553ea296689d32f732 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.2_T5.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2.2_T5.js @@ -8,8 +8,15 @@ es5id: 15.4.4.12_A2.2_T5 description: ToInteger use ToNumber ---*/ -var x = [0,1,2,3]; -var arr = x.splice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); +var x = [0, 1, 2, 3]; +var arr = x.splice(0, { + valueOf: function() { + return 3 + }, + toString: function() { + return 0 + } +}); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2_T1.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2_T1.js index 120d64c816edb9421d87d8a95382cbef1a165d15..53135fec3110507f8bb92d48267868488a605a3b 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2_T1.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2_T1.js @@ -12,10 +12,15 @@ description: > positive, use min(deleteCount, length - start) ---*/ -var obj = {0:0,1:1,2:2,3:3}; +var obj = { + 0: 0, + 1: 1, + 2: 2, + 3: 3 +}; obj.length = 4; obj.splice = Array.prototype.splice; -var arr = obj.splice(0,3,4,5); +var arr = obj.splice(0, 3, 4, 5); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2_T2.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2_T2.js index 294da306b6c6a85c5686cb997e7853090adb0308..d0c6aed9b17e3387785aa9579115f70e0039cc94 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2_T2.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2_T2.js @@ -12,10 +12,13 @@ description: > is negative, use 0 ---*/ -var obj = {0:0,1:1}; +var obj = { + 0: 0, + 1: 1 +}; obj.length = 2; obj.splice = Array.prototype.splice; -var arr = obj.splice(-2,-1,2,3); +var arr = obj.splice(-2, -1, 2, 3); //CHECK#0 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2_T3.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2_T3.js index 3131c9a3a7ee193e7418e2892678d398ab8e07f7..4b6fdb4b9495c455ee391a3f3a51911ce86b49ce 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2_T3.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2_T3.js @@ -12,10 +12,13 @@ description: > negative, use 0 ---*/ -var obj = {0:0,1:1}; +var obj = { + 0: 0, + 1: 1 +}; obj.length = 2; obj.splice = Array.prototype.splice; -var arr = obj.splice(0,-1,2,3); +var arr = obj.splice(0, -1, 2, 3); //CHECK#0 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2_T4.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2_T4.js index ca455cad51dbea536f812a5d74706c4c46262e58..1127a7cb64486f9c34aa4b428b426c86bb41c4ae 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A2_T4.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A2_T4.js @@ -12,10 +12,15 @@ description: > is positive, use min(deleteCount, length - start) ---*/ -var obj = {0:0,1:1,2:2,3:3}; +var obj = { + 0: 0, + 1: 1, + 2: 2, + 3: 3 +}; obj.length = 4; obj.splice = Array.prototype.splice; -var arr = obj.splice(-4,3,4,5); +var arr = obj.splice(-4, 3, 4, 5); //CHECK#1 arr.getClass = Object.prototype.toString; diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A3_T1.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A3_T1.js index 4d92ace05505cc0b6c902f414fb304ffc7c8b3f9..bf7b3a654ec48d24f5667e80f0848703d62d596d 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A3_T1.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A3_T1.js @@ -22,20 +22,20 @@ if (arr.length !== 1) { //CHECK#2 if (obj.length !== 4294967295) { - $ERROR('#2: var obj = {}; obj.splice = Array.prototype.splice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.splice(4294967295,1); obj.length === 4294967295. Actual: ' + (obj.length)); + $ERROR('#2: var obj = {}; obj.splice = Array.prototype.splice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.splice(4294967295,1); obj.length === 4294967295. Actual: ' + (obj.length)); } //CHECK#3 if (obj[0] !== "x") { - $ERROR('#3: var obj = {}; obj.splice = Array.prototype.splice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.splice(4294967295,1); obj[0] === "x". Actual: ' + (obj[0])); + $ERROR('#3: var obj = {}; obj.splice = Array.prototype.splice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.splice(4294967295,1); obj[0] === "x". Actual: ' + (obj[0])); } //CHECK#4 if (obj[4294967295] !== undefined) { - $ERROR('#4: var obj = {}; obj.splice = Array.prototype.splice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.splice(4294967295,1); obj[4294967295] === undefined. Actual: ' + (obj[4294967295])); + $ERROR('#4: var obj = {}; obj.splice = Array.prototype.splice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.splice(4294967295,1); obj[4294967295] === undefined. Actual: ' + (obj[4294967295])); } //CHECK#5 if (arr[0] !== "y") { - $ERROR('#5: var obj = {}; obj.splice = Array.prototype.splice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.splice(4294967295,1); arr[0] === "y". Actual: ' + (arr[0])); + $ERROR('#5: var obj = {}; obj.splice = Array.prototype.splice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.splice(4294967295,1); arr[0] === "y". Actual: ' + (arr[0])); } diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A3_T3.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A3_T3.js index 3232c9a112063e7e45a6c44057bccfc6e56ac46d..309de2f1f4242771954d30aa78f2b3bdd844aca3 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A3_T3.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A3_T3.js @@ -12,7 +12,7 @@ var obj = {}; obj.splice = Array.prototype.splice; obj[4294967294] = "x"; obj.length = -1; -var arr = obj.splice(4294967294,1); +var arr = obj.splice(4294967294, 1); //CHECK#1 if (arr.length !== 0) { @@ -21,15 +21,15 @@ if (arr.length !== 0) { //CHECK#2 if (arr[0] !== undefined) { - $ERROR('#2: var obj = {}; obj.splice = Array.prototype.splice; obj[4294967294] = "x"; obj.length = 1; var arr = obj.splice(4294967294,1); arr[0] === undefined. Actual: ' + (arr[0])); + $ERROR('#2: var obj = {}; obj.splice = Array.prototype.splice; obj[4294967294] = "x"; obj.length = 1; var arr = obj.splice(4294967294,1); arr[0] === undefined. Actual: ' + (arr[0])); } //CHECK#3 if (obj.length !== 0) { - $ERROR('#3: var obj = {}; obj.splice = Array.prototype.splice; obj[4294967294] = "x"; obj.length = 1; var arr = obj.splice(4294967294,1); obj.length === 0. Actual: ' + (obj.length)); + $ERROR('#3: var obj = {}; obj.splice = Array.prototype.splice; obj[4294967294] = "x"; obj.length = 1; var arr = obj.splice(4294967294,1); obj.length === 0. Actual: ' + (obj.length)); } //CHECK#4 if (obj[4294967294] !== "x") { - $ERROR('#4: var obj = {}; obj.splice = Array.prototype.splice; obj[4294967294] = "x"; obj.length = 1; var arr = obj.splice(4294967294,1); obj[4294967294] === "x". Actual: ' + (obj[4294967294])); + $ERROR('#4: var obj = {}; obj.splice = Array.prototype.splice; obj[4294967294] = "x"; obj.length = 1; var arr = obj.splice(4294967294,1); obj[4294967294] === "x". Actual: ' + (obj[4294967294])); } diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A4_T1.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A4_T1.js index ed0ab16aa5d51a92c14302b0f6dd00d81306aced..7754dc3f4fc08452b5e4a9cf74a456cacabad39e 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A4_T1.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A4_T1.js @@ -11,8 +11,8 @@ description: > ---*/ Array.prototype[1] = -1; -var x = [0,1]; -var arr = x.splice(1,1); +var x = [0, 1]; +var arr = x.splice(1, 1); //CHECK#1 if (arr.length !== 1) { @@ -48,8 +48,11 @@ if (x[1] !== -1) { Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; -x = {0:0, 1:1}; -var arr = x.splice(1,1); +x = { + 0: 0, + 1: 1 +}; +var arr = x.splice(1, 1); //CHECK#7 if (arr.length !== 1) { diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A4_T2.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A4_T2.js index 3c203ee25196d2e631ee99077281d076787cbdf7..50cf6d031c2662bc9bad49ef2ac51be56be2836d 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A4_T2.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A4_T2.js @@ -11,8 +11,8 @@ description: > ---*/ Array.prototype[1] = -1; -var x = [0,1]; -var arr = x.splice(1,1,2); +var x = [0, 1]; +var arr = x.splice(1, 1, 2); //CHECK#1 if (arr.length !== 1) { @@ -48,8 +48,11 @@ if (x[1] !== 2) { Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; -x = {0:0, 1:1}; -var arr = x.splice(1,1,2); +x = { + 0: 0, + 1: 1 +}; +var arr = x.splice(1, 1, 2); //CHECK#7 if (arr.length !== 1) { diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A4_T3.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A4_T3.js index db412def3203e3ec9a39545172ca642c23e04773..423c6697304456c13cbf14bf0b634ee18a1b63b6 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A4_T3.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A4_T3.js @@ -13,7 +13,7 @@ description: > Array.prototype[0] = -1; var x = []; x.length = 1; -var arr = x.splice(0,1); +var arr = x.splice(0, 1); //CHECK#1 if (arr.length !== 1) { @@ -46,7 +46,7 @@ Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.splice = Array.prototype.splice; x = {}; -var arr = x.splice(0,1); +var arr = x.splice(0, 1); //CHECK#6 if (arr.length !== 1) { diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T1.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T1.js index 3c0ff7998a2d23584d026b30db951f0fbe4834d3..cae54c1da12912e762755db27ca19bd9ac3b4198 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T1.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T1.js @@ -13,13 +13,13 @@ var a = [0, 1, 2]; a.splice(1, 2, 4); if (a.length !== 2) { - $ERROR("Expected a.length === 2, actually " + a.length); + $ERROR("Expected a.length === 2, actually " + a.length); } if (a[0] !== 0) { - $ERROR("Expected a[0] === 0, actually " + a[0]); + $ERROR("Expected a[0] === 0, actually " + a[0]); } if (a[1] !== 4) { - $ERROR("Expected a[1] === 4, actually " + a[1]); + $ERROR("Expected a[1] === 4, actually " + a[1]); } diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T2.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T2.js index e7567673219b5de30489a778bb2ef2c55f3068fb..cf53a82359cb0deed48e17aa13831c2363312c99 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T2.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T2.js @@ -11,7 +11,7 @@ description: Array.prototype.splice throws if `length` is read-only var a = [0, 1, 2]; Object.defineProperty(a, 'length', { - writable: false + writable: false }); assert.throws(TypeError, function() { diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T3.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T3.js index e568f40d6c63b6cefb09d829d5a2913e719a2f9a..f42c6f00fd795b4cce4c4ae4b05b48440324b4cc 100644 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T3.js +++ b/test/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T3.js @@ -9,15 +9,17 @@ description: Array.prototype.splice throws if `length` is read-only ---*/ var a = { - get length() { return 0; }, - splice: Array.prototype.splice + get length() { + return 0; + }, + splice: Array.prototype.splice }; try { - a.splice(1, 2, 4); - $ERROR("Expected a TypeError"); + a.splice(1, 2, 4); + $ERROR("Expected a TypeError"); } catch (e) { - if (!(e instanceof TypeError)) { - throw e; - } + if (!(e instanceof TypeError)) { + throw e; + } } diff --git a/test/built-ins/Array/prototype/splice/clamps-length-to-integer-limit.js b/test/built-ins/Array/prototype/splice/clamps-length-to-integer-limit.js index a376e42e7129125b8697cfab4fd9516a25d6c61f..24584ba48a78515e9f15d8bc5f4385e72a2c18e5 100644 --- a/test/built-ins/Array/prototype/splice/clamps-length-to-integer-limit.js +++ b/test/built-ins/Array/prototype/splice/clamps-length-to-integer-limit.js @@ -19,18 +19,18 @@ info: | var arrayLike = {}; -arrayLike.length = 2**53 - 1; +arrayLike.length = 2 ** 53 - 1; Array.prototype.splice.call(arrayLike); -assert.sameValue(arrayLike.length, 2**53 - 1, "Length is 2**53 - 1"); +assert.sameValue(arrayLike.length, 2 ** 53 - 1, "Length is 2**53 - 1"); -arrayLike.length = 2**53; +arrayLike.length = 2 ** 53; Array.prototype.splice.call(arrayLike); -assert.sameValue(arrayLike.length, 2**53 - 1, "Length is 2**53"); +assert.sameValue(arrayLike.length, 2 ** 53 - 1, "Length is 2**53"); -arrayLike.length = 2**53 + 2; +arrayLike.length = 2 ** 53 + 2; Array.prototype.splice.call(arrayLike); -assert.sameValue(arrayLike.length, 2**53 - 1, "Length is 2**53 + 2"); +assert.sameValue(arrayLike.length, 2 ** 53 - 1, "Length is 2**53 + 2"); arrayLike.length = Infinity; Array.prototype.splice.call(arrayLike); -assert.sameValue(arrayLike.length, 2**53 - 1, "Length is Infinity"); +assert.sameValue(arrayLike.length, 2 ** 53 - 1, "Length is Infinity"); diff --git a/test/built-ins/Array/prototype/splice/create-non-array.js b/test/built-ins/Array/prototype/splice/create-non-array.js index 0af93e8c5a1b3c9c0360e91966a706e9c9b4fb52..153e484622a36967dd622f68df883dfcf471adf1 100644 --- a/test/built-ins/Array/prototype/splice/create-non-array.js +++ b/test/built-ins/Array/prototype/splice/create-non-array.js @@ -16,7 +16,9 @@ info: | 4. If isArray is false, return ? ArrayCreate(length). ---*/ -var obj = { length: 0 }; +var obj = { + length: 0 +}; var callCount = 0; var result; Object.defineProperty(obj, 'constructor', { diff --git a/test/built-ins/Array/prototype/splice/create-species-length-exceeding-integer-limit.js b/test/built-ins/Array/prototype/splice/create-species-length-exceeding-integer-limit.js index b2f373d6167175f94e1ada26903ea7de85b1d845..f0a5d73ed5486bc1fc98899b30ba316084021c1b 100644 --- a/test/built-ins/Array/prototype/splice/create-species-length-exceeding-integer-limit.js +++ b/test/built-ins/Array/prototype/splice/create-species-length-exceeding-integer-limit.js @@ -28,7 +28,7 @@ function StopSplice() {} var traps = []; var targetLength; -var array = ["no-hole", /* hole */, "stop"]; +var array = ["no-hole", /* hole */ , "stop"]; array.constructor = { [Symbol.species]: function(n) { targetLength = n; @@ -42,7 +42,7 @@ var source = new Proxy(array, allowProxyTraps({ // length property exceeding 2^53-1. if (pk === "length") - return 2**53 + 2; + return 2 ** 53 + 2; return Reflect.get(t, pk, r); }, @@ -66,11 +66,11 @@ var target = new Proxy([], allowProxyTraps({ assert.throws(StopSplice, function() { // deleteCount argument exceeding 2^53-1. - Array.prototype.splice.call(source, 0, 2**53 + 4); + Array.prototype.splice.call(source, 0, 2 ** 53 + 4); }); -assert.sameValue(targetLength, 2**53 - 1, - "length and deleteCount were correctly clamped to 2^53-1"); +assert.sameValue(targetLength, 2 ** 53 - 1, + "length and deleteCount were correctly clamped to 2^53-1"); assert.compareArray(traps, [ "source.[[Get]]:length", diff --git a/test/built-ins/Array/prototype/splice/length-and-deleteCount-exceeding-integer-limit.js b/test/built-ins/Array/prototype/splice/length-and-deleteCount-exceeding-integer-limit.js index f48e48d9e8cd35a20ea7ba4f0cd4c1d2a60da9f8..7734bb325a2765c0df491a6c63655923ca248843 100644 --- a/test/built-ins/Array/prototype/splice/length-and-deleteCount-exceeding-integer-limit.js +++ b/test/built-ins/Array/prototype/splice/length-and-deleteCount-exceeding-integer-limit.js @@ -30,25 +30,25 @@ var arrayLike = { "9007199254740989": "9007199254740989", "9007199254740990": "9007199254740990", "9007199254740991": "9007199254740991", - length: 2**53 + 2, + length: 2 ** 53 + 2, }; -var result = Array.prototype.splice.call(arrayLike, 9007199254740989, 2**53 + 4); +var result = Array.prototype.splice.call(arrayLike, 9007199254740989, 2 ** 53 + 4); -assert.compareArray(result, [ "9007199254740989", "9007199254740990" ], - "arrayLike['9007199254740989'] and arrayLike['9007199254740990'] are removed"); +assert.compareArray(result, ["9007199254740989", "9007199254740990"], + "arrayLike['9007199254740989'] and arrayLike['9007199254740990'] are removed"); -assert.sameValue(arrayLike.length, 2**53 - 3, - "New length is 2**53 - 3"); +assert.sameValue(arrayLike.length, 2 ** 53 - 3, + "New length is 2**53 - 3"); assert.sameValue(arrayLike["9007199254740988"], "9007199254740988", - "arrayLike['9007199254740988'] is unchanged"); + "arrayLike['9007199254740988'] is unchanged"); assert.sameValue("9007199254740989" in arrayLike, false, - "arrayLike['9007199254740989'] is removed"); + "arrayLike['9007199254740989'] is removed"); assert.sameValue("9007199254740990" in arrayLike, false, - "arrayLike['9007199254740990'] is removed"); + "arrayLike['9007199254740990'] is removed"); assert.sameValue(arrayLike["9007199254740991"], "9007199254740991", - "arrayLike['9007199254740991'] is unchanged"); + "arrayLike['9007199254740991'] is unchanged"); diff --git a/test/built-ins/Array/prototype/splice/length-exceeding-integer-limit-shrink-array.js b/test/built-ins/Array/prototype/splice/length-exceeding-integer-limit-shrink-array.js index e48f292ccb28ff38c28bba9eef87930ac9d979b9..8340b6a29e71b8a0e6a152e87def0a91755d0f10 100644 --- a/test/built-ins/Array/prototype/splice/length-exceeding-integer-limit-shrink-array.js +++ b/test/built-ins/Array/prototype/splice/length-exceeding-integer-limit-shrink-array.js @@ -34,31 +34,31 @@ var arrayLike = { /* "9007199254740989": hole */ "9007199254740990": "9007199254740990", "9007199254740991": "9007199254740991", - length: 2**53 + 2, + length: 2 ** 53 + 2, }; var result = Array.prototype.splice.call(arrayLike, 9007199254740987, 1); -assert.compareArray(result, [ "9007199254740987" ], - "arrayLike['9007199254740987'] is removed"); +assert.compareArray(result, ["9007199254740987"], + "arrayLike['9007199254740987'] is removed"); -assert.sameValue(arrayLike.length, 2**53 - 2, - "New length is 2**53 - 2"); +assert.sameValue(arrayLike.length, 2 ** 53 - 2, + "New length is 2**53 - 2"); assert.sameValue(arrayLike["9007199254740986"], "9007199254740986", - "arrayLike['9007199254740986'] is unchanged"); + "arrayLike['9007199254740986'] is unchanged"); assert.sameValue(arrayLike["9007199254740987"], "9007199254740988", - "arrayLike['9007199254740988'] is moved to arrayLike['9007199254740987']"); + "arrayLike['9007199254740988'] is moved to arrayLike['9007199254740987']"); assert.sameValue("9007199254740988" in arrayLike, false, - "arrayLike['9007199254740990'] is removed"); + "arrayLike['9007199254740990'] is removed"); assert.sameValue(arrayLike["9007199254740989"], "9007199254740990", - "arrayLike['9007199254740990'] is moved to arrayLike['9007199254740989']"); + "arrayLike['9007199254740990'] is moved to arrayLike['9007199254740989']"); assert.sameValue("9007199254740990" in arrayLike, false, - "arrayLike['9007199254740990'] is removed"); + "arrayLike['9007199254740990'] is removed"); assert.sameValue(arrayLike["9007199254740991"], "9007199254740991", - "arrayLike['9007199254740991'] is unchanged"); + "arrayLike['9007199254740991'] is unchanged"); diff --git a/test/built-ins/Array/prototype/splice/length-near-integer-limit-grow-array.js b/test/built-ins/Array/prototype/splice/length-near-integer-limit-grow-array.js index 9f0b857989be56ab4422602a937f0772b247d604..42cf6f9c501914fab5bccd3356ce5d5489ea2475 100644 --- a/test/built-ins/Array/prototype/splice/length-near-integer-limit-grow-array.js +++ b/test/built-ins/Array/prototype/splice/length-near-integer-limit-grow-array.js @@ -31,32 +31,32 @@ var arrayLike = { "9007199254740989": "9007199254740989", /* "9007199254740990": empty */ "9007199254740991": "9007199254740991", - length: 2**53 - 2, + length: 2 ** 53 - 2, }; var result = Array.prototype.splice.call(arrayLike, 9007199254740986, 0, "new-value"); assert.compareArray(result, [], "No elements are removed"); -assert.sameValue(arrayLike.length, 2**53 - 1, "New length is 2**53 - 1"); +assert.sameValue(arrayLike.length, 2 ** 53 - 1, "New length is 2**53 - 1"); assert.sameValue(arrayLike["9007199254740985"], "9007199254740985", - "arrayLike['9007199254740985'] is unchanged"); + "arrayLike['9007199254740985'] is unchanged"); assert.sameValue(arrayLike["9007199254740986"], "new-value", - "arrayLike['9007199254740986'] contains the inserted value"); + "arrayLike['9007199254740986'] contains the inserted value"); assert.sameValue(arrayLike["9007199254740987"], "9007199254740986", - "arrayLike['9007199254740986'] is moved to arrayLike['9007199254740987']"); + "arrayLike['9007199254740986'] is moved to arrayLike['9007199254740987']"); assert.sameValue(arrayLike["9007199254740988"], "9007199254740987", - "arrayLike['9007199254740987'] is moved to arrayLike['9007199254740988']"); + "arrayLike['9007199254740987'] is moved to arrayLike['9007199254740988']"); assert.sameValue("9007199254740989" in arrayLike, false, - "arrayLike['9007199254740989'] is removed"); + "arrayLike['9007199254740989'] is removed"); assert.sameValue(arrayLike["9007199254740990"], "9007199254740989", - "arrayLike['9007199254740989'] is moved to arrayLike['9007199254740990']"); + "arrayLike['9007199254740989'] is moved to arrayLike['9007199254740990']"); assert.sameValue(arrayLike["9007199254740991"], "9007199254740991", - "arrayLike['9007199254740991'] is unchanged"); + "arrayLike['9007199254740991'] is unchanged"); diff --git a/test/built-ins/Array/prototype/splice/set_length_no_args.js b/test/built-ins/Array/prototype/splice/set_length_no_args.js index a2c04e0fd80e7c5d351834e7f97306f6a1ee03b7..25dbc37efbe34c2f3ec2a5a4de49306b7fbb4be7 100644 --- a/test/built-ins/Array/prototype/splice/set_length_no_args.js +++ b/test/built-ins/Array/prototype/splice/set_length_no_args.js @@ -14,7 +14,8 @@ es5id: 15.4.4.12 es6id: 22.1.3.25 ---*/ -var getCallCount = 0, setCallCount = 0; +var getCallCount = 0, + setCallCount = 0; var lengthValue; var obj = { diff --git a/test/built-ins/Array/prototype/splice/throws-if-integer-limit-exceeded.js b/test/built-ins/Array/prototype/splice/throws-if-integer-limit-exceeded.js index 883d0508f385a751eb4ecec2b0d760bde22c6be1..447eb4d0a5b237291a06e2f792733c19165383c8 100644 --- a/test/built-ins/Array/prototype/splice/throws-if-integer-limit-exceeded.js +++ b/test/built-ins/Array/prototype/splice/throws-if-integer-limit-exceeded.js @@ -19,17 +19,17 @@ info: | var arrayLike = {}; -arrayLike.length = 2**53 - 1; +arrayLike.length = 2 ** 53 - 1; assert.throws(TypeError, function() { Array.prototype.splice.call(arrayLike, 0, 0, null); }, "Length is 2**53 - 1"); -arrayLike.length = 2**53; +arrayLike.length = 2 ** 53; assert.throws(TypeError, function() { Array.prototype.splice.call(arrayLike, 0, 0, null); }, "Length is 2**53"); -arrayLike.length = 2**53 + 2; +arrayLike.length = 2 ** 53 + 2; assert.throws(TypeError, function() { Array.prototype.splice.call(arrayLike, 0, 0, null); }, "Length is 2**53 + 2"); diff --git a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A1_T1.js b/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A1_T1.js index 1aaa20fc0b02bef9b93a3b4310da19ac6188b73e..c2f7a29a5be7b7da34ddc0abf04ca298400d0e4b 100644 --- a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A1_T1.js +++ b/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A1_T1.js @@ -13,7 +13,11 @@ description: it is the function that should be invoked ---*/ var n = 0; -var obj = {toLocaleString: function() {n++}}; +var obj = { + toLocaleString: function() { + n++ + } +}; var arr = [undefined, obj, null, obj, obj]; arr.toLocaleString(); diff --git a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A3_T1.js b/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A3_T1.js index fd32d7702dd287895d451369fa9a5c7aade9043b..7bf7a44d5333f51b91e26b03334e3daba0025aa2 100644 --- a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A3_T1.js +++ b/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A3_T1.js @@ -10,7 +10,11 @@ description: "[[Prototype]] of Array instance is Array.prototype" //CHECK#1 var n = 0; -var obj = {toLocaleString: function() {n++}}; +var obj = { + toLocaleString: function() { + n++ + } +}; Array.prototype[1] = obj; var x = [obj]; x.length = 2; diff --git a/test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T1.js b/test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T1.js index dbcce931003bb31cca55edc9b481714cb4264770..29ce4d673fb524ddbd8dccce12f300f3aa5ada7c 100644 --- a/test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T1.js +++ b/test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T1.js @@ -14,7 +14,7 @@ description: If Result(2) is zero, return the empty string var x = new Array(); if (x.toString() !== x.join()) { $ERROR('#1.1: x = new Array(); x.toString() === x.join(). Actual: ' + (x.toString())); -} else { +} else { if (x.toString() !== "") { $ERROR('#1.2: x = new Array(); x.toString() === "". Actual: ' + (x.toString())); } diff --git a/test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T2.js b/test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T2.js index 62a82f8b1674ff6a4daa2316b913b95c57853d2c..29e41773436dc1890c4380eef91ba37871628999 100644 --- a/test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T2.js +++ b/test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T2.js @@ -15,7 +15,7 @@ description: > ---*/ //CHECK#1 -var x = new Array(0,1,2,3); +var x = new Array(0, 1, 2, 3); if (x.toString() !== x.join()) { $ERROR('#1.1: x = new Array(0,1,2,3); x.toString() === x.join(). Actual: ' + (x.toString())); } else { @@ -37,7 +37,7 @@ if (x.toString() !== x.join()) { } //CHECK#3 -x = Array(undefined,1,null,3); +x = Array(undefined, 1, null, 3); if (x.toString() !== x.join()) { $ERROR('#3.1: x = Array(undefined,1,null,3); x.toString() === x.join(). Actual: ' + (x.toString())); } else { diff --git a/test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T3.js b/test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T3.js index 96ad8087288c018da69eb05335f156592611d197..c3c93e46c86d45953189be4c5af9a00dd7f0a7c9 100644 --- a/test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T3.js +++ b/test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T3.js @@ -11,7 +11,7 @@ description: Operator use ToString from array arguments ---*/ //CHECK#0 -var x = new Array("","",""); +var x = new Array("", "", ""); if (x.toString() !== x.join()) { $ERROR('#0.1: var x = new Array("","",""); x.toString() === x.join(). Actual: ' + (x.toString())); } else { @@ -21,7 +21,7 @@ if (x.toString() !== x.join()) { } //CHECK#1 -var x = new Array("\\","\\","\\"); +var x = new Array("\\", "\\", "\\"); if (x.toString() !== x.join()) { $ERROR('#1.1: var x = new Array("\\","\\","\\"); x.toString() === x.join(). Actual: ' + (x.toString())); } else { @@ -41,51 +41,51 @@ if (x.toString() !== x.join()) { } //CHECK#3 -var x = new Array(true,true,true); +var x = new Array(true, true, true); if (x.toString() !== x.join()) { - $ERROR('#3.1: var x = new Array(true,true,true); x.toString(true,true,true) === x.join(). Actual: ' + (x.toString(true,true,true))); + $ERROR('#3.1: var x = new Array(true,true,true); x.toString(true,true,true) === x.join(). Actual: ' + (x.toString(true, true, true))); } else { if (x.toString() !== "true,true,true") { - $ERROR('#3.2: var x = new Array(true,true,true); x.toString(true,true,true) === "true,true,true". Actual: ' + (x.toString(true,true,true))); + $ERROR('#3.2: var x = new Array(true,true,true); x.toString(true,true,true) === "true,true,true". Actual: ' + (x.toString(true, true, true))); } } //CHECK#4 -var x = new Array(null,null,null); +var x = new Array(null, null, null); if (x.toString() !== x.join()) { - $ERROR('#4.1: var x = new Array(null,null,null); x.toString(null,null,null) === x.join(). Actual: ' + (x.toString(null,null,null))); + $ERROR('#4.1: var x = new Array(null,null,null); x.toString(null,null,null) === x.join(). Actual: ' + (x.toString(null, null, null))); } else { if (x.toString() !== ",,") { - $ERROR('#4.2: var x = new Array(null,null,null); x.toString(null,null,null) === ",,". Actual: ' + (x.toString(null,null,null))); + $ERROR('#4.2: var x = new Array(null,null,null); x.toString(null,null,null) === ",,". Actual: ' + (x.toString(null, null, null))); } } //CHECK#5 -var x = new Array(undefined,undefined,undefined); +var x = new Array(undefined, undefined, undefined); if (x.toString() !== x.join()) { - $ERROR('#5.1: var x = new Array(undefined,undefined,undefined); x.toString(undefined,undefined,undefined) === x.join(). Actual: ' + (x.toString(undefined,undefined,undefined))); + $ERROR('#5.1: var x = new Array(undefined,undefined,undefined); x.toString(undefined,undefined,undefined) === x.join(). Actual: ' + (x.toString(undefined, undefined, undefined))); } else { if (x.toString() !== ",,") { - $ERROR('#5.2: var x = new Array(undefined,undefined,undefined); x.toString(undefined,undefined,undefined) === ",,". Actual: ' + (x.toString(undefined,undefined,undefined))); + $ERROR('#5.2: var x = new Array(undefined,undefined,undefined); x.toString(undefined,undefined,undefined) === ",,". Actual: ' + (x.toString(undefined, undefined, undefined))); } } //CHECK#6 -var x = new Array(Infinity,Infinity,Infinity); +var x = new Array(Infinity, Infinity, Infinity); if (x.toString() !== x.join()) { - $ERROR('#6.1: var x = new Array(Infinity,Infinity,Infinity); x.toString(Infinity,Infinity,Infinity) === x.join(). Actual: ' + (x.toString(Infinity,Infinity,Infinity))); + $ERROR('#6.1: var x = new Array(Infinity,Infinity,Infinity); x.toString(Infinity,Infinity,Infinity) === x.join(). Actual: ' + (x.toString(Infinity, Infinity, Infinity))); } else { if (x.toString() !== "Infinity,Infinity,Infinity") { - $ERROR('#6.2: var x = new Array(Infinity,Infinity,Infinity); x.toString(Infinity,Infinity,Infinity) === "Infinity,Infinity,Infinity". Actual: ' + (x.toString(Infinity,Infinity,Infinity))); + $ERROR('#6.2: var x = new Array(Infinity,Infinity,Infinity); x.toString(Infinity,Infinity,Infinity) === "Infinity,Infinity,Infinity". Actual: ' + (x.toString(Infinity, Infinity, Infinity))); } } //CHECK#7 -var x = new Array(NaN,NaN,NaN); +var x = new Array(NaN, NaN, NaN); if (x.toString() !== x.join()) { - $ERROR('#7.1: var x = new Array(NaN,NaN,NaN); x.toString(NaN,NaN,NaN) === x.join(). Actual: ' + (x.toString(NaN,NaN,NaN))); + $ERROR('#7.1: var x = new Array(NaN,NaN,NaN); x.toString(NaN,NaN,NaN) === x.join(). Actual: ' + (x.toString(NaN, NaN, NaN))); } else { if (x.toString() !== "NaN,NaN,NaN") { - $ERROR('#7.2: var x = new Array(NaN,NaN,NaN); x.toString(NaN,NaN,NaN) === "NaN,NaN,NaN". Actual: ' + (x.toString(NaN,NaN,NaN))); + $ERROR('#7.2: var x = new Array(NaN,NaN,NaN); x.toString(NaN,NaN,NaN) === "NaN,NaN,NaN". Actual: ' + (x.toString(NaN, NaN, NaN))); } } diff --git a/test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T4.js b/test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T4.js index 1471739914430401bd6726c3975fd266e3e6f9f0..02045cb350e52a7a4246405244cc7bf6dfbcd9fb 100644 --- a/test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T4.js +++ b/test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T4.js @@ -11,7 +11,11 @@ description: If Type(value) is Object, evaluate ToPrimitive(value, String) ---*/ //CHECK#1 -var object = {valueOf: function() {return "+"}}; +var object = { + valueOf: function() { + return "+" + } +}; var x = new Array(object); if (x.toString() !== x.join()) { $ERROR('#1.1: var object = {valueOf: function() {return "+"}} var x = new Array(object); x.toString() === x.join(). Actual: ' + (x.toString())); @@ -22,7 +26,14 @@ if (x.toString() !== x.join()) { } //CHECK#2 -var object = {valueOf: function() {return "+"}, toString: function() {return "*"}}; +var object = { + valueOf: function() { + return "+" + }, + toString: function() { + return "*" + } +}; var x = new Array(object); if (x.toString() !== x.join()) { $ERROR('#2.1: var object = {valueOf: function() {return "+"}, toString: function() {return x.join()}} var x = new Array(object); x.toString() === "*". Actual: ' + (x.toString())); @@ -33,7 +44,14 @@ if (x.toString() !== x.join()) { } //CHECK#3 -var object = {valueOf: function() {return "+"}, toString: function() {return {}}}; +var object = { + valueOf: function() { + return "+" + }, + toString: function() { + return {} + } +}; var x = new Array(object); if (x.toString() !== x.join()) { $ERROR('#3.1: var object = {valueOf: function() {return x.join()}, toString: function() {return {}}} var x = new Array(object); x.toString() === "+". Actual: ' + (x.toString())); @@ -45,7 +63,14 @@ if (x.toString() !== x.join()) { //CHECK#4 try { - var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}}; + var object = { + valueOf: function() { + throw "error" + }, + toString: function() { + return "*" + } + }; var x = new Array(object); if (x.toString() !== x.join()) { $ERROR('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return x.join()}} var x = new Array(object); x.toString() === "*". Actual: ' + (x.toString())); @@ -64,7 +89,11 @@ catch (e) { } //CHECK#5 -var object = {toString: function() {return "*"}}; +var object = { + toString: function() { + return "*" + } +}; var x = new Array(object); if (x.toString() !== x.join()) { $ERROR('#5.1: var object = {toString: function() {return x.join()}} var x = new Array(object); x.toString() === "*". Actual: ' + (x.toString())); @@ -75,7 +104,14 @@ if (x.toString() !== x.join()) { } //CHECK#6 -var object = {valueOf: function() {return {}}, toString: function() {return "*"}} +var object = { + valueOf: function() { + return {} + }, + toString: function() { + return "*" + } +} var x = new Array(object); if (x.toString() !== x.join()) { $ERROR('#6.1: var object = {valueOf: function() {return {}}, toString: function() {return x.join()}} var x = new Array(object); x.toString() === "*". Actual: ' + (x.toString())); @@ -87,7 +123,14 @@ if (x.toString() !== x.join()) { //CHECK#7 try { - var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}}; + var object = { + valueOf: function() { + return "+" + }, + toString: function() { + throw "error" + } + }; var x = new Array(object); x.toString(); $ERROR('#7.1: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}} var x = new Array(object); x.toString() throw "error". Actual: ' + (x.toString())); @@ -100,7 +143,14 @@ catch (e) { //CHECK#8 try { - var object = {valueOf: function() {return {}}, toString: function() {return {}}}; + var object = { + valueOf: function() { + return {} + }, + toString: function() { + return {} + } + }; var x = new Array(object); x.toString(); $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}} var x = new Array(object); x.toString() throw TypeError. Actual: ' + (x.toString())); diff --git a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A2_T1.js b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A2_T1.js index 325a8aded2e0b3636d13ab95dab25eed3a5d927d..f45be1170a0c88ba798ae4d68637e0bf6cfe1a92 100644 --- a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A2_T1.js +++ b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A2_T1.js @@ -19,19 +19,19 @@ obj.unshift = Array.prototype.unshift; if (obj.length !== undefined) { $ERROR('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length)); } else { - //CHECK#1 - var unshift = obj.unshift(-1); - if (unshift !== 1) { - $ERROR('#1: var obj = {}; obj.unshift = Array.prototype.unshift; obj.unshift(-1) === 1. Actual: ' + (unshift)); - } - //CHECK#2 - if (obj.length !== 1) { - $ERROR('#2: var obj = {}; obj.unshift = Array.prototype.unshift; obj.unshift(-1); obj.length === 1. Actual: ' + (obj.length)); - } - //CHECK#3 - if (obj["0"] !== -1) { - $ERROR('#3: var obj = {}; obj.unshift = Array.prototype.unshift; obj.unshift(-1); obj["0"] === -1. Actual: ' + (obj["0"])); - } + //CHECK#1 + var unshift = obj.unshift(-1); + if (unshift !== 1) { + $ERROR('#1: var obj = {}; obj.unshift = Array.prototype.unshift; obj.unshift(-1) === 1. Actual: ' + (unshift)); + } + //CHECK#2 + if (obj.length !== 1) { + $ERROR('#2: var obj = {}; obj.unshift = Array.prototype.unshift; obj.unshift(-1); obj.length === 1. Actual: ' + (obj.length)); + } + //CHECK#3 + if (obj["0"] !== -1) { + $ERROR('#3: var obj = {}; obj.unshift = Array.prototype.unshift; obj.unshift(-1); obj["0"] === -1. Actual: ' + (obj["0"])); + } } //CHECK#4 diff --git a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A2_T3.js b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A2_T3.js index c169a2c06f4dfa559427ee3bdff621af55145281..979bc566b238891e2d579a2f414eb879bcd5a6de 100644 --- a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A2_T3.js +++ b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A2_T3.js @@ -16,21 +16,39 @@ var obj = {}; obj.unshift = Array.prototype.unshift; //CHECK#1 -obj.length = {valueOf: function() {return 3}}; +obj.length = { + valueOf: function() { + return 3 + } +}; var unshift = obj.unshift(); if (unshift !== 3) { $ERROR('#1: obj.length = {valueOf: function() {return 3}} obj.unshift() === 3. Actual: ' + (unshift)); } //CHECK#2 -obj.length = {valueOf: function() {return 3}, toString: function() {return 1}}; +obj.length = { + valueOf: function() { + return 3 + }, + toString: function() { + return 1 + } +}; var unshift = obj.unshift(); if (unshift !== 3) { $ERROR('#0: obj.length = {valueOf: function() {return 3}, toString: function() {return 1}} obj.unshift() === 3. Actual: ' + (unshift)); } //CHECK#3 -obj.length = {valueOf: function() {return 3}, toString: function() {return {}}}; +obj.length = { + valueOf: function() { + return 3 + }, + toString: function() { + return {} + } +}; var unshift = obj.unshift(); if (unshift !== 3) { $ERROR('#1: obj.length = {valueOf: function() {return 3}, toString: function() {return {}}} obj.unshift() === 3. Actual: ' + (unshift)); @@ -38,7 +56,14 @@ if (unshift !== 3) { //CHECK#4 try { - obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; + obj.length = { + valueOf: function() { + return 3 + }, + toString: function() { + throw "error" + } + }; var unshift = obj.unshift(); if (unshift !== 3) { $ERROR('#4.1: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.unshift() === ",". Actual: ' + (unshift)); @@ -53,14 +78,25 @@ catch (e) { } //CHECK#5 -obj.length = {toString: function() {return 1}}; +obj.length = { + toString: function() { + return 1 + } +}; var unshift = obj.unshift(); if (unshift !== 1) { $ERROR('#5: obj.length = {toString: function() {return 1}} obj.unshift() === 1. Actual: ' + (unshift)); } //CHECK#6 -obj.length = {valueOf: function() {return {}}, toString: function() {return 1}} +obj.length = { + valueOf: function() { + return {} + }, + toString: function() { + return 1 + } +} var unshift = obj.unshift(); if (unshift !== 1) { $ERROR('#6: obj.length = {valueOf: function() {return {}}, toString: function() {return 1}} obj.unshift() === 1. Actual: ' + (unshift)); @@ -69,7 +105,14 @@ if (unshift !== 1) { //CHECK#7 try { - obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; + obj.length = { + valueOf: function() { + throw "error" + }, + toString: function() { + return 1 + } + }; var unshift = obj.unshift(); $ERROR('#7.1: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; obj.unshift() throw "error". Actual: ' + (unshift)); } @@ -82,7 +125,14 @@ catch (e) { //CHECK#8 try { - obj.length = {valueOf: function() {return {}}, toString: function() {return {}}}; + obj.length = { + valueOf: function() { + return {} + }, + toString: function() { + return {} + } + }; var unshift = obj.unshift(); $ERROR('#8.1: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.unshift() throw TypeError. Actual: ' + (unshift)); } diff --git a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A3_T2.js b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A3_T2.js index fe67c11de35f62dd69c931fcc287aa11af96dc38..fcbbe10dd7c13e229d1266ea48a6b09102540b78 100644 --- a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A3_T2.js +++ b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A3_T2.js @@ -26,20 +26,20 @@ if (obj.length !== 3) { //CHECK#3 if (obj[0] !== "x") { - $ERROR('#3: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z"); obj[0] === "x". Actual: ' + (obj[0])); + $ERROR('#3: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z"); obj[0] === "x". Actual: ' + (obj[0])); } //CHECK#4 if (obj[1] !== "y") { - $ERROR('#4: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z"); obj[1] === "y". Actual: ' + (obj[1])); + $ERROR('#4: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z"); obj[1] === "y". Actual: ' + (obj[1])); } //CHECK#5 if (obj[2] !== "z") { - $ERROR('#5: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z"); obj[2] === "z". Actual: ' + (obj[2])); + $ERROR('#5: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z"); obj[2] === "z". Actual: ' + (obj[2])); } //CHECK#6 if (obj[3] !== undefined) { - $ERROR('#6: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z"); obj[3] === undefined. Actual: ' + (obj[3])); + $ERROR('#6: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z"); obj[3] === undefined. Actual: ' + (obj[3])); } diff --git a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A4_T1.js b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A4_T1.js index 758fbb33865c4ca88998fd0852df622af92d047f..0235e42bbb24062491d6f83cee9502b2c8997d56 100644 --- a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A4_T1.js +++ b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A4_T1.js @@ -40,7 +40,9 @@ if (x[0] !== -1) { Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; -x = {0:1}; +x = { + 0: 1 +}; //CHECK#5 var unshift = x.unshift(0); diff --git a/test/built-ins/Array/prototype/unshift/clamps-to-integer-limit.js b/test/built-ins/Array/prototype/unshift/clamps-to-integer-limit.js index 4818d2ab82b626d86bc15b327dd77a794fff4d03..9f2e14184594d3fae07a171d47b11a3355542398 100644 --- a/test/built-ins/Array/prototype/unshift/clamps-to-integer-limit.js +++ b/test/built-ins/Array/prototype/unshift/clamps-to-integer-limit.js @@ -15,18 +15,18 @@ info: | var arrayLike = {}; -arrayLike.length = 2**53 - 1; +arrayLike.length = 2 ** 53 - 1; Array.prototype.unshift.call(arrayLike); -assert.sameValue(arrayLike.length, 2**53 - 1, "Length is 2**53 - 1"); +assert.sameValue(arrayLike.length, 2 ** 53 - 1, "Length is 2**53 - 1"); -arrayLike.length = 2**53; +arrayLike.length = 2 ** 53; Array.prototype.unshift.call(arrayLike); -assert.sameValue(arrayLike.length, 2**53 - 1, "Length is 2**53"); +assert.sameValue(arrayLike.length, 2 ** 53 - 1, "Length is 2**53"); -arrayLike.length = 2**53 + 2; +arrayLike.length = 2 ** 53 + 2; Array.prototype.unshift.call(arrayLike); -assert.sameValue(arrayLike.length, 2**53 - 1, "Length is 2**53 + 2"); +assert.sameValue(arrayLike.length, 2 ** 53 - 1, "Length is 2**53 + 2"); arrayLike.length = Infinity; Array.prototype.unshift.call(arrayLike); -assert.sameValue(arrayLike.length, 2**53 - 1, "Length is Infinity"); +assert.sameValue(arrayLike.length, 2 ** 53 - 1, "Length is Infinity"); diff --git a/test/built-ins/Array/prototype/unshift/length-near-integer-limit.js b/test/built-ins/Array/prototype/unshift/length-near-integer-limit.js index bd4ad9aa6656965477b332b80e479d2a115a0d43..5dff513e40627ff0743f86c02dae19f5d569ab63 100644 --- a/test/built-ins/Array/prototype/unshift/length-near-integer-limit.js +++ b/test/built-ins/Array/prototype/unshift/length-near-integer-limit.js @@ -26,7 +26,7 @@ info: | function StopUnshift() {} var arrayLike = { - get "9007199254740986"() { + get "9007199254740986" () { throw new StopUnshift(); }, "9007199254740987": "9007199254740987", @@ -34,27 +34,27 @@ var arrayLike = { "9007199254740989": "9007199254740989", /* "9007199254740990": empty */ "9007199254740991": "9007199254740991", - length: 2**53 - 2 + length: 2 ** 53 - 2 }; assert.throws(StopUnshift, function() { Array.prototype.unshift.call(arrayLike, null); }); -assert.sameValue(arrayLike.length, 2**53 - 2, - "arrayLike.length is unchanged"); +assert.sameValue(arrayLike.length, 2 ** 53 - 2, + "arrayLike.length is unchanged"); assert.sameValue(arrayLike["9007199254740987"], "9007199254740987", - "arrayLike['9007199254740987'] is unchanged"); + "arrayLike['9007199254740987'] is unchanged"); assert.sameValue(arrayLike["9007199254740988"], "9007199254740987", - "arrayLike['9007199254740988'] is replaced with arrayLike['9007199254740987']"); + "arrayLike['9007199254740988'] is replaced with arrayLike['9007199254740987']"); assert.sameValue("9007199254740989" in arrayLike, false, - "arrayLike['9007199254740989'] is removed"); + "arrayLike['9007199254740989'] is removed"); assert.sameValue(arrayLike["9007199254740990"], "9007199254740989", - "arrayLike['9007199254740990'] is replaced with arrayLike['9007199254740989']"); + "arrayLike['9007199254740990'] is replaced with arrayLike['9007199254740989']"); assert.sameValue(arrayLike["9007199254740991"], "9007199254740991", - "arrayLike['9007199254740991'] is unchanged"); + "arrayLike['9007199254740991'] is unchanged"); diff --git a/test/built-ins/Array/prototype/unshift/throws-if-integer-limit-exceeded.js b/test/built-ins/Array/prototype/unshift/throws-if-integer-limit-exceeded.js index a6e0acc306ce63465601c2ce06601dfed6f04b2a..9ad723eca5bdf0a1f579b3885fa75a2d00ed8c7e 100644 --- a/test/built-ins/Array/prototype/unshift/throws-if-integer-limit-exceeded.js +++ b/test/built-ins/Array/prototype/unshift/throws-if-integer-limit-exceeded.js @@ -16,17 +16,17 @@ info: | var arrayLike = {}; -arrayLike.length = 2**53 - 1; +arrayLike.length = 2 ** 53 - 1; assert.throws(TypeError, function() { Array.prototype.unshift.call(arrayLike, null); }, "Length is 2**53 - 1"); -arrayLike.length = 2**53; +arrayLike.length = 2 ** 53; assert.throws(TypeError, function() { Array.prototype.unshift.call(arrayLike, null); }, "Length is 2**53"); -arrayLike.length = 2**53 + 2; +arrayLike.length = 2 ** 53 + 2; assert.throws(TypeError, function() { Array.prototype.unshift.call(arrayLike, null); }, "Length is 2**53 + 2"); diff --git a/test/built-ins/Array/prototype/values/iteration-mutable.js b/test/built-ins/Array/prototype/values/iteration-mutable.js index 15a0170d14ab0a392a3757e06cc26089674c32b4..74142c4b5947ee787fee79621b9ee48bffca635a 100644 --- a/test/built-ins/Array/prototype/values/iteration-mutable.js +++ b/test/built-ins/Array/prototype/values/iteration-mutable.js @@ -20,7 +20,7 @@ var result; array.push('a'); result = iterator.next(); -assert.sameValue(result.done, false , 'First result `done` flag'); +assert.sameValue(result.done, false, 'First result `done` flag'); assert.sameValue(result.value, 'a', 'First result `value`'); result = iterator.next();