diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.10/S15.4.4.10_A3_T1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.10/S15.4.4.10_A3_T1.js index 9ea1a7a3da..f32a977067 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.10/S15.4.4.10_A3_T1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.10/S15.4.4.10_A3_T1.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * Check ToLength(length) for non Array objects + * Check ToUint32(length) for non Array objects * * @path ch15/15.4/15.4.4/15.4.4.10/S15.4.4.10_A3_T1.js * @description length = 4294967296 @@ -13,13 +13,20 @@ obj.slice = Array.prototype.slice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; +var arr = obj.slice(0,4294967296); -try { - var arr = obj.slice(0,4294967296); - $FAIL('#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. Actual: '+arr); -} 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); - } +//CHECK#1 +if (arr.length !== 0) { + $ERROR('#1: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.slice(0,4294967296); arr.length === 0. Actual: ' + (arr.length)); } +//CHECK#2 +if (arr[0] !== undefined) { + $ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.slice(0,4294967296); arr[0] === undefined. Actual: ' + (arr[0])); +} + +//CHECK#3 +if (arr[4294967295] !== undefined) { + $ERROR('#3: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.slice(0,4294967296); arr[4294967295] === undefined. Actual: ' + (arr[4294967295])); +} + diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.10/S15.4.4.10_A3_T2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.10/S15.4.4.10_A3_T2.js index 5e0cf9d7c2..63810d3c96 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.10/S15.4.4.10_A3_T2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.10/S15.4.4.10_A3_T2.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * Check ToLength(length) for non Array objects + * Check ToUint32(length) for non Array objects * * @path ch15/15.4/15.4.4/15.4.4.10/S15.4.4.10_A3_T2.js * @description length = 4294967297 @@ -13,13 +13,20 @@ obj.slice = Array.prototype.slice; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; +var arr = obj.slice(0,4294967297); -try { - var arr = obj.slice(0,4294967297); - $FAIL('#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. Actual: '+arr); -} 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); - } +//CHECK#1 +if (arr.length !== 1) { + $ERROR('#1: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; var arr = obj.slice(0,4294967297); arr.length === 1. Actual: ' + (arr.length)); } +//CHECK#2 +if (arr[0] !== "x") { + $ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; var arr = obj.slice(0,4294967297); arr[0] === "x". Actual: ' + (arr[0])); +} + +//CHECK#3 +if (arr[4294967296] !== undefined) { + $ERROR('#3: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; var arr = obj.slice(0,4294967297); arr[4294967296] === undefined. Actual: ' + (arr[4294967296])); +} + diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.10/S15.4.4.10_A3_T3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.10/S15.4.4.10_A3_T3.js index 2c5b9bed3d..ab663fc2c0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.10/S15.4.4.10_A3_T3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.10/S15.4.4.10_A3_T3.js @@ -15,12 +15,12 @@ obj.length = -1; var arr = obj.slice(4294967294,4294967295); //CHECK#1 -if (arr.length !== 0) { - $ERROR('#1: var obj = {}; obj.slice = Array.prototype.slice; obj[4294967294] = "x"; obj.length = 4294967295; var arr = obj.slice(4294967294,4294967295); arr.length === 0. Actual: ' + (arr.length)); +if (arr.length !== 1) { + $ERROR('#1: var obj = {}; obj.slice = Array.prototype.slice; obj[4294967294] = "x"; obj.length = 4294967295; var arr = obj.slice(4294967294,4294967295); arr.length === 1. Actual: ' + (arr.length)); } //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])); +if (arr[0] !== "x") { + $ERROR('#3: var obj = {}; obj.slice = Array.prototype.slice; obj[4294967294] = "x"; obj.length = 4294967295; var arr = obj.slice(4294967294,4294967295); arr[0] === "x". Actual: ' + (arr[0])); } diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.11/S15.4.4.11_A4_T3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.11/S15.4.4.11_A4_T3.js index 9ac873684e..fe5d5de941 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.11/S15.4.4.11_A4_T3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.11/S15.4.4.11_A4_T3.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * Check ToLength(length) for non Array objects + * Check ToUint32(length) for non Array objects * * @path ch15/15.4/15.4.4/15.4.4.11/S15.4.4.11_A4_T3.js * @description length = -4294967294 @@ -26,13 +26,13 @@ if (obj.length !== -4294967294) { } //CHECK#3 -if (obj[0] !== "z") { - $ERROR('#3: var obj = {}; obj.sort = Array.prototype.sort; obj[0] = "z"; obj[1] = "y"; obj[2] = "x"; obj.length = -4294967294; obj.sort(); obj[0] === "z". Actual: ' + (obj[0])); +if (obj[0] !== "y") { + $ERROR('#3: var obj = {}; obj.sort = Array.prototype.sort; obj[0] = "z"; obj[1] = "y"; obj[2] = "x"; obj.length = -4294967294; obj.sort(); obj[0] === "y". Actual: ' + (obj[0])); } //CHECK#4 -if (obj[1] !== "y") { - $ERROR('#4: var obj = {}; obj.sort = Array.prototype.sort; obj[0] = "z"; obj[1] = "y"; obj[2] = "x"; obj.length = -4294967294; obj.sort(); obj[1] === "y". Actual: ' + (obj[1])); +if (obj[1] !== "z") { + $ERROR('#4: var obj = {}; obj.sort = Array.prototype.sort; obj[0] = "z"; obj[1] = "y"; obj[2] = "x"; obj.length = -4294967294; obj.sort(); obj[1] === "z". Actual: ' + (obj[1])); } //CHECK#5 diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.12/S15.4.4.12_A3_T1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.12/S15.4.4.12_A3_T1.js index 9c9ba60a02..a6645085fc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.12/S15.4.4.12_A3_T1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.12/S15.4.4.12_A3_T1.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * Check ToLength(length) for non Array objects + * Check ToUint32(length) for non Array objects * * @path ch15/15.4/15.4.4/15.4.4.12/S15.4.4.12_A3_T1.js * @description length is arbitrarily @@ -16,13 +16,13 @@ obj.length = 4294967296; var arr = obj.splice(4294967295, 1); //CHECK#1 -if (arr.length !== 1) { - $ERROR('#1: var obj = {}; obj.splice = Array.prototype.splice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.splice(4294967295,1); arr.length === 1. Actual: ' + (arr.length)); +if (arr.length !== 0) { + $ERROR('#1: var obj = {}; obj.splice = Array.prototype.splice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.splice(4294967295,1); arr.length === 0. Actual: ' + (arr.length)); } //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)); +if (obj.length !== 0) { + $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 === 0. Actual: ' + (obj.length)); } //CHECK#3 @@ -31,12 +31,7 @@ if (obj[0] !== "x") { } //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])); +if (obj[4294967295] !== "y") { + $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] === "y". 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])); -} - diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.12/S15.4.4.12_A3_T3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.12/S15.4.4.12_A3_T3.js index 71ef75ba94..5c0dce77d1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.12/S15.4.4.12_A3_T3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.12/S15.4.4.12_A3_T3.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * Check ToLength(length) for non Array objects + * Check ToUint32(length) for non Array objects * * @path ch15/15.4/15.4.4/15.4.4.12/S15.4.4.12_A3_T3.js * @description length is arbitrarily @@ -15,22 +15,22 @@ obj.length = -1; var arr = obj.splice(4294967294,1); //CHECK#1 -if (arr.length !== 0) { - $ERROR('#1: var obj = {}; obj.splice = Array.prototype.splice; obj[4294967294] = "x"; obj.length = -1; var arr = obj.splice(4294967294,1); arr.length === 0. Actual: ' + (arr.length)); +if (arr.length !== 1) { + $ERROR('#1: var obj = {}; obj.splice = Array.prototype.splice; obj[4294967294] = "x"; obj.length = -1; var arr = obj.splice(4294967294,1); arr.length === 1. Actual: ' + (arr.length)); } //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])); +if (arr[0] !== "x") { + $ERROR('#2: var obj = {}; obj.splice = Array.prototype.splice; obj[4294967294] = "x"; obj.length = 1; var arr = obj.splice(4294967294,1); arr[0] === "x". 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)); +if (obj.length !== 4294967294) { + $ERROR('#3: var obj = {}; obj.splice = Array.prototype.splice; obj[4294967294] = "x"; obj.length = 1; var arr = obj.splice(4294967294,1); obj.length === 4294967294. 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])); +if (obj[4294967294] !== undefined) { + $ERROR('#4: var obj = {}; obj.splice = Array.prototype.splice; obj[4294967294] = "x"; obj.length = 1; var arr = obj.splice(4294967294,1); obj[4294967294] === undefined. Actual: ' + (obj[4294967294])); } diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.13/S15.4.4.13_A3_T2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.13/S15.4.4.13_A3_T2.js index 69485e0e13..4fd6cbfa48 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.13/S15.4.4.13_A3_T2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.13/S15.4.4.13_A3_T2.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * Check ToLength(length) for non Array objects + * Check ToUint32(length) for non Array objects * * @path ch15/15.4/15.4.4/15.4.4.13/S15.4.4.13_A3_T2.js * @description length = -4294967295 @@ -15,13 +15,13 @@ obj.length = -4294967295; //CHECK#1 var unshift = obj.unshift("x", "y", "z"); -if (unshift !== 3) { - $ERROR('#1: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z") === 3. Actual: ' + (unshift)); +if (unshift !== 4) { + $ERROR('#1: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z") === 4. Actual: ' + (unshift)); } //CHECK#2 -if (obj.length !== 3) { - $ERROR('#2: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z"); obj.length === 3. Actual: ' + (obj.length)); +if (obj.length !== 4) { + $ERROR('#2: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z"); obj.length === 4. Actual: ' + (obj.length)); } //CHECK#3 @@ -40,7 +40,7 @@ if (obj[2] !== "z") { } //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])); +if (obj[3] !== "") { + $ERROR('#6: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z"); obj[3] === "". Actual: ' + (obj[3])); } diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-12.js index 04a2768678..0315be5f28 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-12.js @@ -13,7 +13,7 @@ function testcase() { var obj = { 1: "true", 2: "2", length: "-4294967294" }; - return Array.prototype.indexOf.call(obj, "true") === -1 && + return Array.prototype.indexOf.call(obj, "true") === 1 && Array.prototype.indexOf.call(obj, "2") === -1; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-14.js index 4120eeba7b..14b89f5140 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-14.js @@ -15,8 +15,8 @@ function testcase() { var objTwo = { 0: true, 1: true, length: "+Infinity" }; var objThree = { 0: true, 1: true, length: "-Infinity" }; - return Array.prototype.indexOf.call(objOne, true) === 0 && - Array.prototype.indexOf.call(objTwo, true) === 0 && + return Array.prototype.indexOf.call(objOne, true) === -1 && + Array.prototype.indexOf.call(objTwo, true) === -1 && Array.prototype.indexOf.call(objThree, true) === -1; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-25.js index d42f70ec98..0c562a54ee 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-25.js @@ -5,15 +5,15 @@ /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-25.js - * @description Array.prototype.indexOf - value of 'length' is a negative non-integer + * @description Array.prototype.indexOf - value of 'length' is a negative non-integer, ensure truncation occurs in the proper direction */ function testcase() { - 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 2 finally - return Array.prototype.indexOf.call(obj, true) === -1 && + return Array.prototype.indexOf.call(obj, true) === 1 && Array.prototype.indexOf.call(obj, false) === -1; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-28.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-28.js index f3145c3a9c..8528a66fb1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-28.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-28.js @@ -18,6 +18,6 @@ function testcase() { length: 4294967296 }; - return Array.prototype.indexOf.call(obj, targetObj) === 0; + return Array.prototype.indexOf.call(obj, targetObj) === -1; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-29.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-29.js index 19ac989aff..ddadd4d889 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-29.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-29.js @@ -18,6 +18,6 @@ function testcase() { }; return Array.prototype.indexOf.call(obj, targetObj) === 0 && - Array.prototype.indexOf.call(obj, 4294967297) === 1; + Array.prototype.indexOf.call(obj, 4294967297) === -1; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-7.js index a15eba5156..7c170b67b9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-7.js @@ -13,7 +13,7 @@ function testcase() { var obj = { 4: true, 5: false, length: 5 - Math.pow(2, 32) }; - return Array.prototype.indexOf.call(obj, true) === -1 && + return Array.prototype.indexOf.call(obj, true) === 4 && Array.prototype.indexOf.call(obj, false) === -1; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-8.js index c263a4cc71..4eec4a6f59 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-8.js @@ -13,6 +13,6 @@ function testcase() { var obj = { 0: 0, length: Infinity }; - return Array.prototype.indexOf.call(obj, 0) === 0; + return Array.prototype.indexOf.call(obj, 0) === -1; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-12.js index 9a24d8f3fc..c8f5ea3e08 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-12.js @@ -13,7 +13,7 @@ function testcase() { var obj = {1: null, 2: undefined, length: "-4294967294"}; - return Array.prototype.lastIndexOf.call(obj, null) === -1 && + return Array.prototype.lastIndexOf.call(obj, null) === 1 && Array.prototype.lastIndexOf.call(obj, undefined) === -1; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-14.js index 097b9c71c9..e75f1cbac3 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-14.js @@ -5,14 +5,18 @@ /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-14.js - * @description Array.prototype.lastIndexOf - value of 'length' is a string containing -Infinity + * @description Array.prototype.lastIndexOf - value of 'length' is a string containing +/-Infinity */ function testcase() { + var objOne = { 0: true, 1: true, length: "Infinity" }; + var objTwo = { 0: true, 1: true, length: "+Infinity" }; var objThree = { 0: true, 1: true, length: "-Infinity" }; - return Array.prototype.lastIndexOf.call(objThree, true) === -1; + return Array.prototype.lastIndexOf.call(objOne, true) === -1 && + Array.prototype.lastIndexOf.call(objTwo, true) === -1 && + Array.prototype.lastIndexOf.call(objThree, true) === -1; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-25.js index 54a34fae2f..c15573aa42 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-25.js @@ -5,7 +5,7 @@ /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-25.js - * @description Array.prototype.lastIndexOf - value of 'length' is a negative non-integer + * @description Array.prototype.lastIndexOf - value of 'length' is a negative non-integer, ensure truncation occurs in the proper direction */ @@ -13,7 +13,7 @@ function testcase() { var obj = { 1: true, 2: false, length: -4294967294.5 }; - return Array.prototype.lastIndexOf.call(obj, true) === -1 && + return Array.prototype.lastIndexOf.call(obj, true) === 1 && Array.prototype.lastIndexOf.call(obj, false) === -1; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-28.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-28.js index f24bb71045..a893151b40 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-28.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-28.js @@ -19,6 +19,6 @@ function testcase() { length: 4294967296 }; - return Array.prototype.lastIndexOf.call(obj, targetObj) === 4294967295; //verify length is 4294967296 finally + return Array.prototype.lastIndexOf.call(obj, targetObj) === -1; //verify length is 0 finally } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-7.js index 2cede7d483..995d60ec7f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-7.js @@ -13,7 +13,7 @@ function testcase() { var obj = { 4: -Infinity, 5: Infinity, length: 5 - Math.pow(2, 32) }; - return Array.prototype.lastIndexOf.call(obj, -Infinity) === -1 && + return Array.prototype.lastIndexOf.call(obj, -Infinity) === 4 && Array.prototype.lastIndexOf.call(obj, Infinity) === -1; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-12.js index 217fada481..9eac9bcf9a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-12.js @@ -21,6 +21,6 @@ function testcase() { var obj = { 0: 11, 1: 12, 2: 9, length: "-4294967294" }; return Array.prototype.every.call(obj, callbackfn1) && - Array.prototype.every.call(obj, callbackfn2); + !Array.prototype.every.call(obj, callbackfn2); } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-14.js index 523f3c02b5..4466ce7364 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-14.js @@ -22,8 +22,8 @@ function testcase() { var objTwo = { 0: 9, length: "+Infinity" }; var objThree = { 0: 9, length: "-Infinity" }; - return !Array.prototype.every.call(objOne, callbackfn) && - !Array.prototype.every.call(objTwo, callbackfn) && - Array.prototype.every.call(objThree, callbackfn) && accessed; + return Array.prototype.every.call(objOne, callbackfn) && + Array.prototype.every.call(objTwo, callbackfn) && + Array.prototype.every.call(objThree, callbackfn) && !accessed; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-25.js index 8a27b6a1d2..456513fc61 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-25.js @@ -5,7 +5,7 @@ /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-25.js - * @description Array.prototype.every - value of 'length' is a negative non-integer + * @description Array.prototype.every - value of 'length' is a negative non-integer, ensure truncation occurs in the proper direction */ @@ -26,6 +26,6 @@ function testcase() { }; return Array.prototype.every.call(obj, callbackfn1) && - Array.prototype.every.call(obj, callbackfn2); + !Array.prototype.every.call(obj, callbackfn2); } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-29.js b/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-29.js index 10ad872aaf..38e4125c03 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-29.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-29.js @@ -24,7 +24,7 @@ function testcase() { length: 4294967297 }; - return !Array.prototype.every.call(obj, callbackfn1) && + return Array.prototype.every.call(obj, callbackfn1) && !Array.prototype.every.call(obj, callbackfn2); } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-7.js index 0549bf12b4..fb37633ff6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-7.js @@ -18,9 +18,9 @@ function testcase() { 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 2 return Array.prototype.every.call(obj, callbackfn1) && - Array.prototype.every.call(obj, callbackfn2); + !Array.prototype.every.call(obj, callbackfn2); } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-8.js index 528722d794..3bd8e4e075 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.16/15.4.4.16-3-8.js @@ -20,6 +20,6 @@ function testcase() { var obj = { 0: 9, length: Infinity }; - return !Array.prototype.every.call(obj, callbackfn) && accessed; + return Array.prototype.every.call(obj, callbackfn) && !accessed; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-12.js index 83ceacaac3..83d280f6dc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-12.js @@ -20,7 +20,7 @@ function testcase() { var obj = { 0: 9, 1: 11, 2: 12, length: "-4294967294" }; - return !Array.prototype.some.call(obj, callbackfn1) && + return Array.prototype.some.call(obj, callbackfn1) && !Array.prototype.some.call(obj, callbackfn2); } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-14.js index 083e195ae0..4d42107cb0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-14.js @@ -22,8 +22,8 @@ function testcase() { var objTwo = { 0: 11, length: "+Infinity" }; var objThree = { 0: 11, length: "-Infinity" }; - return Array.prototype.some.call(objOne, callbackfn) && - Array.prototype.some.call(objTwo, callbackfn) && - !Array.prototype.some.call(objThree, callbackfn) && accessed; + return !Array.prototype.some.call(objOne, callbackfn) && + !Array.prototype.some.call(objTwo, callbackfn) && + !Array.prototype.some.call(objThree, callbackfn) && !accessed; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-25.js index a4bbad8d69..e4b327eaa9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-25.js @@ -5,7 +5,7 @@ /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-25.js - * @description Array.prototype.some - value of 'length' is a negative non-integer + * @description Array.prototype.some - value of 'length' is a negative non-integer, ensure truncation occurs in the proper direction */ @@ -25,7 +25,7 @@ function testcase() { length: -4294967294.5 }; - return !Array.prototype.some.call(obj, callbackfn1) && + return Array.prototype.some.call(obj, callbackfn1) && !Array.prototype.some.call(obj, callbackfn2); } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-28.js b/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-28.js index c27b210de3..b32cd4b4c3 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-28.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-28.js @@ -23,6 +23,6 @@ function testcase() { length: 4294967296 }; - return Array.prototype.some.call(obj, callbackfn) && accessed; + return !Array.prototype.some.call(obj, callbackfn) && !accessed; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-29.js b/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-29.js index 51c27f7be1..129eccf436 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-29.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-29.js @@ -25,6 +25,6 @@ function testcase() { }; return Array.prototype.some.call(obj, callbackfn1) && - Array.prototype.some.call(obj, callbackfn2); + !Array.prototype.some.call(obj, callbackfn2); } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-7.js index 96a6c67ad1..e6d6387086 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-7.js @@ -20,7 +20,7 @@ function testcase() { var obj = { 0: 9, 1: 11, 2: 12, length: -4294967294 }; - return !Array.prototype.some.call(obj, callbackfn1) && + return Array.prototype.some.call(obj, callbackfn1) && !Array.prototype.some.call(obj, callbackfn2); } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-8.js index 05631f267f..fff966b22a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-3-8.js @@ -20,6 +20,6 @@ function testcase() { var obj = { 0: 11, length: Infinity }; - return Array.prototype.some.call(obj, callbackfn) && accessed; + return !Array.prototype.some.call(obj, callbackfn) && !accessed; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-12.js index 17bd7881a6..b9379bb8d3 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-12.js @@ -21,6 +21,6 @@ function testcase() { Array.prototype.forEach.call(obj, callbackfn); - return !testResult; + return testResult; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-14.js index c3918142ad..a3bb7e521e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-14.js @@ -5,22 +5,36 @@ /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-14.js - * @description Array.prototype.forEach - 'length' is a string containing -Infinity + * @description Array.prototype.forEach - 'length' is a string containing +/-Infinity */ function testcase() { + var accessed1 = false; var accessed2 = false; + var accessed3 = false; + + function callbackfn1(val, idx, obj) { + accessed1 = true; + } function callbackfn2(val, idx, obj) { accessed2 = true; } + function callbackfn3(val, idx, obj) { + accessed3 = true; + } + + var obj1 = { 0: 9, length: "Infinity" }; var obj2 = { 0: 9, length: "-Infinity" }; + var obj3 = { 0: 9, length: "+Infinity" }; + Array.prototype.forEach.call(obj1, callbackfn1); Array.prototype.forEach.call(obj2, callbackfn2); + Array.prototype.forEach.call(obj3, callbackfn3); - return !accessed2; + return !accessed1 && !accessed2 && !accessed3; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-25.js index f3e0f68cdb..61264d3ba2 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-25.js @@ -5,7 +5,7 @@ /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-25.js - * @description Array.prototype.forEach - value of 'length' is a negative non-integer + * @description Array.prototype.forEach - value of 'length' is a negative non-integer, ensure truncation occurs in the proper direction */ @@ -25,6 +25,6 @@ function testcase() { Array.prototype.forEach.call(obj, callbackfn); - return !testResult; + return testResult; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-7.js index a5261a6721..255465da19 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-7.js @@ -21,6 +21,6 @@ function testcase() { Array.prototype.forEach.call(obj, callbackfn); - return !testResult1; + return testResult1; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-12.js index 05fc0aa2b1..bc8a8bd607 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-12.js @@ -18,6 +18,6 @@ function testcase() { var newArr = Array.prototype.map.call(obj, callbackfn); - return newArr.length === 0; + return newArr.length === 2; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-14.js index fc0c2f363a..12ab69187b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-14.js @@ -16,12 +16,8 @@ function testcase() { var obj = { 0: 9, length: "Infinity" }; - try { - Array.prototype.map.call(obj, callbackfn); - } catch (e) { - if (e instanceof RangeError) { - return true; - } - } + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 0; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-25.js index 200c3881f0..fb8650562d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-25.js @@ -5,7 +5,7 @@ /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-25.js - * @description Array.prototype.map - value of 'length' is a negative non-integer + * @description Array.prototype.map - value of 'length' is a negative non-integer, ensure truncation occurs in the proper direction */ @@ -23,6 +23,6 @@ function testcase() { var newArr = Array.prototype.map.call(obj, callbackfn); - return newArr.length === 0; + return newArr.length === 2; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-28.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-28.js index fbf88b6101..6ec1c9b0cd 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-28.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-28.js @@ -20,12 +20,8 @@ function testcase() { length: 4294967296 }; - try { - var newArr = Array.prototype.map.call(obj, callbackfn); - } catch (e) { - if (e instanceof RangeError) { - return true; - } - } + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 0; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-29.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-29.js index dc000a83ec..17cc5ec778 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-29.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-29.js @@ -21,12 +21,7 @@ function testcase() { length: 4294967297 }; - try { - var newArr = Array.prototype.map.call(obj, callbackfn); - } catch (e) { - if (e instanceof RangeError) { - return true; - } - } + var newArr = Array.prototype.map.call(obj, callbackfn); + return newArr.length === 1; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-7.js index fb6425f369..2088b90cc0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-7.js @@ -18,6 +18,6 @@ function testcase() { var newArr = Array.prototype.map.call(obj, callbackfn); - return newArr.length === 0; + return newArr.length === 2; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-8.js index b856f5be71..7c6fc4cfaa 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-8.js @@ -16,12 +16,8 @@ function testcase() { var obj = { 0: 9, length: Infinity }; - try { - Array.prototype.map.call(obj, callbackfn); - } catch (e) { - if (e instanceof RangeError) { - return true; - } - } + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 0; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-12.js index ff65ca465e..001eddca5d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-12.js @@ -19,6 +19,6 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 0 && newArr[0] === undefined; + return newArr.length === 1 && newArr[0] === 11; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-14.js index 1ba6bac912..9c366d1251 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-14.js @@ -5,23 +5,41 @@ /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-14.js - * @description Array.prototype.filter - 'length' is a string containing -Infinity + * @description Array.prototype.filter - 'length' is a string containing +/-Infinity */ function testcase() { + var accessed1 = false; var accessed2 = false; + var accessed3 = false; + + function callbackfn1(val, idx, obj) { + accessed1 = true; + return true; + } function callbackfn2(val, idx, obj) { accessed2 = true; return true; } + function callbackfn3(val, idx, obj) { + accessed3 = true; + return true; + } + + var obj1 = { 0: 9, length: "Infinity" }; var obj2 = { 0: 9, length: "-Infinity" }; + var obj3 = { 0: 9, length: "+Infinity" }; + var newArr1 = Array.prototype.filter.call(obj1, callbackfn1); var newArr2 = Array.prototype.filter.call(obj2, callbackfn2); + var newArr3 = Array.prototype.filter.call(obj3, callbackfn3); - return !accessed2 && newArr2.length === 0; + return !accessed1 && newArr1.length === 0 && + !accessed2 && newArr2.length === 0 && + !accessed3 && newArr3.length === 0; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-25.js index 4d51410239..c22a2e3061 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-25.js @@ -5,7 +5,7 @@ /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-25.js - * @description Array.prototype.filter - value of 'length' is a negative non-integer + * @description Array.prototype.filter - value of 'length' is a negative non-integer, ensure truncation occurs in the proper direction */ @@ -23,6 +23,6 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 0 && newArr[0] === undefined; + return newArr.length === 1 && newArr[0] === 11; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-7.js index 43a14d16f8..59e1cf19bf 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-7.js @@ -18,6 +18,6 @@ function testcase() { var obj = { 1: 11, 2: 9, length: -4294967294 }; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 0 && newArr[0] === undefined; + return newArr.length === 1 && newArr[0] === 11; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-12.js index ecca645e41..2a0b3e217e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-12.js @@ -17,6 +17,6 @@ function testcase() { var obj = { 1: 11, 2: 9, length: "-4294967294" }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === 1; + return Array.prototype.reduce.call(obj, callbackfn, 1) === true; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-14.js index 69f8bfebe8..01f086dfbe 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-14.js @@ -5,22 +5,38 @@ /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-14.js - * @description Array.prototype.reduce - 'length' is a string containing -Infinity + * @description Array.prototype.reduce - 'length' is a string containing +/-Infinity */ function testcase() { + var accessed1 = false; var accessed2 = false; + var accessed3 = false; + + function callbackfn1(prevVal, curVal, idx, obj) { + accessed1 = true; + return 2; + } function callbackfn2(prevVal, curVal, idx, obj) { accessed2 = true; return 2; } - var obj2 = { 0: 9, length: "-Infinity" }; + function callbackfn3(prevVal, curVal, idx, obj) { + accessed3 = true; + return 2; + } - return Array.prototype.reduce.call(obj2, callbackfn2, 1) === 1 - && !accessed2; + var obj1 = { 0: 9, length: "Infinity" }; + var obj2 = { 0: 9, length: "-Infinity" }; + var obj3 = { 0: 9, length: "+Infinity" }; + + return Array.prototype.reduce.call(obj1, callbackfn1, 1) === 1 && + Array.prototype.reduce.call(obj2, callbackfn2, 1) === 1 && + Array.prototype.reduce.call(obj3, callbackfn3, 1) === 1 && + !accessed1 && !accessed2 && !accessed3; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-25.js index 2686bdcaa8..2a7cb1264a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-25.js @@ -5,7 +5,7 @@ /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-25.js - * @description Array.prototype.reduce - value of 'length' is a negative non-integer + * @description Array.prototype.reduce - value of 'length' is a negative non-integer, ensure truncation occurs in the proper direction */ @@ -21,6 +21,6 @@ function testcase() { length: -4294967294.5 }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === 1; + return Array.prototype.reduce.call(obj, callbackfn, 1) === true; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-7.js index cea4f2f138..ac61e1b6d5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-7.js @@ -17,6 +17,6 @@ function testcase() { var obj = { 1: 11, 2: 9, length: -4294967294 }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === 1; + return Array.prototype.reduce.call(obj, callbackfn, 1) === true; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-3-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-3-12.js index e2497f54c5..411240b4a9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-3-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-3-12.js @@ -27,6 +27,6 @@ function testcase() { var obj = { 0: 11, 1: 12, 2: 9, length: "-4294967294" }; Array.prototype.reduceRight.call(obj, callbackfn, 1); - return testResult1 && !testResult2; + return testResult1 && testResult2; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-3-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-3-14.js index 11a97f9461..1d95beeb36 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-3-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-3-14.js @@ -5,21 +5,35 @@ /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-3-14.js - * @description Array.prototype.reduceRight - value of 'length' is a string containing -Infinity + * @description Array.prototype.reduceRight - value of 'length' is a string containing +/-Infinity */ function testcase() { + var accessed1 = false; var accessed2 = false; + var accessed3 = false; + + function callbackfn1(prevVal, curVal, idx, obj) { + accessed1 = true; + } function callbackfn2(prevVal, curVal, idx, obj) { accessed2 = true; } - var obj2 = { 0: 9, length: "-Infinity" }; + function callbackfn3(prevVal, curVal, idx, obj) { + accessed3 = true; + } - return Array.prototype.reduceRight.call(obj2, callbackfn2, 2) === 2 && - !accessed2; + var obj1 = { 0: 9, length: "Infinity" }; + var obj2 = { 0: 9, length: "-Infinity" }; + var obj3 = { 0: 9, length: "+Infinity" }; + + return Array.prototype.reduceRight.call(obj1, callbackfn1, 1) === 1 && + Array.prototype.reduceRight.call(obj2, callbackfn2, 2) === 2 && + Array.prototype.reduceRight.call(obj3, callbackfn3, 3) === 3 && + !accessed1 && !accessed2 && !accessed3; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-3-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-3-25.js index 92073e8a84..3970cdda62 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-3-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-3-25.js @@ -5,7 +5,7 @@ /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-3-25.js - * @description Array.prototype.reduceRight - value of 'length' is a negative non-integer + * @description Array.prototype.reduceRight - value of 'length' is a negative non-integer, ensure truncation occurs in the proper direction */ @@ -32,6 +32,6 @@ function testcase() { }; Array.prototype.reduceRight.call(obj, callbackfn, 1); - return testResult1 && !testResult2; + return testResult1 && testResult2; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-3-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-3-7.js index 42043d89ef..82ee2aad77 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-3-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-3-7.js @@ -27,6 +27,6 @@ function testcase() { var obj = { 1: 11, 2: 9, length: -4294967294 }; Array.prototype.reduceRight.call(obj, callbackfn, 1); - return testResult1 && !testResult2; + return testResult1 && testResult2; } runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.5/S15.4.4.5_A4_T3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.5/S15.4.4.5_A4_T3.js index 7bdd7a2f8e..df9eba2939 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.5/S15.4.4.5_A4_T3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.5/S15.4.4.5_A4_T3.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * Check ToLength(length) for non Array objects + * Check ToUint32(length) for non Array objects * * @path ch15/15.4/15.4.4/15.4.4.5/S15.4.4.5_A4_T3.js * @description length = -4294967294 @@ -16,8 +16,8 @@ obj[2] = "z"; obj.length = -4294967294; //CHECK#1 -if (obj.join("") !== "") { - $ERROR('#1: var obj = {}; obj.join = Array.prototype.join; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.join("") === "". Actual: ' + (obj.join(""))); +if (obj.join("") !== "xy") { + $ERROR('#1: var obj = {}; obj.join = Array.prototype.join; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.join("") === "xy". Actual: ' + (obj.join(""))); } //CHECK#2 diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.6/S15.4.4.6_A2_T2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.6/S15.4.4.6_A2_T2.js index a2dc0c4605..452ceb072f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.6/S15.4.4.6_A2_T2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.6/S15.4.4.6_A2_T2.js @@ -33,8 +33,8 @@ if (pop !== undefined) { } //CHECK#4 -if (obj.length !== 9007199254740990) { - $ERROR('#4: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 9007199254740990. Actual: ' + (obj.length)); +if (obj.length !== 0) { + $ERROR('#4: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length)); } //CHECK#5 diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.6/S15.4.4.6_A3_T1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.6/S15.4.4.6_A3_T1.js index 2620efdda3..666f2c37e5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.6/S15.4.4.6_A3_T1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.6/S15.4.4.6_A3_T1.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * Check ToLength(length) for non Array objects + * Check ToUint32(length) for non Array objects * * @path ch15/15.4/15.4.4/15.4.4.6/S15.4.4.6_A3_T1.js * @description length = 4294967296 @@ -16,13 +16,13 @@ obj.length = 4294967296; //CHECK#1 var pop = obj.pop(); -if (pop !== "y") { - $ERROR('#1: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.pop() === "y". Actual: ' + (pop)); +if (pop !== undefined) { + $ERROR('#1: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.pop() === unedfined. Actual: ' + (pop)); } //CHECK#2 -if (obj.length !== 4294967295) { - $ERROR('#2: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.pop(); obj.length === 4294967295. Actual: ' + (obj.length)); +if (obj.length !== 0) { + $ERROR('#2: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.pop(); obj.length === 0. Actual: ' + (obj.length)); } //CHECK#3 @@ -31,7 +31,7 @@ if (obj[0] !== "x") { } //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])); +if (obj[4294967295] !== "y") { + $ERROR('#4: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.pop(); obj[4294967295] === "y". Actual: ' + (obj[4294967295])); } diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.6/S15.4.4.6_A3_T2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.6/S15.4.4.6_A3_T2.js index 91017c44dd..910e5d94d0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.6/S15.4.4.6_A3_T2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.6/S15.4.4.6_A3_T2.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * Check ToLength(length) for non Array objects + * Check ToUint32(length) for non Array objects * * @path ch15/15.4/15.4.4/15.4.4.6/S15.4.4.6_A3_T2.js * @description length = 4294967297 @@ -16,22 +16,22 @@ obj.length = 4294967297; //CHECK#1 var pop = obj.pop(); -if (pop !== "y") { - $ERROR('#1: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; obj.pop() === "y". Actual: ' + (pop)); +if (pop !== "x") { + $ERROR('#1: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; obj.pop() === "x". Actual: ' + (pop)); } //CHECK#2 -if (obj.length !== 4294967296) { - $ERROR('#2: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; obj.pop(); obj.length === 4294967296. Actual: ' + (obj.length)); +if (obj.length !== 0) { + $ERROR('#2: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; obj.pop(); obj.length === 0. Actual: ' + (obj.length)); } //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])); +if (obj[0] !== undefined) { + $ERROR('#3: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; obj.pop(); obj[0] === undefined. 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])); +if (obj[4294967296] !== "y") { + $ERROR('#4: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; obj.pop(); obj[4294967296] === "y". Actual: ' + (obj[4294967296])); } diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.6/S15.4.4.6_A3_T3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.6/S15.4.4.6_A3_T3.js index 2e198b8617..9eee4cee8f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.6/S15.4.4.6_A3_T3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.6/S15.4.4.6_A3_T3.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * Check ToLength(length) for non Array objects + * Check ToUint32(length) for non Array objects * * @path ch15/15.4/15.4.4/15.4.4.6/S15.4.4.6_A3_T3.js * @description length = -1 @@ -15,17 +15,17 @@ obj.length = -1; //CHECK#1 var pop = obj.pop(); -if (pop !== undefined) { - $ERROR('#1: var obj = {}; obj.pop = Array.prototype.pop; obj[4294967294] = "x"; obj.length = -1; obj.pop() === undefined. Actual: ' + (pop)); +if (pop !== "x") { + $ERROR('#1: var obj = {}; obj.pop = Array.prototype.pop; obj[4294967294] = "x"; obj.length = -1; obj.pop() === "x". Actual: ' + (pop)); } //CHECK#2 -if (obj.length !== 0) { - $ERROR('#2: var obj = {}; obj.pop = Array.prototype.pop; obj[4294967294] = "x"; obj.length = -1; obj.pop(); obj.length === 0. Actual: ' + (obj.length)); +if (obj.length !== 4294967294) { + $ERROR('#2: var obj = {}; obj.pop = Array.prototype.pop; obj[4294967294] = "x"; obj.length = -1; obj.pop(); obj.length === 4294967294. Actual: ' + (obj.length)); } //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])); +if (obj[4294967294] !== undefined) { + $ERROR('#3: var obj = {}; obj.pop = Array.prototype.pop; obj[4294967294] = "x"; obj.length = -1; obj.pop(); obj[4294967294] === undefined. Actual: ' + (obj[4294967294])); } diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A2_T2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A2_T2.js index 77c034293f..b294fae5b9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A2_T2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A2_T2.js @@ -34,18 +34,18 @@ if (obj["0"] !== -1) { //CHECK#4 obj.length = Number.POSITIVE_INFINITY; var push = obj.push(-4); -if (push !== 9007199254740992) { - $ERROR('#4: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-4) === 9007199254740992. Actual: ' + (push)); +if (push !== 1) { + $ERROR('#4: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-4) === 1. Actual: ' + (push)); } //CHECK#5 -if (obj.length !== 9007199254740992) { - $ERROR('#6: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-4); obj.length === 9007199254740992. Actual: ' + (obj.length)); +if (obj.length !== 1) { + $ERROR('#6: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-4); obj.length === 1. Actual: ' + (obj.length)); } //CHECK#6 -if (obj[9007199254740991] !== -4) { - $ERROR('#6: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-4); obj[9007199254740991] === -4. Actual: ' + (obj["0"])); +if (obj["0"] !== -4) { + $ERROR('#6: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-4); obj["0"] === -4. Actual: ' + (obj["0"])); } //CHECK#7 diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A3.js index 4e1dc44890..910fe9f3cb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A3.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * Check ToLength(length) for Array object + * Check ToUint32(length) for Array object * * @path ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A3.js * @description If ToUint32(length) !== length, throw RangeError diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A4_T1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A4_T1.js index 603712513b..73e59476f1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A4_T1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A4_T1.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * Check ToLength(length) for non Array objects + * Check ToUint32(length) for non Array objects * * @path ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A4_T1.js * @description length = 4294967296 @@ -14,57 +14,42 @@ obj.length = 4294967296; //CHECK#1 var push = obj.push("x", "y", "z"); -if (push !== 4294967299) { - $ERROR('#1: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z") === 4294967299. Actual: ' + (push)); +if (push !== 3) { + $ERROR('#1: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z") === 3. Actual: ' + (push)); } //CHECK#2 -if (obj.length !== 4294967299) { - $ERROR('#2: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj.length === 4294967299. Actual: ' + (obj.length)); +if (obj.length !== 3) { + $ERROR('#2: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj.length === 3. Actual: ' + (obj.length)); } //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])); +if (obj[0] !== "x") { + $ERROR('#3: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[0] === "x". 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])); +if (obj[1] !== "y") { + $ERROR('#4: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[1] === "y". 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])); -} - -//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])); -} - -//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])); -} - -//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])); +if (obj[2] !== "z") { + $ERROR('#5: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[2] === "z". Actual: ' + (obj[2])); } var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; -//CHECK#9 +//CHECK#6 var push = obj.push(); -if (push !== 4294967296) { - $ERROR('#9: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push() === 4294967296. Actual: ' + (push)); +if (push !== 0) { + $ERROR('#6: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push() === 0. Actual: ' + (push)); } -//CHECK#10 -if (obj.length !== 4294967296) { - $ERROR('#10: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push(); obj.length === 4294967296. Actual: ' + (obj.length)); +//CHECK#7 +if (obj.length !== 0) { + $ERROR('#7: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push(); obj.length === 0. Actual: ' + (obj.length)); } diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A4_T2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A4_T2.js index ffab2c0239..02e18ab0ab 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A4_T2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A4_T2.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * Check ToLength(length) for non Array objects + * Check ToUint32(length) for non Array objects * * @path ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A4_T2.js * @description length = 4294967295 diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A4_T3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A4_T3.js index 361b1a2529..fdd6279da6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A4_T3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A4_T3.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * Check ToLength(length) for non Array objects + * Check ToUint32(length) for non Array objects * * @path ch15/15.4/15.4.4/15.4.4.7/S15.4.4.7_A4_T3.js * @description length = -1 @@ -14,42 +14,27 @@ obj.length = -1; //CHECK#1 var push = obj.push("x", "y", "z"); -if (push !== 3) { - $ERROR('#1: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z") === 3. Actual: ' + (push)); +if (push !== 4294967298) { + $ERROR('#1: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z") === 4294967298. Actual: ' + (push)); } //CHECK#2 -if (obj.length !== 3) { - $ERROR('#2: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj.length === 3. Actual: ' + (obj.length)); +if (obj.length !== 4294967298) { + $ERROR('#2: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj.length === 4294967298. Actual: ' + (obj.length)); } //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])); +if (obj[4294967295] !== "x") { + $ERROR('#3: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[4294967295] === "x". 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])); +if (obj[4294967296] !== "y") { + $ERROR('#4: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[4294967296] === "y". 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])); +if (obj[4294967297] !== "z") { + $ERROR('#5: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[4294967297] === "z". 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])); -} - -//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])); -} - -//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])); -} - diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.8/S15.4.4.8_A3_T3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.8/S15.4.4.8_A3_T3.js index 8fbeb6fe2f..ab9eeaef2c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.8/S15.4.4.8_A3_T3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.8/S15.4.4.8_A3_T3.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * Check ToLength(length) for non Array objects + * Check ToUint32(length) for non Array objects * * @path ch15/15.4/15.4.4/15.4.4.8/S15.4.4.8_A3_T3.js * @description length = -4294967294 @@ -27,13 +27,13 @@ if (obj.length !== -4294967294) { } //CHECK#3 -if (obj[0] !== "x") { - $ERROR('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.reverse(); obj[0] === "x". Actual: ' + (obj[0])); +if (obj[0] !== "y") { + $ERROR('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.reverse(); obj[0] === "y". Actual: ' + (obj[0])); } //CHECK#4 -if (obj[1] !== "y") { - $ERROR('#4: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.reverse(); obj[1] === "y". Actual: ' + (obj[1])); +if (obj[1] !== "x") { + $ERROR('#4: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.reverse(); obj[1] === "x". Actual: ' + (obj[1])); } //CHECK#5 diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.9/S15.4.4.9_A3_T3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.9/S15.4.4.9_A3_T3.js index a569e52c3d..23243d7be4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.9/S15.4.4.9_A3_T3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.9/S15.4.4.9_A3_T3.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * Check ToLength(length) for non Array objects + * Check ToUint32(length) for non Array objects * * @path ch15/15.4/15.4.4/15.4.4.9/S15.4.4.9_A3_T3.js * @description length is arbitrarily @@ -16,22 +16,22 @@ obj.length = -4294967294; //CHECK#1 var shift = obj.shift(); -if (shift !== undefined) { - $ERROR('#1: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x"; obj[1] = "y"; obj.length = -4294967294; obj.shift() === undefined. Actual: ' + (shift)); +if (shift !== "x") { + $ERROR('#1: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x"; obj[1] = "y"; obj.length = -4294967294; obj.shift() === "x". Actual: ' + (shift)); } //CHECK#2 -if (obj.length !== 0) { - $ERROR('#2: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x"; obj[1] = "y"; obj.length = -4294967294; obj.shift(); obj.length === 0. Actual: ' + (obj.length)); +if (obj.length !== 1) { + $ERROR('#2: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x"; obj[1] = "y"; obj.length = -4294967294; obj.shift(); obj.length === 1. Actual: ' + (obj.length)); } //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])); +if (obj[0] !== "y") { + $ERROR('#3: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x"; obj[1] = "y"; obj.length = -4294967294; obj.shift(); obj[0] === "y". 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])); +if (obj[1] !== undefined) { + $ERROR('#4: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x" obj[1] = "y"; obj.length = -4294967294; obj.shift(); obj[1] === undefined. Actual: ' + (obj[1])); }