mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Revert adding tests for ES6 toLength semantics but retain deletion of tests and verifications that cause hangs in ES6-conformant implementations
This commit is contained in:
parent
95939bd505
commit
29e247ddd4
@ -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]));
|
||||
}
|
||||
|
||||
|
@ -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]));
|
||||
}
|
||||
|
||||
|
@ -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]));
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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]));
|
||||
}
|
||||
|
||||
|
@ -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]));
|
||||
}
|
||||
|
||||
|
@ -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]));
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -21,6 +21,6 @@ function testcase() {
|
||||
|
||||
Array.prototype.forEach.call(obj, callbackfn);
|
||||
|
||||
return !testResult;
|
||||
return testResult;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -21,6 +21,6 @@ function testcase() {
|
||||
|
||||
Array.prototype.forEach.call(obj, callbackfn);
|
||||
|
||||
return !testResult1;
|
||||
return testResult1;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
@ -18,6 +18,6 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 0;
|
||||
return newArr.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -18,6 +18,6 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 0;
|
||||
return newArr.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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]));
|
||||
}
|
||||
|
||||
|
@ -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]));
|
||||
}
|
||||
|
||||
|
@ -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]));
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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]));
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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]));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user