chore: migrate $ERROR -> throw new Test262Error in test/built-ins/Array (#3071)

This commit is contained in:
Rick Waldron 2021-07-21 14:53:23 -04:00 committed by GitHub
parent 347b651e95
commit 99ab8cce08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
254 changed files with 1438 additions and 1438 deletions

View File

@ -14,12 +14,12 @@ description: Array.prototype.toString = Object.prototype.toString
Array.prototype.toString = Object.prototype.toString;
var x = Array();
if (x.toString() !== "[object " + "Array" + "]") {
$ERROR('#1: Array.prototype.toString = Object.prototype.toString; var x = Array(); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString()));
throw new Test262Error('#1: Array.prototype.toString = Object.prototype.toString; var x = Array(); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString()));
}
//CHECK#2
Array.prototype.toString = Object.prototype.toString;
var x = Array(0, 1, 2);
if (x.toString() !== "[object " + "Array" + "]") {
$ERROR('#2: Array.prototype.toString = Object.prototype.toString; var x = Array(0,1,2); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString()));
throw new Test262Error('#2: Array.prototype.toString = Object.prototype.toString; var x = Array(0,1,2); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString()));
}

View File

@ -12,5 +12,5 @@ description: Checking use isPrototypeOf
//CHECK#1
if (Array.prototype.isPrototypeOf(Array()) !== true) {
$ERROR('#1: Array.prototype.isPrototypeOf(Array()) === true. Actual: ' + (Array.prototype.isPrototypeOf(Array())));
throw new Test262Error('#1: Array.prototype.isPrototypeOf(Array()) === true. Actual: ' + (Array.prototype.isPrototypeOf(Array())));
}

View File

@ -11,12 +11,12 @@ description: Checking use Object.prototype.toString
var x = Array();
x.getClass = Object.prototype.toString;
if (x.getClass() !== "[object " + "Array" + "]") {
$ERROR('#1: var x = Array(); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass()));
throw new Test262Error('#1: var x = Array(); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass()));
}
//CHECK#2
var x = Array(0, 1, 2);
x.getClass = Object.prototype.toString;
if (x.getClass() !== "[object " + "Array" + "]") {
$ERROR('#2: var x = Array(0,1,2); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass()));
throw new Test262Error('#2: var x = Array(0,1,2); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass()));
}

View File

@ -13,10 +13,10 @@ var x = Array(2);
//CHECK#1
if (x.length === 1) {
$ERROR('#1: var x = Array(2); x.length !== 1');
throw new Test262Error('#1: var x = Array(2); x.length !== 1');
}
//CHECK#2
if (x[0] === 2) {
$ERROR('#2: var x = Array(2); x[0] !== 2');
throw new Test262Error('#2: var x = Array(2); x[0] !== 2');
}

View File

@ -11,15 +11,15 @@ description: Array constructor is given no arguments or at least two arguments
//CHECK#1
if (Array().length !== 0) {
$ERROR('#1: (Array().length === 0. Actual: ' + (Array().length));
throw new Test262Error('#1: (Array().length === 0. Actual: ' + (Array().length));
}
//CHECK#2
if (Array(0, 1, 0, 1).length !== 4) {
$ERROR('#2: (Array(0,1,0,1).length === 4. Actual: ' + (Array(0, 1, 0, 1).length));
throw new Test262Error('#2: (Array(0,1,0,1).length === 4. Actual: ' + (Array(0, 1, 0, 1).length));
}
//CHECK#3
if (Array(undefined, undefined).length !== 2) {
$ERROR('#3: (Array(undefined, undefined).length === 2. Actual: ' + (Array(undefined, undefined).length));
throw new Test262Error('#3: (Array(undefined, undefined).length === 2. Actual: ' + (Array(undefined, undefined).length));
}

View File

@ -34,5 +34,5 @@ for (var i = 0; i < 100; i++) {
}
if (result !== true) {
$ERROR('#1: x[i] === i. Actual: ' + (x[i]));
throw new Test262Error('#1: x[i] === i. Actual: ' + (x[i]));
}

View File

@ -11,10 +11,10 @@ description: Checking use typeof, instanceof
//CHECK#1
if (typeof Array() !== "object") {
$ERROR('#1: typeof Array() === "object". Actual: ' + (typeof Array()));
throw new Test262Error('#1: typeof Array() === "object". Actual: ' + (typeof Array()));
}
//CHECK#2
if ((Array() instanceof Array) !== true) {
$ERROR('#2: (Array() instanceof Array) === true. Actual: ' + (Array() instanceof Array));
throw new Test262Error('#2: (Array() instanceof Array) === true. Actual: ' + (Array() instanceof Array));
}

View File

@ -16,10 +16,10 @@ description: >
Array.prototype.myproperty = 1;
var x = new Array();
if (x.myproperty !== 1) {
$ERROR('#1: Array.prototype.myproperty = 1; var x = new Array(); x.myproperty === 1. Actual: ' + (x.myproperty));
throw new Test262Error('#1: Array.prototype.myproperty = 1; var x = new Array(); x.myproperty === 1. Actual: ' + (x.myproperty));
}
//CHECK#2
if (x.hasOwnProperty('myproperty') !== false) {
$ERROR('#2: Array.prototype.myproperty = 1; var x = new Array(); x.hasOwnProperty(\'myproperty\') === false. Actual: ' + (x.hasOwnProperty('myproperty')));
throw new Test262Error('#2: Array.prototype.myproperty = 1; var x = new Array(); x.hasOwnProperty(\'myproperty\') === false. Actual: ' + (x.hasOwnProperty('myproperty')));
}

View File

@ -14,12 +14,12 @@ description: Array.prototype.toString = Object.prototype.toString
Array.prototype.toString = Object.prototype.toString;
var x = new Array();
if (x.toString() !== "[object " + "Array" + "]") {
$ERROR('#1: Array.prototype.toString = Object.prototype.toString; var x = new Array(); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString()));
throw new Test262Error('#1: Array.prototype.toString = Object.prototype.toString; var x = new Array(); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString()));
}
//CHECK#2
Array.prototype.toString = Object.prototype.toString;
var x = new Array(0, 1, 2);
if (x.toString() !== "[object " + "Array" + "]") {
$ERROR('#2: Array.prototype.toString = Object.prototype.toString; var x = new Array(0,1,2); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString()));
throw new Test262Error('#2: Array.prototype.toString = Object.prototype.toString; var x = new Array(0,1,2); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString()));
}

View File

@ -12,5 +12,5 @@ description: Checking use isPrototypeOf
//CHECK#1
if (Array.prototype.isPrototypeOf(new Array()) !== true) {
$ERROR('#1: Array.prototype.isPrototypeOf(new Array()) === true. Actual: ' + (Array.prototype.isPrototypeOf(new Array())));
throw new Test262Error('#1: Array.prototype.isPrototypeOf(new Array()) === true. Actual: ' + (Array.prototype.isPrototypeOf(new Array())));
}

View File

@ -11,12 +11,12 @@ description: Checking use Object.prototype.toString
var x = new Array();
x.getClass = Object.prototype.toString;
if (x.getClass() !== "[object " + "Array" + "]") {
$ERROR('#1: var x = new Array(); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass()));
throw new Test262Error('#1: var x = new Array(); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass()));
}
//CHECK#2
var x = new Array(0, 1, 2);
x.getClass = Object.prototype.toString;
if (x.getClass() !== "[object " + "Array" + "]") {
$ERROR('#2: var x = new Array(0,1,2); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass()));
throw new Test262Error('#2: var x = new Array(0,1,2); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass()));
}

View File

@ -13,10 +13,10 @@ var x = new Array(2);
//CHECK#1
if (x.length === 1) {
$ERROR('#1: var x = new Array(2); x.length !== 1');
throw new Test262Error('#1: var x = new Array(2); x.length !== 1');
}
//CHECK#2
if (x[0] === 2) {
$ERROR('#2: var x = new Array(2); x[0] !== 2');
throw new Test262Error('#2: var x = new Array(2); x[0] !== 2');
}

View File

@ -11,15 +11,15 @@ description: Array constructor is given no arguments or at least two arguments
//CHECK#1
if (new Array().length !== 0) {
$ERROR('#1: new Array().length === 0. Actual: ' + (new Array().length));
throw new Test262Error('#1: new Array().length === 0. Actual: ' + (new Array().length));
}
//CHECK#2
if (new Array(0, 1, 0, 1).length !== 4) {
$ERROR('#2: new Array(0,1,0,1).length === 4. Actual: ' + (new Array(0, 1, 0, 1).length));
throw new Test262Error('#2: new Array(0,1,0,1).length === 4. Actual: ' + (new Array(0, 1, 0, 1).length));
}
//CHECK#3
if (new Array(undefined, undefined).length !== 2) {
$ERROR('#3: new Array(undefined, undefined).length === 2. Actual: ' + (new Array(undefined, undefined).length));
throw new Test262Error('#3: new Array(undefined, undefined).length === 2. Actual: ' + (new Array(undefined, undefined).length));
}

View File

@ -34,5 +34,5 @@ for (var i = 0; i < 100; i++) {
}
if (result !== true) {
$ERROR('#1: x[i] === i. Actual: ' + (x[i]));
throw new Test262Error('#1: x[i] === i. Actual: ' + (x[i]));
}

View File

@ -15,10 +15,10 @@ Function.prototype.myproperty = 1;
//CHECK#1
if (Array.myproperty !== 1) {
$ERROR('#1: Function.prototype.myproperty = 1; Array.myproperty === 1. Actual: ' + (Array.myproperty));
throw new Test262Error('#1: Function.prototype.myproperty = 1; Array.myproperty === 1. Actual: ' + (Array.myproperty));
}
//CHECK#2
if (Array.hasOwnProperty('myproperty') !== false) {
$ERROR('#2: Function.prototype.myproperty = 1; Array.hasOwnProperty(\'myproperty\') === false. Actual: ' + (Array.hasOwnProperty('myproperty')));
throw new Test262Error('#2: Function.prototype.myproperty = 1; Array.hasOwnProperty(\'myproperty\') === false. Actual: ' + (Array.hasOwnProperty('myproperty')));
}

View File

@ -12,5 +12,5 @@ description: Function.prototype.toString = Object.prototype.toString
//CHECK#1
Function.prototype.toString = Object.prototype.toString;
if (Array.toString() !== "[object " + "Function" + "]") {
$ERROR('#1: Function.prototype.toString = Object.prototype.toString; Array.toString() === "[object " + "Function" + "]". Actual: ' + (Array.toString()));
throw new Test262Error('#1: Function.prototype.toString = Object.prototype.toString; Array.toString() === "[object " + "Function" + "]". Actual: ' + (Array.toString()));
}

View File

@ -11,5 +11,5 @@ description: Checking use isPrototypeOf
//CHECK#1
if (Function.prototype.isPrototypeOf(Array) !== true) {
$ERROR('#1: Function.prototype.isPrototypeOf(Array) === true. Actual: ' + (Function.prototype.isPrototypeOf(Array)));
throw new Test262Error('#1: Function.prototype.isPrototypeOf(Array) === true. Actual: ' + (Function.prototype.isPrototypeOf(Array)));
}

View File

@ -15,11 +15,11 @@ description: Checking an inherited property
Array.prototype[2] = -1;
var x = [0, 1, 2];
if (x[2] !== 2) {
$ERROR('#1: Array.prototype[2] = -1; x = [0,1,3]; x[2] === 2. Actual: ' + (x[2]));
throw new Test262Error('#1: Array.prototype[2] = -1; x = [0,1,3]; x[2] === 2. Actual: ' + (x[2]));
}
//CHECK#2
x.length = 2;
if (x[2] !== -1) {
$ERROR('#2: Array.prototype[2] = -1; x = [0,1,3]; x.length = 2; x[2] === -1. Actual: ' + (x[2]));
throw new Test262Error('#2: Array.prototype[2] = -1; x = [0,1,3]; x.length = 2; x[2] === -1. Actual: ' + (x[2]));
}

View File

@ -13,31 +13,31 @@ description: P in [4294967295, -1, true]
var x = [];
x[4294967295] = 1;
if (x.length !== 0) {
$ERROR('#1.1: x = []; x[4294967295] = 1; x.length === 0. Actual: ' + (x.length));
throw new Test262Error('#1.1: x = []; x[4294967295] = 1; x.length === 0. Actual: ' + (x.length));
}
if (x[4294967295] !== 1) {
$ERROR('#1.2: x = []; x[4294967295] = 1; x[4294967295] === 1. Actual: ' + (x[4294967295]));
throw new Test262Error('#1.2: x = []; x[4294967295] = 1; x[4294967295] === 1. Actual: ' + (x[4294967295]));
}
//CHECK#2
x = [];
x[-1] = 1;
if (x.length !== 0) {
$ERROR('#2.1: x = []; x[-1] = 1; x.length === 0. Actual: ' + (x.length));
throw new Test262Error('#2.1: x = []; x[-1] = 1; x.length === 0. Actual: ' + (x.length));
}
if (x[-1] !== 1) {
$ERROR('#2.2: x = []; x[-1] = 1; x[-1] === 1. Actual: ' + (x[-1]));
throw new Test262Error('#2.2: x = []; x[-1] = 1; x[-1] === 1. Actual: ' + (x[-1]));
}
//CHECK#3
x = [];
x[true] = 1;
if (x.length !== 0) {
$ERROR('#3.1: x = []; x[true] = 1; x.length === 0. Actual: ' + (x.length));
throw new Test262Error('#3.1: x = []; x[true] = 1; x.length === 0. Actual: ' + (x.length));
}
if (x[true] !== 1) {
$ERROR('#3.2: x = []; x[true] = 1; x[true] === 1. Actual: ' + (x[true]));
throw new Test262Error('#3.2: x = []; x[true] = 1; x[true] === 1. Actual: ' + (x[true]));
}

View File

@ -13,17 +13,17 @@ description: length === 100, P in [0, 98, 99]
var x = Array(100);
x[0] = 1;
if (x.length !== 100) {
$ERROR('#1: x = Array(100); x[0] = 1; x.length === 100. Actual: ' + (x.length));
throw new Test262Error('#1: x = Array(100); x[0] = 1; x.length === 100. Actual: ' + (x.length));
}
//CHECK#2
x[98] = 1;
if (x.length !== 100) {
$ERROR('#2: x = Array(100); x[0] = 1; x[98] = 1; x.length === 100. Actual: ' + (x.length));
throw new Test262Error('#2: x = Array(100); x[0] = 1; x[98] = 1; x.length === 100. Actual: ' + (x.length));
}
//CHECK#3
x[99] = 1;
if (x.length !== 100) {
$ERROR('#3: x = Array(100); x[0] = 1; x[98] = 1; x[99] = 1; x.length === 100. Actual: ' + (x.length));
throw new Test262Error('#3: x = Array(100); x[0] = 1; x[98] = 1; x[99] = 1; x.length === 100. Actual: ' + (x.length));
}

View File

@ -13,11 +13,11 @@ description: length = 100, P in [100, 199]
var x = Array(100);
x[100] = 1;
if (x.length !== 101) {
$ERROR('#1: x = Array(100); x[100] = 1; x.length === 101. Actual: ' + (x.length));
throw new Test262Error('#1: x = Array(100); x[100] = 1; x.length === 101. Actual: ' + (x.length));
}
//CHECK#2
x[199] = 1;
if (x.length !== 200) {
$ERROR('#2: x = Array(100); x[100] = 1; x[199] = 1; x.length === 100. Actual: ' + (x.length));
throw new Test262Error('#2: x = Array(100); x[100] = 1; x[199] = 1; x.length === 100. Actual: ' + (x.length));
}

View File

@ -13,29 +13,29 @@ description: Checking boundary points
//CHECK#1
var x = [];
if (x.length !== 0) {
$ERROR('#1: x = []; x.length === 0. Actual: ' + (x.length));
throw new Test262Error('#1: x = []; x.length === 0. Actual: ' + (x.length));
}
//CHECK#2
x[0] = 1;
if (x.length !== 1) {
$ERROR('#2: x = []; x[1] = 1; x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#2: x = []; x[1] = 1; x.length === 1. Actual: ' + (x.length));
}
//CHECK#3
x[1] = 1;
if (x.length !== 2) {
$ERROR('#3: x = []; x[0] = 1; x[1] = 1; x.length === 2. Actual: ' + (x.length));
throw new Test262Error('#3: x = []; x[0] = 1; x[1] = 1; x.length === 2. Actual: ' + (x.length));
}
//CHECK#4
x[2147483648] = 1;
if (x.length !== 2147483649) {
$ERROR('#4: x = []; x[0] = 1; x[1] = 1; x[2147483648] = 1; x.length === 2147483649. Actual: ' + (x.length));
throw new Test262Error('#4: x = []; x[0] = 1; x[1] = 1; x[2147483648] = 1; x.length === 2147483649. Actual: ' + (x.length));
}
//CHECK#5
x[4294967294] = 1;
if (x.length !== 4294967295) {
$ERROR('#5: x = []; x[0] = 1; x[1] = 1; x[2147483648] = 1; x[42949672954] = 1; x.length === 4294967295. Actual: ' + (x.length));
throw new Test262Error('#5: x = []; x[0] = 1; x[1] = 1; x[2147483648] = 1; x[42949672954] = 1; x.length === 4294967295. Actual: ' + (x.length));
}

View File

@ -14,7 +14,7 @@ description: P = "2^32 - 1" is not index array
var x = [];
x[4294967295] = 1;
if (x.length !== 0) {
$ERROR('#1: x = []; x[4294967295] = 1; x.length === 0. Actual: ' + (x.length));
throw new Test262Error('#1: x = []; x[4294967295] = 1; x.length === 0. Actual: ' + (x.length));
}
//CHECK#2
@ -22,5 +22,5 @@ var y = [];
y[1] = 1;
y[4294967295] = 1;
if (y.length !== 2) {
$ERROR('#2: y = []; y[1] = 1; y[4294967295] = 1; y.length === 2. Actual: ' + (y.length));
throw new Test262Error('#2: y = []; y[1] = 1; y[4294967295] = 1; y.length === 2. Actual: ' + (y.length));
}

View File

@ -12,23 +12,23 @@ description: Checking length property
//CHECK#1
var x = [];
if (x.length !== 0) {
$ERROR('#1: x = []; x.length === 0. Actual: ' + (x.length));
throw new Test262Error('#1: x = []; x.length === 0. Actual: ' + (x.length));
}
//CHECK#2
x[0] = 1;
if (x.length !== 1) {
$ERROR('#2: x = []; x[1] = 1; x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#2: x = []; x[1] = 1; x.length === 1. Actual: ' + (x.length));
}
//CHECK#3
x[1] = 1;
if (x.length !== 2) {
$ERROR('#3: x = []; x[0] = 1; x[1] = 1; x.length === 2. Actual: ' + (x.length));
throw new Test262Error('#3: x = []; x[0] = 1; x[1] = 1; x.length === 2. Actual: ' + (x.length));
}
//CHECK#4
x[9] = 1;
if (x.length !== 10) {
$ERROR('#4: x = []; x[0] = 1; x[1] = 1; x[9] = 1; x.length === 10. Actual: ' + (x.length));
throw new Test262Error('#4: x = []; x[0] = 1; x[1] = 1; x[9] = 1; x.length === 10. Actual: ' + (x.length));
}

View File

@ -15,17 +15,17 @@ description: >
var x = [];
x.length = 1;
if (x.length !== 1) {
$ERROR('#1: x = []; x.length = 1; x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#1: x = []; x.length = 1; x.length === 1. Actual: ' + (x.length));
}
//CHECK#2
x[5] = 1;
x.length = 10;
if (x.length !== 10) {
$ERROR('#2: x = []; x.length = 1; x[5] = 1; x.length = 10; x.length === 10. Actual: ' + (x.length));
throw new Test262Error('#2: x = []; x.length = 1; x[5] = 1; x.length = 10; x.length === 10. Actual: ' + (x.length));
}
//CHECK#3
if (x[5] !== 1) {
$ERROR('#3: x = []; x.length = 1; x[5] = 1; x.length = 10; x[5] = 1');
throw new Test262Error('#3: x = []; x.length = 1; x[5] = 1; x.length = 10; x[5] = 1');
}

View File

@ -18,33 +18,33 @@ x[3] = 3;
x[5] = 5;
x.length = 4;
if (x.length !== 4) {
$ERROR('#1: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x.length === 4. Actual: ' + (x.length));
throw new Test262Error('#1: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x.length === 4. Actual: ' + (x.length));
}
//CHECK#2
if (x[5] !== undefined) {
$ERROR('#2: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x[5] === undefined. Actual: ' + (x[5]));
throw new Test262Error('#2: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x[5] === undefined. Actual: ' + (x[5]));
}
//CHECK#3
if (x[3] !== 3) {
$ERROR('#3: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x[3] === 3. Actual: ' + (x[3]));
throw new Test262Error('#3: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x[3] === 3. Actual: ' + (x[3]));
}
//CHECK#4
x.length = new Number(6);
if (x[5] !== undefined) {
$ERROR('#4: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x.length = new Number(6); x[5] === undefined. Actual: ' + (x[5]));
throw new Test262Error('#4: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x.length = new Number(6); x[5] === undefined. Actual: ' + (x[5]));
}
//CHECK#5
x.length = 0;
if (x[0] !== undefined) {
$ERROR('#5: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x.length = new Number(6); x.length = 0; x[0] === undefined. Actual: ' + (x[0]));
throw new Test262Error('#5: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x.length = new Number(6); x.length = 0; x[0] === undefined. Actual: ' + (x[0]));
}
//CHECK#6
x.length = 1;
if (x[1] !== undefined) {
$ERROR('#6: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x.length = new Number(6); x.length = 0; x.length = 1; x[1] === undefined. Actual: ' + (x[1]));
throw new Test262Error('#6: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x.length = new Number(6); x.length = 0; x.length = 1; x[1] === undefined. Actual: ' + (x[1]));
}

View File

@ -13,16 +13,16 @@ description: "[[Put]] (length, 4294967296)"
var x = [];
x.length = 4294967295;
if (x.length !== 4294967295) {
$ERROR('#1: x = []; x.length = 4294967295; x.length === 4294967295');
throw new Test262Error('#1: x = []; x.length = 4294967295; x.length === 4294967295');
}
//CHECK#2
try {
x = [];
x.length = 4294967296;
$ERROR('#2.1: x = []; x.length = 4294967296 throw RangeError. Actual: x.length === ' + (x.length));
throw new Test262Error('#2.1: x = []; x.length = 4294967296 throw RangeError. Actual: x.length === ' + (x.length));
} catch (e) {
if ((e instanceof RangeError) !== true) {
$ERROR('#2.2: x = []; x.length = 4294967296 throw RangeError. Actual: ' + (e));
throw new Test262Error('#2.2: x = []; x.length = 4294967296 throw RangeError. Actual: ' + (e));
}
}

View File

@ -21,6 +21,6 @@ k = 1;
for (i = 0; i < 32; i++) {
k = k * 2;
if (x[k - 2] !== k) {
$ERROR('#' + (k - 2) + ': ');
throw new Test262Error('#' + (k - 2) + ': ');
}
}

View File

@ -13,12 +13,12 @@ description: Checking for string primitive
var x = [];
x["0"] = 0;
if (x[0] !== 0) {
$ERROR('#1: x = []; x["0"] = 0; x[0] === 0. Actual: ' + (x[0]));
throw new Test262Error('#1: x = []; x["0"] = 0; x[0] === 0. Actual: ' + (x[0]));
}
//CHECK#2
var y = [];
y["1"] = 1;
if (y[1] !== 1) {
$ERROR('#2: y = []; y["1"] = 1; y[1] === 1. Actual: ' + (y[1]));
throw new Test262Error('#2: y = []; y["1"] = 1; y[1] === 1. Actual: ' + (y[1]));
}

View File

@ -13,22 +13,22 @@ description: Checking for null and undefined
var x = [];
x[null] = 0;
if (x[0] !== undefined) {
$ERROR('#1: x = []; x[null] = 1; x[0] === undefined. Actual: ' + (x[0]));
throw new Test262Error('#1: x = []; x[null] = 1; x[0] === undefined. Actual: ' + (x[0]));
}
//CHECK#2
if (x["null"] !== 0) {
$ERROR('#2: x = []; x[null] = 1; x["null"] === 0. Actual: ' + (x["null"]));
throw new Test262Error('#2: x = []; x[null] = 1; x["null"] === 0. Actual: ' + (x["null"]));
}
//CHECK#3
var y = [];
y[undefined] = 0;
if (y[0] !== undefined) {
$ERROR('#3: y = []; y[undefined] = 0; y[0] === undefined. Actual: ' + (y[0]));
throw new Test262Error('#3: y = []; y[undefined] = 0; y[0] === undefined. Actual: ' + (y[0]));
}
//CHECK#4
if (y["undefined"] !== 0) {
$ERROR('#4: y = []; y[undefined] = 1; y["undefined"] === 0. Actual: ' + (y["undefined"]));
throw new Test262Error('#4: y = []; y[undefined] = 1; y["undefined"] === 0. Actual: ' + (y["undefined"]));
}

View File

@ -13,21 +13,21 @@ description: Checking for Boolean object
var x = [];
x[new Boolean(true)] = 1;
if (x[1] !== undefined) {
$ERROR('#1: x = []; x[new Boolean(true)] = 1; x[1] === undefined. Actual: ' + (x[1]));
throw new Test262Error('#1: x = []; x[new Boolean(true)] = 1; x[1] === undefined. Actual: ' + (x[1]));
}
//CHECK#2
if (x["true"] !== 1) {
$ERROR('#2: x = []; x[true] = 1; x["true"] === 1. Actual: ' + (x["true"]));
throw new Test262Error('#2: x = []; x[true] = 1; x["true"] === 1. Actual: ' + (x["true"]));
}
//CHECK#3
x[new Boolean(false)] = 0;
if (x[0] !== undefined) {
$ERROR('#3: x = []; x[true] = 1; x[new Boolean(false)] = 0; x[0] === undefined. Actual: ' + (x[0]));
throw new Test262Error('#3: x = []; x[true] = 1; x[new Boolean(false)] = 0; x[0] === undefined. Actual: ' + (x[0]));
}
//CHECK#4
if (x["false"] !== 0) {
$ERROR('#4: x = []; x[false] = 1; x["false"] === 0. Actual: ' + (x["false"]));
throw new Test262Error('#4: x = []; x[false] = 1; x["false"] === 0. Actual: ' + (x["false"]));
}

View File

@ -13,19 +13,19 @@ description: Checking for Number object
var x = [];
x[new Number(0)] = 0;
if (x[0] !== 0) {
$ERROR('#1: x = []; x[new Number(0)] = 0; x[0] === 0. Actual: ' + (x[0]));
throw new Test262Error('#1: x = []; x[new Number(0)] = 0; x[0] === 0. Actual: ' + (x[0]));
}
//CHECK#2
var y = [];
y[new Number(1)] = 1;
if (y[1] !== 1) {
$ERROR('#2: y = []; y[new Number(1)] = 1; y[1] === 1. Actual: ' + (y[1]));
throw new Test262Error('#2: y = []; y[new Number(1)] = 1; y[1] === 1. Actual: ' + (y[1]));
}
//CHECK#3
var z = [];
z[new Number(1.1)] = 1;
if (z["1.1"] !== 1) {
$ERROR('#3: z = []; z[new Number(1.1)] = 1; z["1.1"] === 1. Actual: ' + (z["1.1"]));
throw new Test262Error('#3: z = []; z[new Number(1.1)] = 1; z["1.1"] === 1. Actual: ' + (z["1.1"]));
}

View File

@ -13,19 +13,19 @@ description: Checking for Number object
var x = [];
x[new String("0")] = 0;
if (x[0] !== 0) {
$ERROR('#1: x = []; x[new String("0")] = 0; x[0] === 0. Actual: ' + (x[0]));
throw new Test262Error('#1: x = []; x[new String("0")] = 0; x[0] === 0. Actual: ' + (x[0]));
}
//CHECK#2
var y = [];
y[new String("1")] = 1;
if (y[1] !== 1) {
$ERROR('#2: y = []; y[new String("1")] = 1; y[1] === 1. Actual: ' + (y[1]));
throw new Test262Error('#2: y = []; y[new String("1")] = 1; y[1] === 1. Actual: ' + (y[1]));
}
//CHECK#3
var z = [];
z[new String("1.1")] = 1;
if (z["1.1"] !== 1) {
$ERROR('#3: z = []; z[new String("1.1")] = 1; z["1.1"] === 1. Actual: ' + (z["1.1"]));
throw new Test262Error('#3: z = []; z[new String("1.1")] = 1; z["1.1"] === 1. Actual: ' + (z["1.1"]));
}

View File

@ -18,7 +18,7 @@ var object = {
};
x[object] = 0;
if (x["[object Object]"] !== 0) {
$ERROR('#1: x = []; var object = {valueOf: function() {return 1}}; x[object] = 0; x["[object Object]"] === 0. Actual: ' + (x["[object Object]"]));
throw new Test262Error('#1: x = []; var object = {valueOf: function() {return 1}}; x[object] = 0; x["[object Object]"] === 0. Actual: ' + (x["[object Object]"]));
}
//CHECK#2
@ -33,7 +33,7 @@ var object = {
};
x[object] = 0;
if (x[0] !== 0) {
$ERROR('#2: x = []; var object = {valueOf: function() {return 1}, toString: function() {return 0}}; x[object] = 0; x[0] === 0. Actual: ' + (x[0]));
throw new Test262Error('#2: x = []; var object = {valueOf: function() {return 1}, toString: function() {return 0}}; x[object] = 0; x[0] === 0. Actual: ' + (x[0]));
}
//CHECK#3
@ -48,7 +48,7 @@ var object = {
};
x[object] = 0;
if (x[1] !== 0) {
$ERROR('#3: x = []; var object = {valueOf: function() {return 1}, toString: function() {return {}}}; x[object] = 0; x[1] === 0. Actual: ' + (x[1]));
throw new Test262Error('#3: x = []; var object = {valueOf: function() {return 1}, toString: function() {return {}}}; x[object] = 0; x[1] === 0. Actual: ' + (x[1]));
}
//CHECK#4
@ -64,14 +64,14 @@ try {
};
x[object] = 0;
if (x[1] !== 0) {
$ERROR('#4.1: x = []; var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x[object] = 0; x[1] === 1. Actual: ' + (x[1]));
throw new Test262Error('#4.1: x = []; var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x[object] = 0; x[1] === 1. Actual: ' + (x[1]));
}
}
catch (e) {
if (e === "error") {
$ERROR('#4.2: x = []; var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x[object] = 0; x[1] === 1. Actual: ' + ("error"));
throw new Test262Error('#4.2: x = []; var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x[object] = 0; x[1] === 1. Actual: ' + ("error"));
} else {
$ERROR('#4.3: x = []; var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x[object] = 0; x[1] === 1. Actual: ' + (e));
throw new Test262Error('#4.3: x = []; var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x[object] = 0; x[1] === 1. Actual: ' + (e));
}
}
@ -84,7 +84,7 @@ var object = {
};
x[object] = 0;
if (x[1] !== 0) {
$ERROR('#5: x = []; var object = {toString: function() {return 1}}; x[object] = 0; x[1] === 0. Actual: ' + (x[1]));
throw new Test262Error('#5: x = []; var object = {toString: function() {return 1}}; x[object] = 0; x[1] === 0. Actual: ' + (x[1]));
}
//CHECK#6
@ -99,7 +99,7 @@ var object = {
}
x[object] = 0;
if (x[1] !== 0) {
$ERROR('#6: x = []; var object = {valueOf: function() {return {}}, toString: function() {return 1}}; x[object] = 0; x[1] === 0. Actual: ' + (x[1]));
throw new Test262Error('#6: x = []; var object = {valueOf: function() {return {}}, toString: function() {return 1}}; x[object] = 0; x[1] === 0. Actual: ' + (x[1]));
}
//CHECK#7
@ -114,11 +114,11 @@ try {
}
};
x[object];
$ERROR('#7.1: x = []; var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; x[object] throw "error". Actual: ' + (x[object]));
throw new Test262Error('#7.1: x = []; var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; x[object] throw "error". Actual: ' + (x[object]));
}
catch (e) {
if (e !== "error") {
$ERROR('#7.2: x = []; var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; x[object] throw "error". Actual: ' + (e));
throw new Test262Error('#7.2: x = []; var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; x[object] throw "error". Actual: ' + (e));
}
}
@ -134,10 +134,10 @@ try {
}
};
x[object];
$ERROR('#8.1: x = []; var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x[object] throw TypeError. Actual: ' + (x[object]));
throw new Test262Error('#8.1: x = []; var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x[object] throw TypeError. Actual: ' + (x[object]));
}
catch (e) {
if ((e instanceof TypeError) !== true) {
$ERROR('#8.2: x = []; var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x[object] throw TypeError. Actual: ' + (e));
throw new Test262Error('#8.2: x = []; var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x[object] throw TypeError. Actual: ' + (e));
}
}

View File

@ -17,5 +17,5 @@ description: >
Array.prototype.myproperty = 1;
var x = new Array(0);
if (x.myproperty !== 1) {
$ERROR('#1: Array.prototype.myproperty = 1; var x = new Array(0); x.myproperty === 1. Actual: ' + (x.myproperty));
throw new Test262Error('#1: Array.prototype.myproperty = 1; var x = new Array(0); x.myproperty === 1. Actual: ' + (x.myproperty));
}

View File

@ -15,5 +15,5 @@ description: Array.prototype.toString = Object.prototype.toString
Array.prototype.toString = Object.prototype.toString;
var x = new Array(0);
if (x.toString() !== "[object " + "Array" + "]") {
$ERROR('#1: Array.prototype.toString = Object.prototype.toString; var x = new Array(0); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString()));
throw new Test262Error('#1: Array.prototype.toString = Object.prototype.toString; var x = new Array(0); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString()));
}

View File

@ -13,5 +13,5 @@ description: Checking use isPrototypeOf
//CHECK#1
if (Array.prototype.isPrototypeOf(new Array(0)) !== true) {
$ERROR('#1: Array.prototype.isPrototypeOf(new Array(0)) === true. Actual: ' + (Array.prototype.isPrototypeOf(new Array(0))));
throw new Test262Error('#1: Array.prototype.isPrototypeOf(new Array(0)) === true. Actual: ' + (Array.prototype.isPrototypeOf(new Array(0))));
}

View File

@ -12,5 +12,5 @@ description: Checking use Object.prototype.toString
var x = new Array(0);
x.getClass = Object.prototype.toString;
if (x.getClass() !== "[object " + "Array" + "]") {
$ERROR('#1: var x = new Array(0); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass()));
throw new Test262Error('#1: var x = new Array(0); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass()));
}

View File

@ -13,17 +13,17 @@ description: Array constructor is given one argument
//CHECK#1
var x = new Array(0);
if (x.length !== 0) {
$ERROR('#1: var x = new Array(0); x.length === 0. Actual: ' + (x.length));
throw new Test262Error('#1: var x = new Array(0); x.length === 0. Actual: ' + (x.length));
}
//CHECK#2
var x = new Array(1);
if (x.length !== 1) {
$ERROR('#2: var x = new Array(1); x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#2: var x = new Array(1); x.length === 1. Actual: ' + (x.length));
}
//CHECK#3
var x = new Array(4294967295);
if (x.length !== 4294967295) {
$ERROR('#3: var x = new Array(4294967295); x.length === 4294967295. Actual: ' + (x.length));
throw new Test262Error('#3: var x = new Array(4294967295); x.length === 4294967295. Actual: ' + (x.length));
}

View File

@ -13,29 +13,29 @@ description: Use try statement. len = -1, 4294967296, 4294967297
//CHECK#1
try {
new Array(-1);
$ERROR('#1.1: new Array(-1) throw RangeError. Actual: ' + (new Array(-1)));
throw new Test262Error('#1.1: new Array(-1) throw RangeError. Actual: ' + (new Array(-1)));
} catch (e) {
if ((e instanceof RangeError) !== true) {
$ERROR('#1.2: new Array(-1) throw RangeError. Actual: ' + (e));
throw new Test262Error('#1.2: new Array(-1) throw RangeError. Actual: ' + (e));
}
}
//CHECK#2
try {
new Array(4294967296);
$ERROR('#2.1: new Array(4294967296) throw RangeError. Actual: ' + (new Array(4294967296)));
throw new Test262Error('#2.1: new Array(4294967296) throw RangeError. Actual: ' + (new Array(4294967296)));
} catch (e) {
if ((e instanceof RangeError) !== true) {
$ERROR('#2.2: new Array(4294967296) throw RangeError. Actual: ' + (e));
throw new Test262Error('#2.2: new Array(4294967296) throw RangeError. Actual: ' + (e));
}
}
//CHECK#3
try {
new Array(4294967297);
$ERROR('#3.1: new Array(4294967297) throw RangeError. Actual: ' + (new Array(4294967297)));
throw new Test262Error('#3.1: new Array(4294967297) throw RangeError. Actual: ' + (new Array(4294967297)));
} catch (e) {
if ((e instanceof RangeError) !== true) {
$ERROR('#3.2: new Array(4294967297) throw RangeError. Actual: ' + (e));
throw new Test262Error('#3.2: new Array(4294967297) throw RangeError. Actual: ' + (e));
}
}

View File

@ -13,29 +13,29 @@ description: Use try statement. len = NaN, +/-Infinity
//CHECK#1
try {
new Array(NaN);
$ERROR('#1.1: new Array(NaN) throw RangeError. Actual: ' + (new Array(NaN)));
throw new Test262Error('#1.1: new Array(NaN) throw RangeError. Actual: ' + (new Array(NaN)));
} catch (e) {
if ((e instanceof RangeError) !== true) {
$ERROR('#1.2: new Array(NaN) throw RangeError. Actual: ' + (e));
throw new Test262Error('#1.2: new Array(NaN) throw RangeError. Actual: ' + (e));
}
}
//CHECK#2
try {
new Array(Number.POSITIVE_INFINITY);
$ERROR('#2.1: new Array(Number.POSITIVE_INFINITY) throw RangeError. Actual: ' + (new Array(Number.POSITIVE_INFINITY)));
throw new Test262Error('#2.1: new Array(Number.POSITIVE_INFINITY) throw RangeError. Actual: ' + (new Array(Number.POSITIVE_INFINITY)));
} catch (e) {
if ((e instanceof RangeError) !== true) {
$ERROR('#2.2: new Array(Number.POSITIVE_INFINITY) throw RangeError. Actual: ' + (e));
throw new Test262Error('#2.2: new Array(Number.POSITIVE_INFINITY) throw RangeError. Actual: ' + (e));
}
}
//CHECK#3
try {
new Array(Number.NEGATIVE_INFINITY);
$ERROR('#3.1: new Array(Number.NEGATIVE_INFINITY) throw RangeError. Actual: ' + (new Array(Number.NEGATIVE_INFINITY)));
throw new Test262Error('#3.1: new Array(Number.NEGATIVE_INFINITY) throw RangeError. Actual: ' + (new Array(Number.NEGATIVE_INFINITY)));
} catch (e) {
if ((e instanceof RangeError) !== true) {
$ERROR('#3.2: new Array(Number.NEGATIVE_INFINITY) throw RangeError. Actual: ' + (e));
throw new Test262Error('#3.2: new Array(Number.NEGATIVE_INFINITY) throw RangeError. Actual: ' + (e));
}
}

View File

@ -13,29 +13,29 @@ description: Use try statement. len = 1.5, Number.MAX_VALUE, Number.MIN_VALUE
//CHECK#1
try {
new Array(1.5);
$ERROR('#1.1: new Array(1.5) throw RangeError. Actual: ' + (new Array(1.5)));
throw new Test262Error('#1.1: new Array(1.5) throw RangeError. Actual: ' + (new Array(1.5)));
} catch (e) {
if ((e instanceof RangeError) !== true) {
$ERROR('#1.2: new Array(1.5) throw RangeError. Actual: ' + (e));
throw new Test262Error('#1.2: new Array(1.5) throw RangeError. Actual: ' + (e));
}
}
//CHECK#2
try {
new Array(Number.MAX_VALUE);
$ERROR('#2.1: new Array(Number.MAX_VALUE) throw RangeError. Actual: ' + (new Array(Number.MAX_VALUE)));
throw new Test262Error('#2.1: new Array(Number.MAX_VALUE) throw RangeError. Actual: ' + (new Array(Number.MAX_VALUE)));
} catch (e) {
if ((e instanceof RangeError) !== true) {
$ERROR('#2.2: new Array(Number.MAX_VALUE) throw RangeError. Actual: ' + (e));
throw new Test262Error('#2.2: new Array(Number.MAX_VALUE) throw RangeError. Actual: ' + (e));
}
}
//CHECK#3
try {
new Array(Number.MIN_VALUE);
$ERROR('#3.1: new Array(Number.MIN_VALUE) throw RangeError. Actual: ' + (new Array(Number.MIN_VALUE)));
throw new Test262Error('#3.1: new Array(Number.MIN_VALUE) throw RangeError. Actual: ' + (new Array(Number.MIN_VALUE)));
} catch (e) {
if ((e instanceof RangeError) !== true) {
$ERROR('#3.2: new Array(Number.MIN_VALUE) throw RangeError. Actual: ' + (e));
throw new Test262Error('#3.2: new Array(Number.MIN_VALUE) throw RangeError. Actual: ' + (e));
}
}

View File

@ -15,22 +15,22 @@ var x = new Array(null);
//CHECK#1
if (x.length !== 1) {
$ERROR('#1: var x = new Array(null); x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#1: var x = new Array(null); x.length === 1. Actual: ' + (x.length));
}
//CHECK#2
if (x[0] !== null) {
$ERROR('#2: var x = new Array(null); x[0] === null. Actual: ' + (x[0]));
throw new Test262Error('#2: var x = new Array(null); x[0] === null. Actual: ' + (x[0]));
}
var x = new Array(undefined);
//CHECK#3
if (x.length !== 1) {
$ERROR('#3: var x = new Array(undefined); x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#3: var x = new Array(undefined); x.length === 1. Actual: ' + (x.length));
}
//CHECK#4
if (x[0] !== undefined) {
$ERROR('#4: var x = new Array(undefined); x[0] === undefined. Actual: ' + (x[0]));
throw new Test262Error('#4: var x = new Array(undefined); x[0] === undefined. Actual: ' + (x[0]));
}

View File

@ -15,12 +15,12 @@ var x = new Array(true);
//CHECK#1
if (x.length !== 1) {
$ERROR('#1: var x = new Array(true); x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#1: var x = new Array(true); x.length === 1. Actual: ' + (x.length));
}
//CHECK#2
if (x[0] !== true) {
$ERROR('#2: var x = new Array(true); x[0] === true. Actual: ' + (x[0]));
throw new Test262Error('#2: var x = new Array(true); x[0] === true. Actual: ' + (x[0]));
}
var obj = new Boolean(false);
@ -28,10 +28,10 @@ var x = new Array(obj);
//CHECK#3
if (x.length !== 1) {
$ERROR('#3: var obj = new Boolean(false); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#3: var obj = new Boolean(false); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
}
//CHECK#4
if (x[0] !== obj) {
$ERROR('#4: var obj = new Boolean(false); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0]));
throw new Test262Error('#4: var obj = new Boolean(false); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0]));
}

View File

@ -15,12 +15,12 @@ var x = new Array("1");
//CHECK#1
if (x.length !== 1) {
$ERROR('#1: var x = new Array("1"); x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#1: var x = new Array("1"); x.length === 1. Actual: ' + (x.length));
}
//CHECK#2
if (x[0] !== "1") {
$ERROR('#2: var x = new Array("1"); x[0] === "1". Actual: ' + (x[0]));
throw new Test262Error('#2: var x = new Array("1"); x[0] === "1". Actual: ' + (x[0]));
}
var obj = new String("0");
@ -28,10 +28,10 @@ var x = new Array(obj);
//CHECK#3
if (x.length !== 1) {
$ERROR('#3: var obj = new String("0"); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#3: var obj = new String("0"); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
}
//CHECK#4
if (x[0] !== obj) {
$ERROR('#4: var obj = new String("0"); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0]));
throw new Test262Error('#4: var obj = new String("0"); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0]));
}

View File

@ -16,12 +16,12 @@ var x = new Array(obj);
//CHECK#1
if (x.length !== 1) {
$ERROR('#1: var obj = new Number(0); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#1: var obj = new Number(0); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
}
//CHECK#2
if (x[0] !== obj) {
$ERROR('#2: var obj = new Number(0); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0]));
throw new Test262Error('#2: var obj = new Number(0); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0]));
}
var obj = new Number(1);
@ -29,12 +29,12 @@ var x = new Array(obj);
//CHECK#3
if (x.length !== 1) {
$ERROR('#3: var obj = new Number(1); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#3: var obj = new Number(1); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
}
//CHECK#4
if (x[0] !== obj) {
$ERROR('#4: var obj = new Number(1); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0]));
throw new Test262Error('#4: var obj = new Number(1); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0]));
}
var obj = new Number(4294967295);
@ -42,10 +42,10 @@ var x = new Array(obj);
//CHECK#5
if (x.length !== 1) {
$ERROR('#5: var obj = new Number(4294967295); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#5: var obj = new Number(4294967295); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
}
//CHECK#6
if (x[0] !== obj) {
$ERROR('#6: var obj = new Number(4294967295); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0]));
throw new Test262Error('#6: var obj = new Number(4294967295); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0]));
}

View File

@ -16,12 +16,12 @@ var x = new Array(obj);
//CHECK#1
if (x.length !== 1) {
$ERROR('#1: var obj = new Number(-1); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#1: var obj = new Number(-1); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
}
//CHECK#2
if (x[0] !== obj) {
$ERROR('#2: var obj = new Number(-1); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0]));
throw new Test262Error('#2: var obj = new Number(-1); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0]));
}
var obj = new Number(4294967296);
@ -29,12 +29,12 @@ var x = new Array(obj);
//CHECK#3
if (x.length !== 1) {
$ERROR('#3: var obj = new Number(4294967296); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#3: var obj = new Number(4294967296); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
}
//CHECK#4
if (x[0] !== obj) {
$ERROR('#4: var obj = new Number(4294967296); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0]));
throw new Test262Error('#4: var obj = new Number(4294967296); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0]));
}
var obj = new Number(4294967297);
@ -42,10 +42,10 @@ var x = new Array(obj);
//CHECK#5
if (x.length !== 1) {
$ERROR('#5: var obj = new Number(4294967297); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#5: var obj = new Number(4294967297); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
}
//CHECK#6
if (x[0] !== obj) {
$ERROR('#6: var obj = new Number(4294967297); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0]));
throw new Test262Error('#6: var obj = new Number(4294967297); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0]));
}

View File

@ -10,5 +10,5 @@ description: Array.prototype.length === 0
//CHECK#1
if (Array.prototype.length !== 0) {
$ERROR('#1.1: Array.prototype.length === 0. Actual: ' + (Array.prototype.length));
throw new Test262Error('#1.1: Array.prototype.length === 0. Actual: ' + (Array.prototype.length));
}

View File

@ -12,10 +12,10 @@ description: length in [4294967296, -1, 1.5]
try {
var x = [];
x.length = 4294967296;
$ERROR('#1.1: x = []; x.length = 4294967296 throw RangeError. Actual: x.length === ' + (x.length));
throw new Test262Error('#1.1: x = []; x.length = 4294967296 throw RangeError. Actual: x.length === ' + (x.length));
} catch (e) {
if ((e instanceof RangeError) !== true) {
$ERROR('#1.2: x = []; x.length = 4294967296 throw RangeError. Actual: ' + (e));
throw new Test262Error('#1.2: x = []; x.length = 4294967296 throw RangeError. Actual: ' + (e));
}
}
@ -23,10 +23,10 @@ try {
try {
x = [];
x.length = -1;
$ERROR('#2.1: x = []; x.length = -1 throw RangeError. Actual: x.length === ' + (x.length));
throw new Test262Error('#2.1: x = []; x.length = -1 throw RangeError. Actual: x.length === ' + (x.length));
} catch (e) {
if ((e instanceof RangeError) !== true) {
$ERROR('#2.2: x = []; x.length = -1 throw RangeError. Actual: ' + (e));
throw new Test262Error('#2.2: x = []; x.length = -1 throw RangeError. Actual: ' + (e));
}
}
@ -34,9 +34,9 @@ try {
try {
x = [];
x.length = 1.5;
$ERROR('#3.1: x = []; x.length = 1.5 throw RangeError. Actual: x.length === ' + (x.length));
throw new Test262Error('#3.1: x = []; x.length = 1.5 throw RangeError. Actual: x.length === ' + (x.length));
} catch (e) {
if ((e instanceof RangeError) !== true) {
$ERROR('#3.2: x = []; x.length = 1.5 throw RangeError. Actual: ' + (e));
throw new Test262Error('#3.2: x = []; x.length = 1.5 throw RangeError. Actual: ' + (e));
}
}

View File

@ -12,10 +12,10 @@ description: length in [NaN, Infinity, -Infinity, undefined]
try {
var x = [];
x.length = NaN;
$ERROR('#1.1: x = []; x.length = NaN throw RangeError. Actual: x.length === ' + (x.length));
throw new Test262Error('#1.1: x = []; x.length = NaN throw RangeError. Actual: x.length === ' + (x.length));
} catch (e) {
if ((e instanceof RangeError) !== true) {
$ERROR('#1.2: x = []; x.length = NaN throw RangeError. Actual: ' + (e));
throw new Test262Error('#1.2: x = []; x.length = NaN throw RangeError. Actual: ' + (e));
}
}
@ -23,10 +23,10 @@ try {
try {
x = [];
x.length = Number.POSITIVE_INFINITY;
$ERROR('#2.1: x = []; x.length = Number.POSITIVE_INFINITY throw RangeError. Actual: x.length === ' + (x.length));
throw new Test262Error('#2.1: x = []; x.length = Number.POSITIVE_INFINITY throw RangeError. Actual: x.length === ' + (x.length));
} catch (e) {
if ((e instanceof RangeError) !== true) {
$ERROR('#2.2: x = []; x.length = Number.POSITIVE_INFINITY throw RangeError. Actual: ' + (e));
throw new Test262Error('#2.2: x = []; x.length = Number.POSITIVE_INFINITY throw RangeError. Actual: ' + (e));
}
}
@ -34,10 +34,10 @@ try {
try {
x = [];
x.length = Number.NEGATIVE_INFINITY;
$ERROR('#3.1: x = []; x.length = Number.NEGATIVE_INFINITY throw RangeError. Actual: x.length === ' + (x.length));
throw new Test262Error('#3.1: x = []; x.length = Number.NEGATIVE_INFINITY throw RangeError. Actual: x.length === ' + (x.length));
} catch (e) {
if ((e instanceof RangeError) !== true) {
$ERROR('#3.2: x = []; x.length = Number.NEGATIVE_INFINITY throw RangeError. Actual: ' + (e));
throw new Test262Error('#3.2: x = []; x.length = Number.NEGATIVE_INFINITY throw RangeError. Actual: ' + (e));
}
}
@ -45,9 +45,9 @@ try {
try {
x = [];
x.length = undefined;
$ERROR('#4.1: x = []; x.length = undefined throw RangeError. Actual: x.length === ' + (x.length));
throw new Test262Error('#4.1: x = []; x.length = undefined throw RangeError. Actual: x.length === ' + (x.length));
} catch (e) {
if ((e instanceof RangeError) !== true) {
$ERROR('#4.2: x = []; x.length = undefined throw RangeError. Actual: ' + (e));
throw new Test262Error('#4.2: x = []; x.length = undefined throw RangeError. Actual: ' + (e));
}
}

View File

@ -16,16 +16,16 @@ description: Change length of array
var x = [0, , 2, , 4];
x.length = 4;
if (x[4] !== undefined) {
$ERROR('#1: x = [0,,2,,4]; x.length = 4; x[4] === undefined. Actual: ' + (x[4]));
throw new Test262Error('#1: x = [0,,2,,4]; x.length = 4; x[4] === undefined. Actual: ' + (x[4]));
}
//CHECK#2
x.length = 3;
if (x[3] !== undefined) {
$ERROR('#2: x = [0,,2,,4]; x.length = 4; x.length = 3; x[3] === undefined. Actual: ' + (x[3]));
throw new Test262Error('#2: x = [0,,2,,4]; x.length = 4; x.length = 3; x[3] === undefined. Actual: ' + (x[3]));
}
//CHECK#3
if (x[2] !== 2) {
$ERROR('#3: x = [0,,2,,4]; x.length = 4; x.length = 3; x[2] === 2. Actual: ' + (x[2]));
throw new Test262Error('#3: x = [0,,2,,4]; x.length = 4; x.length = 3; x[2] === 2. Actual: ' + (x[2]));
}

View File

@ -17,11 +17,11 @@ Array.prototype[2] = 2;
var x = [0, 1];
x.length = 3;
if (x.hasOwnProperty('2') !== false) {
$ERROR('#1: Array.prototype[2] = 2; x = [0,1]; x.length = 3; x.hasOwnProperty(\'2\') === false. Actual: ' + (x.hasOwnProperty('2')));
throw new Test262Error('#1: Array.prototype[2] = 2; x = [0,1]; x.length = 3; x.hasOwnProperty(\'2\') === false. Actual: ' + (x.hasOwnProperty('2')));
}
//CHECK#2
x.length = 2;
if (x[2] !== 2) {
$ERROR('#2: Array.prototype[2] = 2; x = [0,1]; x.length = 3; x.length = 2; x[2] === 2. Actual: ' + (x[2]));
throw new Test262Error('#2: Array.prototype[2] = 2; x = [0,1]; x.length = 3; x.length = 2; x[2] === 2. Actual: ' + (x[2]));
}

View File

@ -12,40 +12,40 @@ description: length is object or primitve
var x = [];
x.length = true;
if (x.length !== 1) {
$ERROR('#1: x = []; x.length = true; x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#1: x = []; x.length = true; x.length === 1. Actual: ' + (x.length));
}
//CHECK#2
x = [0];
x.length = null;
if (x.length !== 0) {
$ERROR('#2: x = [0]; x.length = null; x.length === 0. Actual: ' + (x.length));
throw new Test262Error('#2: x = [0]; x.length = null; x.length === 0. Actual: ' + (x.length));
}
//CHECK#3
x = [0];
x.length = new Boolean(false);
if (x.length !== 0) {
$ERROR('#3: x = [0]; x.length = new Boolean(false); x.length === 0. Actual: ' + (x.length));
throw new Test262Error('#3: x = [0]; x.length = new Boolean(false); x.length === 0. Actual: ' + (x.length));
}
//CHECK#4
x = [];
x.length = new Number(1);
if (x.length !== 1) {
$ERROR('#4: x = []; x.length = new Number(1); x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#4: x = []; x.length = new Number(1); x.length === 1. Actual: ' + (x.length));
}
//CHECK#5
x = [];
x.length = "1";
if (x.length !== 1) {
$ERROR('#5: x = []; x.length = "1"; x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#5: x = []; x.length = "1"; x.length === 1. Actual: ' + (x.length));
}
//CHECK#6
x = [];
x.length = new String("1");
if (x.length !== 1) {
$ERROR('#6: x = []; x.length = new String("1"); x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#6: x = []; x.length = new String("1"); x.length === 1. Actual: ' + (x.length));
}

View File

@ -16,7 +16,7 @@ x.length = {
}
};
if (x.length !== 2) {
$ERROR('#1: x = []; x.length = {valueOf: function() {return 2}}; x.length === 2. Actual: ' + (x.length));
throw new Test262Error('#1: x = []; x.length = {valueOf: function() {return 2}}; x.length === 2. Actual: ' + (x.length));
}
//CHECK#2
@ -30,7 +30,7 @@ x.length = {
}
};
if (x.length !== 2) {
$ERROR('#0: x = []; x.length = {valueOf: function() {return 2}, toString: function() {return 1}}; x.length === 2. Actual: ' + (x.length));
throw new Test262Error('#0: x = []; x.length = {valueOf: function() {return 2}, toString: function() {return 1}}; x.length === 2. Actual: ' + (x.length));
}
//CHECK#3
@ -44,7 +44,7 @@ x.length = {
}
};
if (x.length !== 2) {
$ERROR('#3: x = []; x.length = {valueOf: function() {return 2}, toString: function() {return {}}}; x.length === 2. Actual: ' + (x.length));
throw new Test262Error('#3: x = []; x.length = {valueOf: function() {return 2}, toString: function() {return {}}}; x.length === 2. Actual: ' + (x.length));
}
//CHECK#4
@ -59,14 +59,14 @@ try {
}
};
if (x.length !== 2) {
$ERROR('#4.1: x = []; x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}}; x.length === ",". Actual: ' + (x.length));
throw new Test262Error('#4.1: x = []; x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}}; x.length === ",". Actual: ' + (x.length));
}
}
catch (e) {
if (e === "error") {
$ERROR('#4.2: x = []; x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}}; x.length not throw "error"');
throw new Test262Error('#4.2: x = []; x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}}; x.length not throw "error"');
} else {
$ERROR('#4.3: x = []; x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}}; x.length not throw Error. Actual: ' + (e));
throw new Test262Error('#4.3: x = []; x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}}; x.length not throw Error. Actual: ' + (e));
}
}
@ -78,7 +78,7 @@ x.length = {
}
};
if (x.length !== 1) {
$ERROR('#5: x = []; x.length = {toString: function() {return 1}}; x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#5: x = []; x.length = {toString: function() {return 1}}; x.length === 1. Actual: ' + (x.length));
}
//CHECK#6
@ -92,7 +92,7 @@ x.length = {
}
}
if (x.length !== 1) {
$ERROR('#6: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return 1}}; x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#6: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return 1}}; x.length === 1. Actual: ' + (x.length));
}
//CHECK#7
@ -107,11 +107,11 @@ try {
}
};
x.length;
$ERROR('#7.1: x = []; x.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x.length throw "error". Actual: ' + (x.length));
throw new Test262Error('#7.1: x = []; x.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x.length throw "error". Actual: ' + (x.length));
}
catch (e) {
if (e !== "error") {
$ERROR('#7.2: x = []; x.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x.length throw "error". Actual: ' + (e));
throw new Test262Error('#7.2: x = []; x.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x.length throw "error". Actual: ' + (e));
}
}
@ -127,10 +127,10 @@ try {
}
};
x.length;
$ERROR('#8.1: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return {}}} x.length throw TypeError. Actual: ' + (x.length));
throw new Test262Error('#8.1: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return {}}} x.length throw TypeError. Actual: ' + (x.length));
}
catch (e) {
if ((e instanceof TypeError) !== true) {
$ERROR('#8.2: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return {}}} x.length throw TypeError. Actual: ' + (e));
throw new Test262Error('#8.2: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return {}}} x.length throw TypeError. Actual: ' + (e));
}
}

View File

@ -19,20 +19,20 @@ x.length = 2;
//CHECK#1
if (x[0] !== 0) {
$ERROR('#1: x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; x[0] === 0. Actual: ' + (x[0]));
throw new Test262Error('#1: x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; x[0] === 0. Actual: ' + (x[0]));
}
//CHECK#2
if (x[1] !== 1) {
$ERROR('#2: x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; x[1] === 1. Actual: ' + (x[1]));
throw new Test262Error('#2: x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; x[1] === 1. Actual: ' + (x[1]));
}
//CHECK#3
if (x[2] !== undefined) {
$ERROR('#3: x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; x[2] === undefined. Actual: ' + (x[2]));
throw new Test262Error('#3: x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; x[2] === undefined. Actual: ' + (x[2]));
}
//CHECK#4
if (x[4294967294] !== undefined) {
$ERROR('#4: x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; x[4294967294] === undefined. Actual: ' + (x[4294967294]));
throw new Test262Error('#4: x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; x[4294967294] === undefined. Actual: ' + (x[4294967294]));
}

View File

@ -11,7 +11,7 @@ info: |
Object.defineProperty(Array.prototype, "0", {
set: function(v) {
$ERROR('Should define own properties');
throw new Test262Error('Should define own properties');
}
});
@ -22,7 +22,7 @@ function Custom() {}
Object.defineProperty(Custom.prototype, "0", {
set: function(v) {
$ERROR('Should define own properties');
throw new Test262Error('Should define own properties');
}
});

View File

@ -17,22 +17,22 @@ assert.sameValue(x["4294967296"], 1, "x['4294967296'] !== 1");
var y = [];
y[4294967297] = 1;
if (y[1] !== undefined) {
$ERROR('#3: y = []; y[4294967297] = 1; y[1] === undefined. Actual: ' + (y[1]));
throw new Test262Error('#3: y = []; y[4294967297] = 1; y[1] === undefined. Actual: ' + (y[1]));
}
//CHECK#4
if (y["4294967297"] !== 1) {
$ERROR('#4: y = []; y[4294967297] = 1; y["4294967297"] === 1. Actual: ' + (y["4294967297"]));
throw new Test262Error('#4: y = []; y[4294967297] = 1; y["4294967297"] === 1. Actual: ' + (y["4294967297"]));
}
//CHECK#5
var z = [];
z[1.1] = 1;
if (z[1] !== undefined) {
$ERROR('#5: z = []; z[1.1] = 1; z[1] === undefined. Actual: ' + (z[1]));
throw new Test262Error('#5: z = []; z[1.1] = 1; z[1] === undefined. Actual: ' + (z[1]));
}
//CHECK#6
if (z["1.1"] !== 1) {
$ERROR('#6: z = []; z[1.1] = 1; z["1.1"] === 1. Actual: ' + (z["1.1"]));
throw new Test262Error('#6: z = []; z[1.1] = 1; z["1.1"] === 1. Actual: ' + (z["1.1"]));
}

View File

@ -19,35 +19,35 @@ var arr = x.concat(y, z);
//CHECK#0
arr.getClass = Object.prototype.toString;
if (arr.getClass() !== "[object " + "Array" + "]") {
$ERROR('#0: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr is Array object. Actual: ' + (arr.getClass()));
throw new Test262Error('#0: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr is Array object. Actual: ' + (arr.getClass()));
}
//CHECK#1
if (arr[0] !== 0) {
$ERROR('#1: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr[0] === 0. Actual: ' + (arr[0]));
throw new Test262Error('#1: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr[0] === 0. Actual: ' + (arr[0]));
}
//CHECK#2
if (arr[1] !== 1) {
$ERROR('#2: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr[1] === 1. Actual: ' + (arr[1]));
throw new Test262Error('#2: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr[1] === 1. Actual: ' + (arr[1]));
}
//CHECK#3
if (arr[2] !== 2) {
$ERROR('#3: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr[2] === 2. Actual: ' + (arr[2]));
throw new Test262Error('#3: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr[2] === 2. Actual: ' + (arr[2]));
}
//CHECK#4
if (arr[3] !== 3) {
$ERROR('#4: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr[3] === 3. Actual: ' + (arr[3]));
throw new Test262Error('#4: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr[3] === 3. Actual: ' + (arr[3]));
}
//CHECK#5
if (arr[4] !== 4) {
$ERROR('#5: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr[4] === 4. Actual: ' + (arr[4]));
throw new Test262Error('#5: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr[4] === 4. Actual: ' + (arr[4]));
}
//CHECK#6
if (arr.length !== 5) {
$ERROR('#6: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr.length === 5. Actual: ' + (arr.length));
throw new Test262Error('#6: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr.length === 5. Actual: ' + (arr.length));
}

View File

@ -19,45 +19,45 @@ var arr = x.concat(y, z, -1, true, "NaN");
//CHECK#0
arr.getClass = Object.prototype.toString;
if (arr.getClass() !== "[object " + "Array" + "]") {
$ERROR('#0: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr is Array object. Actual: ' + (arr.getClass()));
throw new Test262Error('#0: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr is Array object. Actual: ' + (arr.getClass()));
}
//CHECK#1
if (arr[0] !== 0) {
$ERROR('#1: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[0] === 0. Actual: ' + (arr[0]));
throw new Test262Error('#1: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[0] === 0. Actual: ' + (arr[0]));
}
//CHECK#2
if (arr[1] !== y) {
$ERROR('#2: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[1] === y. Actual: ' + (arr[1]));
throw new Test262Error('#2: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[1] === y. Actual: ' + (arr[1]));
}
//CHECK#3
if (arr[2] !== 1) {
$ERROR('#3: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[2] === 1. Actual: ' + (arr[2]));
throw new Test262Error('#3: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[2] === 1. Actual: ' + (arr[2]));
}
//CHECK#4
if (arr[3] !== 2) {
$ERROR('#4: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[3] === 2. Actual: ' + (arr[3]));
throw new Test262Error('#4: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[3] === 2. Actual: ' + (arr[3]));
}
//CHECK#5
if (arr[4] !== -1) {
$ERROR('#5: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[4] === -1. Actual: ' + (arr[4]));
throw new Test262Error('#5: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[4] === -1. Actual: ' + (arr[4]));
}
//CHECK#6
if (arr[5] !== true) {
$ERROR('#6: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[5] === true. Actual: ' + (arr[5]));
throw new Test262Error('#6: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[5] === true. Actual: ' + (arr[5]));
}
//CHECK#7
if (arr[6] !== "NaN") {
$ERROR('#7: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[6] === "NaN". Actual: ' + (arr[6]));
throw new Test262Error('#7: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[6] === "NaN". Actual: ' + (arr[6]));
}
//CHECK#8
if (arr.length !== 7) {
$ERROR('#8: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr.length === 7. Actual: ' + (arr.length));
throw new Test262Error('#8: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr.length === 7. Actual: ' + (arr.length));
}

View File

@ -17,25 +17,25 @@ var arr = x.concat();
//CHECK#0
arr.getClass = Object.prototype.toString;
if (arr.getClass() !== "[object " + "Array" + "]") {
$ERROR('#0: var x = [0,1]; var arr = x.concat(); arr is Array object. Actual: ' + (arr.getClass()));
throw new Test262Error('#0: var x = [0,1]; var arr = x.concat(); arr is Array object. Actual: ' + (arr.getClass()));
}
//CHECK#1
if (arr[0] !== 0) {
$ERROR('#1: var x = [0,1]; var arr = x.concat(); arr[0] === 0. Actual: ' + (arr[0]));
throw new Test262Error('#1: var x = [0,1]; var arr = x.concat(); arr[0] === 0. Actual: ' + (arr[0]));
}
//CHECK#2
if (arr[1] !== 1) {
$ERROR('#2: var x = [0,1]; var arr = x.concat(); arr[1] === 1. Actual: ' + (arr[1]));
throw new Test262Error('#2: var x = [0,1]; var arr = x.concat(); arr[1] === 1. Actual: ' + (arr[1]));
}
//CHECK#3
if (arr.length !== 2) {
$ERROR('#3: var x = [0,1]; var arr = x.concat(); arr.length === 2. Actual: ' + (arr.length));
throw new Test262Error('#3: var x = [0,1]; var arr = x.concat(); arr.length === 2. Actual: ' + (arr.length));
}
//CHECK#4
if (arr === x) {
$ERROR('#4: var x = [0,1]; var arr = x.concat(); arr !== x');
throw new Test262Error('#4: var x = [0,1]; var arr = x.concat(); arr !== x');
}

View File

@ -17,25 +17,25 @@ var arr = x.concat([], [, ]);
//CHECK#0
arr.getClass = Object.prototype.toString;
if (arr.getClass() !== "[object " + "Array" + "]") {
$ERROR('#0: var x = [,1]; var arr = x.concat([], [,]); arr is Array object. Actual: ' + (arr.getClass()));
throw new Test262Error('#0: var x = [,1]; var arr = x.concat([], [,]); arr is Array object. Actual: ' + (arr.getClass()));
}
//CHECK#1
if (arr[0] !== undefined) {
$ERROR('#1: var x = [,1]; var arr = x.concat([], [,]); arr[0] === undefined. Actual: ' + (arr[0]));
throw new Test262Error('#1: var x = [,1]; var arr = x.concat([], [,]); arr[0] === undefined. Actual: ' + (arr[0]));
}
//CHECK#2
if (arr[1] !== 1) {
$ERROR('#2: var x = [,1]; var arr = x.concat([], [,]); arr[1] === 1. Actual: ' + (arr[1]));
throw new Test262Error('#2: var x = [,1]; var arr = x.concat([], [,]); arr[1] === 1. Actual: ' + (arr[1]));
}
//CHECK#2
if (arr[2] !== undefined) {
$ERROR('#2: var x = [,1]; var arr = x.concat([], [,]); arr[2] === undefined. Actual: ' + (arr[2]));
throw new Test262Error('#2: var x = [,1]; var arr = x.concat([], [,]); arr[2] === undefined. Actual: ' + (arr[2]));
}
//CHECK#4
if (arr.length !== 3) {
$ERROR('#4: var x = [,1]; var arr = x.concat([], [,]); arr.length === 3. Actual: ' + (arr.length));
throw new Test262Error('#4: var x = [,1]; var arr = x.concat([], [,]); arr.length === 3. Actual: ' + (arr.length));
}

View File

@ -19,45 +19,45 @@ var arr = x.concat(y, z, -1, true, "NaN");
//CHECK#0
arr.getClass = Object.prototype.toString;
if (arr.getClass() !== "[object " + "Array" + "]") {
$ERROR('#0: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr is Array object. Actual: ' + (arr.getClass()));
throw new Test262Error('#0: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr is Array object. Actual: ' + (arr.getClass()));
}
//CHECK#1
if (arr[0] !== x) {
$ERROR('#1: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[0] === x. Actual: ' + (arr[0]));
throw new Test262Error('#1: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[0] === x. Actual: ' + (arr[0]));
}
//CHECK#2
if (arr[1] !== y) {
$ERROR('#2: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[1] === y. Actual: ' + (arr[1]));
throw new Test262Error('#2: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[1] === y. Actual: ' + (arr[1]));
}
//CHECK#3
if (arr[2] !== 1) {
$ERROR('#3: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[2] === 1. Actual: ' + (arr[2]));
throw new Test262Error('#3: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[2] === 1. Actual: ' + (arr[2]));
}
//CHECK#4
if (arr[3] !== 2) {
$ERROR('#4: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[3] === 2. Actual: ' + (arr[3]));
throw new Test262Error('#4: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[3] === 2. Actual: ' + (arr[3]));
}
//CHECK#5
if (arr[4] !== -1) {
$ERROR('#5: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[4] === -1. Actual: ' + (arr[4]));
throw new Test262Error('#5: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[4] === -1. Actual: ' + (arr[4]));
}
//CHECK#6
if (arr[5] !== true) {
$ERROR('#6: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[5] === true. Actual: ' + (arr[5]));
throw new Test262Error('#6: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[5] === true. Actual: ' + (arr[5]));
}
//CHECK#7
if (arr[6] !== "NaN") {
$ERROR('#7: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[6] === "NaN". Actual: ' + (arr[6]));
throw new Test262Error('#7: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[6] === "NaN". Actual: ' + (arr[6]));
}
//CHECK#8
if (arr.length !== 7) {
$ERROR('#8: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr.length === 7. Actual: ' + (arr.length));
throw new Test262Error('#8: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr.length === 7. Actual: ' + (arr.length));
}

View File

@ -17,15 +17,15 @@ var arr = x.concat();
//CHECK#0
arr.getClass = Object.prototype.toString;
if (arr.getClass() !== "[object " + "Array" + "]") {
$ERROR('#0: var x = {}; x.concat = Array.prototype.concat; var arr = x.concat() arr is Array object. Actual: ' + (arr.getClass()));
throw new Test262Error('#0: var x = {}; x.concat = Array.prototype.concat; var arr = x.concat() arr is Array object. Actual: ' + (arr.getClass()));
}
//CHECK#1
if (arr[0] !== x) {
$ERROR('#1: var x = {}; x.concat = Array.prototype.concat; var arr = x.concat(); arr[0] === x. Actual: ' + (arr[0]));
throw new Test262Error('#1: var x = {}; x.concat = Array.prototype.concat; var arr = x.concat(); arr[0] === x. Actual: ' + (arr[0]));
}
//CHECK#2
if (arr.length !== 1) {
$ERROR('#2: var x = {}; x.concat = Array.prototype.concat; var arr = x.concat(); arr.length === 1. Actual: ' + (arr.length));
throw new Test262Error('#2: var x = {}; x.concat = Array.prototype.concat; var arr = x.concat(); arr.length === 1. Actual: ' + (arr.length));
}

View File

@ -17,17 +17,17 @@ var arr = x.concat();
//CHECK#1
if (arr[0] !== 0) {
$ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.concat(); arr[0] === 0. Actual: ' + (arr[0]));
throw new Test262Error('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.concat(); arr[0] === 0. Actual: ' + (arr[0]));
}
//CHECK#2
if (arr[1] !== 1) {
$ERROR('#2: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.concat(); arr[1] === 1. Actual: ' + (arr[1]));
throw new Test262Error('#2: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.concat(); arr[1] === 1. Actual: ' + (arr[1]));
}
//CHECK#3
if (arr.hasOwnProperty('1') !== true) {
$ERROR('#3: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.concat(); arr.hasOwnProperty(\'1\') === true. Actual: ' + (arr.hasOwnProperty('1')));
throw new Test262Error('#3: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.concat(); arr.hasOwnProperty(\'1\') === true. Actual: ' + (arr.hasOwnProperty('1')));
}
Object.prototype[1] = 1;
@ -40,15 +40,15 @@ var arr = x.concat();
//CHECK#4
if (arr[0] !== x) {
$ERROR('#4: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.concat = Array.prototype.concat; x = {0:0}; var arr = x.concat(); arr[0] === x. Actual: ' + (arr[0]));
throw new Test262Error('#4: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.concat = Array.prototype.concat; x = {0:0}; var arr = x.concat(); arr[0] === x. Actual: ' + (arr[0]));
}
//CHECK#5
if (arr[1] !== 1) {
$ERROR('#5: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.concat = Array.prototype.concat; x = {0:0}; var arr = x.concat(); arr[1] === 1. Actual: ' + (arr[1]));
throw new Test262Error('#5: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.concat = Array.prototype.concat; x = {0:0}; var arr = x.concat(); arr[1] === 1. Actual: ' + (arr[1]));
}
//CHECK#6
if (arr.hasOwnProperty('1') !== false) {
$ERROR('#6: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.concat = Array.prototype.concat; x = {0:0}; var arr = x.concat(); arr.hasOwnProperty(\'1\') === false. Actual: ' + (arr.hasOwnProperty('1')));
throw new Test262Error('#6: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.concat = Array.prototype.concat; x = {0:0}; var arr = x.concat(); arr.hasOwnProperty(\'1\') === false. Actual: ' + (arr.hasOwnProperty('1')));
}

View File

@ -12,53 +12,53 @@ description: >
var a = [0];
if (a.length !== 1) {
$ERROR("expected a.length === 1, actually " + a.length);
throw new Test262Error("expected a.length === 1, actually " + a.length);
}
a.length = 3;
if (a[1] !== undefined) {
$ERROR("expected a[1] === undefined, actually " + a[1]);
throw new Test262Error("expected a[1] === undefined, actually " + a[1]);
}
if (a[2] !== undefined) {
$ERROR("expected a[2] === undefined, actually " + a[2]);
throw new Test262Error("expected a[2] === undefined, actually " + a[2]);
}
Array.prototype[2] = 2;
if (a[1] !== undefined) {
$ERROR("expected a[1] === undefined, actually " + a[1]);
throw new Test262Error("expected a[1] === undefined, actually " + a[1]);
}
if (a[2] !== 2) {
$ERROR("expected a[2] === 2, actually " + a[2]);
throw new Test262Error("expected a[2] === 2, actually " + a[2]);
}
if (a.hasOwnProperty('1') !== false) {
$ERROR("a.hasOwnProperty('1') === false, actually " + a.hasOwnProperty('1'));
throw new Test262Error("a.hasOwnProperty('1') === false, actually " + a.hasOwnProperty('1'));
}
if (a.hasOwnProperty('2') !== false) {
$ERROR("a.hasOwnProperty('2') === false, actually " + a.hasOwnProperty('2'));
throw new Test262Error("a.hasOwnProperty('2') === false, actually " + a.hasOwnProperty('2'));
}
var b = a.concat();
if (b.length !== 3) {
$ERROR("expected b.length === 3, actually " + b.length);
throw new Test262Error("expected b.length === 3, actually " + b.length);
}
if (b[0] !== 0) {
$ERROR("expected b[0] === 0, actually " + b[0]);
throw new Test262Error("expected b[0] === 0, actually " + b[0]);
}
if (b[1] !== undefined) {
$ERROR("expected b[1] === undefined, actually " + b[1]);
throw new Test262Error("expected b[1] === undefined, actually " + b[1]);
}
if (b[2] !== 2) {
$ERROR("expected b[2] === 2, actually " + b[2]);
throw new Test262Error("expected b[2] === 2, actually " + b[2]);
}
if (b.hasOwnProperty('1') !== false) {
$ERROR("expected b.hasOwnProperty('1') === false, actually " + b.hasOwnProperty('1'));
throw new Test262Error("expected b.hasOwnProperty('1') === false, actually " + b.hasOwnProperty('1'));
}
if (b.hasOwnProperty('2') !== true) {
$ERROR("expected b.hasOwnProperty('2') === true, actually " + b.hasOwnProperty('2'));
throw new Test262Error("expected b.hasOwnProperty('2') === true, actually " + b.hasOwnProperty('2'));
}

View File

@ -12,53 +12,53 @@ description: >
var a = [0];
if (a.length !== 1) {
$ERROR("expected a.length === 1, actually " + a.length);
throw new Test262Error("expected a.length === 1, actually " + a.length);
}
a.length = 3;
if (a[1] !== undefined) {
$ERROR("expected a[1] === undefined, actually " + a[1]);
throw new Test262Error("expected a[1] === undefined, actually " + a[1]);
}
if (a[2] !== undefined) {
$ERROR("expected a[2] === undefined, actually " + a[2]);
throw new Test262Error("expected a[2] === undefined, actually " + a[2]);
}
Object.prototype[2] = 2;
if (a[1] !== undefined) {
$ERROR("expected a[1] === undefined, actually " + a[1]);
throw new Test262Error("expected a[1] === undefined, actually " + a[1]);
}
if (a[2] !== 2) {
$ERROR("expected a[2] === 2, actually " + a[2]);
throw new Test262Error("expected a[2] === 2, actually " + a[2]);
}
if (a.hasOwnProperty('1') !== false) {
$ERROR("a.hasOwnProperty('1') === false, actually " + a.hasOwnProperty('1'));
throw new Test262Error("a.hasOwnProperty('1') === false, actually " + a.hasOwnProperty('1'));
}
if (a.hasOwnProperty('2') !== false) {
$ERROR("a.hasOwnProperty('2') === false, actually " + a.hasOwnProperty('2'));
throw new Test262Error("a.hasOwnProperty('2') === false, actually " + a.hasOwnProperty('2'));
}
var b = a.concat();
if (b.length !== 3) {
$ERROR("expected b.length === 3, actually " + b.length);
throw new Test262Error("expected b.length === 3, actually " + b.length);
}
if (b[0] !== 0) {
$ERROR("expected b[0] === 0, actually " + b[0]);
throw new Test262Error("expected b[0] === 0, actually " + b[0]);
}
if (b[1] !== undefined) {
$ERROR("expected b[1] === undefined, actually " + b[1]);
throw new Test262Error("expected b[1] === undefined, actually " + b[1]);
}
if (b[2] !== 2) {
$ERROR("expected b[2] === 2, actually " + b[2]);
throw new Test262Error("expected b[2] === 2, actually " + b[2]);
}
if (b.hasOwnProperty('1') !== false) {
$ERROR("expected b.hasOwnProperty('1') === false, actually " + b.hasOwnProperty('1'));
throw new Test262Error("expected b.hasOwnProperty('1') === false, actually " + b.hasOwnProperty('1'));
}
if (b.hasOwnProperty('2') !== true) {
$ERROR("expected b.hasOwnProperty('2') === true, actually " + b.hasOwnProperty('2'));
throw new Test262Error("expected b.hasOwnProperty('2') === true, actually " + b.hasOwnProperty('2'));
}

View File

@ -10,7 +10,7 @@ description: Checking this use new Array() and []
//CHECK#1
var x = new Array();
if (x.join() !== "") {
$ERROR('#1: x = new Array(); x.join() === "". Actual: ' + (x.join()));
throw new Test262Error('#1: x = new Array(); x.join() === "". Actual: ' + (x.join()));
}
//CHECK#2
@ -18,5 +18,5 @@ x = [];
x[0] = 1;
x.length = 0;
if (x.join() !== "") {
$ERROR('#2: x = []; x[0] = 1; x.length = 0; x.join() === "". Actual: ' + (x.join()));
throw new Test262Error('#2: x = []; x[0] = 1; x.length = 0; x.join() === "". Actual: ' + (x.join()));
}

View File

@ -10,7 +10,7 @@ description: Checking this use new Array() and []
//CHECK#1
var x = new Array(0, 1, 2, 3);
if (x.join() !== "0,1,2,3") {
$ERROR('#1: x = new Array(0,1,2,3); x.join() === "0,1,2,3". Actual: ' + (x.join()));
throw new Test262Error('#1: x = new Array(0,1,2,3); x.join() === "0,1,2,3". Actual: ' + (x.join()));
}
//CHECK#2
@ -18,12 +18,12 @@ x = [];
x[0] = 0;
x[3] = 3;
if (x.join() !== "0,,,3") {
$ERROR('#2: x = []; x[0] = 0; x[3] = 3; x.join() === "0,,,3". Actual: ' + (x.join()));
throw new Test262Error('#2: x = []; x[0] = 0; x[3] = 3; x.join() === "0,,,3". Actual: ' + (x.join()));
}
//CHECK#3
x = [];
x[0] = 0;
if (x.join() !== "0") {
$ERROR('#3: x = []; x[0] = 0; x.join() === "0". Actual: ' + (x.join()));
throw new Test262Error('#3: x = []; x[0] = 0; x.join() === "0". Actual: ' + (x.join()));
}

View File

@ -10,7 +10,7 @@ description: Checking this use new Array() and []
//CHECK#1
var x = new Array(0, 1, 2, 3);
if (x.join(undefined) !== "0,1,2,3") {
$ERROR('#1: x = new Array(0,1,2,3); x.join(undefined) === "0,1,2,3". Actual: ' + (x.join(undefined)));
throw new Test262Error('#1: x = new Array(0,1,2,3); x.join(undefined) === "0,1,2,3". Actual: ' + (x.join(undefined)));
}
//CHECK#2
@ -18,12 +18,12 @@ x = [];
x[0] = 0;
x[3] = 3;
if (x.join(undefined) !== "0,,,3") {
$ERROR('#2: x = []; x[0] = 0; x[3] = 3; x.join(undefined) === "0,,,3". Actual: ' + (x.join(undefined)));
throw new Test262Error('#2: x = []; x[0] = 0; x[3] = 3; x.join(undefined) === "0,,,3". Actual: ' + (x.join(undefined)));
}
//CHECK#3
x = [];
x[0] = 0;
if (x.join(undefined) !== "0") {
$ERROR('#3: x = []; x[0] = 0; x.join(undefined) === "0". Actual: ' + (x.join(undefined)));
throw new Test262Error('#3: x = []; x[0] = 0; x.join(undefined) === "0". Actual: ' + (x.join(undefined)));
}

View File

@ -11,18 +11,18 @@ description: Checking this use new Array() and []
var x = [];
x[0] = undefined;
if (x.join() !== "") {
$ERROR('#1: x = []; x[0] = undefined; x.join() === "". Actual: ' + (x.join()));
throw new Test262Error('#1: x = []; x[0] = undefined; x.join() === "". Actual: ' + (x.join()));
}
//CHECK#2
x = [];
x[0] = null;
if (x.join() !== "") {
$ERROR('#2: x = []; x[0] = null; x.join() === "". Actual: ' + (x.join()));
throw new Test262Error('#2: x = []; x[0] = null; x.join() === "". Actual: ' + (x.join()));
}
//CHECK#3
x = Array(undefined, 1, null, 3);
if (x.join() !== ",1,,3") {
$ERROR('#3: x = Array(undefined,1,null,3); x.join() === ",1,,3". Actual: ' + (x.join()));
throw new Test262Error('#3: x = Array(undefined,1,null,3); x.join() === ",1,,3". Actual: ' + (x.join()));
}

View File

@ -13,36 +13,36 @@ var obj = {};
obj.join = Array.prototype.join;
if (obj.length !== undefined) {
$ERROR('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length));
throw new Test262Error('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length));
} else {
//CHECK#1
if (obj.join() !== "") {
$ERROR('#1: var obj = {}; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
throw new Test262Error('#1: var obj = {}; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
}
//CHECK#2
if (obj.length !== undefined) {
$ERROR('#2: var obj = {}; obj.join = Array.prototype.join; obj.join(); obj.length === undefined. Actual: ' + (obj.length));
throw new Test262Error('#2: var obj = {}; obj.join = Array.prototype.join; obj.join(); obj.length === undefined. Actual: ' + (obj.length));
}
}
//CHECK#3
obj.length = undefined;
if (obj.join() !== "") {
$ERROR('#3: var obj = {}; obj.length = undefined; obj.join = Array.prototype.join; obj.join() === ". Actual: ' + (obj.join()));
throw new Test262Error('#3: var obj = {}; obj.length = undefined; obj.join = Array.prototype.join; obj.join() === ". Actual: ' + (obj.join()));
}
//CHECK#4
if (obj.length !== undefined) {
$ERROR('#4: var obj = {}; obj.length = undefined; obj.join = Array.prototype.join; obj.join(); obj.length === undefined. Actual: ' + (obj.length));
throw new Test262Error('#4: var obj = {}; obj.length = undefined; obj.join = Array.prototype.join; obj.join(); obj.length === undefined. Actual: ' + (obj.length));
}
//CHECK#5
obj.length = null
if (obj.join() !== "") {
$ERROR('#5: var obj = {}; obj.length = null; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
throw new Test262Error('#5: var obj = {}; obj.length = null; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
}
//CHECK#6
if (obj.length !== null) {
$ERROR('#6: var obj = {}; obj.length = null; obj.join = Array.prototype.join; obj.join(); obj.length === null. Actual: ' + (obj.length));
throw new Test262Error('#6: var obj = {}; obj.length = null; obj.join = Array.prototype.join; obj.join(); obj.length === null. Actual: ' + (obj.length));
}

View File

@ -15,7 +15,7 @@ obj.join = Array.prototype.join;
//CHECK#1
obj.length = NaN;
if (obj.join() !== "") {
$ERROR('#1: var obj = {}; obj.length = NaN; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
throw new Test262Error('#1: var obj = {}; obj.length = NaN; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
}
//CHECK#2
@ -24,48 +24,48 @@ assert.sameValue(obj.length, NaN, "obj.length is NaN");
//CHECK#5
obj.length = Number.NEGATIVE_INFINITY;
if (obj.join() !== "") {
$ERROR('#5: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
throw new Test262Error('#5: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
}
//CHECK#6
if (obj.length !== Number.NEGATIVE_INFINITY) {
$ERROR('#6: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.join = Array.prototype.join; obj.join(); obj.length === Number.NEGATIVE_INFINITY. Actual: ' + (obj.length));
throw new Test262Error('#6: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.join = Array.prototype.join; obj.join(); obj.length === Number.NEGATIVE_INFINITY. Actual: ' + (obj.length));
}
//CHECK#7
obj.length = -0;
if (obj.join() !== "") {
$ERROR('#7: var obj = {}; obj.length = -0; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
throw new Test262Error('#7: var obj = {}; obj.length = -0; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
}
//CHECK#8
if (obj.length !== -0) {
$ERROR('#8: var obj = {}; obj.length = -0; obj.join = Array.prototype.join; obj.join(); obj.length === 0. Actual: ' + (obj.length));
throw new Test262Error('#8: var obj = {}; obj.length = -0; obj.join = Array.prototype.join; obj.join(); obj.length === 0. Actual: ' + (obj.length));
} else {
if (1 / obj.length !== Number.NEGATIVE_INFINITY) {
$ERROR('#8: var obj = {}; obj.length = -0; obj.join = Array.prototype.join; obj.join(); obj.length === -0. Actual: ' + (obj.length));
throw new Test262Error('#8: var obj = {}; obj.length = -0; obj.join = Array.prototype.join; obj.join(); obj.length === -0. Actual: ' + (obj.length));
}
}
//CHECK#9
obj.length = 0.5;
if (obj.join() !== "") {
$ERROR('#9: var obj = {}; obj.length = 0.5; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
throw new Test262Error('#9: var obj = {}; obj.length = 0.5; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
}
//CHECK#10
if (obj.length !== 0.5) {
$ERROR('#10: var obj = {}; obj.length = 0.5; obj.join = Array.prototype.join; obj.join(); obj.length === 0.5. Actual: ' + (obj.length));
throw new Test262Error('#10: var obj = {}; obj.length = 0.5; obj.join = Array.prototype.join; obj.join(); obj.length === 0.5. Actual: ' + (obj.length));
}
//CHECK#11
var x = new Number(0);
obj.length = x;
if (obj.join() !== "") {
$ERROR('#11: var x = new Number(0); var obj = {}; obj.length = x; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
throw new Test262Error('#11: var x = new Number(0); var obj = {}; obj.length = x; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
}
//CHECK#12
if (obj.length !== x) {
$ERROR('#12: var x = new Number(0); var obj = {}; obj.length = x; obj.join = Array.prototype.join; obj.join(); obj.length === x. Actual: ' + (obj.length));
throw new Test262Error('#12: var x = new Number(0); var obj = {}; obj.length = x; obj.join = Array.prototype.join; obj.join(); obj.length === x. Actual: ' + (obj.length));
}

View File

@ -15,7 +15,7 @@ obj.join = Array.prototype.join;
//CHECK#1
obj.length = 4.5;
if (obj.join() !== ",,,") {
$ERROR('#1: var obj = {}; obj.length = 4.5; obj.join = Array.prototype.join; obj.join() === ",,,". Actual: ' + (obj.join()));
throw new Test262Error('#1: var obj = {}; obj.length = 4.5; obj.join = Array.prototype.join; obj.join() === ",,,". Actual: ' + (obj.join()));
}
//CHECK#2
@ -23,12 +23,12 @@ obj[0] = undefined;
obj[1] = 1;
obj[2] = null;
if (obj.join() !== ",1,,") {
$ERROR('#1: var obj = {}; obj.length = 4.5; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join() === ",1,,". Actual: ' + (obj.join()));
throw new Test262Error('#1: var obj = {}; obj.length = 4.5; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join() === ",1,,". Actual: ' + (obj.join()));
}
//CHECK#3
if (obj.length !== 4.5) {
$ERROR('#1: var obj = {}; obj.length = 4.5; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join(); obj.length === 4.5. Actual: ' + (obj.length));
throw new Test262Error('#1: var obj = {}; obj.length = 4.5; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join(); obj.length === 4.5. Actual: ' + (obj.length));
}
var obj = {};
@ -38,7 +38,7 @@ obj.join = Array.prototype.join;
var x = new Number(4.5);
obj.length = x;
if (obj.join() !== ",,,") {
$ERROR('#4: var obj = {}; var x = new Number(4.5); obj.length = x; obj.join = Array.prototype.join; obj.join() === ",,,". Actual: ' + (obj.join()));
throw new Test262Error('#4: var obj = {}; var x = new Number(4.5); obj.length = x; obj.join = Array.prototype.join; obj.join() === ",,,". Actual: ' + (obj.join()));
}
//CHECK#5
@ -46,10 +46,10 @@ obj[0] = undefined;
obj[1] = 1;
obj[2] = null;
if (obj.join() !== ",1,,") {
$ERROR('#5: var obj = {}; var x = new Number(4.5); obj.length = x; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join() === ",1,,". Actual: ' + (obj.join()));
throw new Test262Error('#5: var obj = {}; var x = new Number(4.5); obj.length = x; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join() === ",1,,". Actual: ' + (obj.join()));
}
//CHECK#6
if (obj.length !== x) {
$ERROR('#6: var obj = {}; var x = new Number(4.5); obj.length = x; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join(); obj.length === x. Actual: ' + (obj.length));
throw new Test262Error('#6: var obj = {}; var x = new Number(4.5); obj.length = x; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join(); obj.length === x. Actual: ' + (obj.length));
}

View File

@ -21,7 +21,7 @@ obj.length = {
}
};
if (obj.join() !== ",,") {
$ERROR('#1: obj.length = {valueOf: function() {return 3}} obj.join() === ",,". Actual: ' + (obj.join()));
throw new Test262Error('#1: obj.length = {valueOf: function() {return 3}} obj.join() === ",,". Actual: ' + (obj.join()));
}
//CHECK#2
@ -34,7 +34,7 @@ obj.length = {
}
};
if (obj.join() !== ",,") {
$ERROR('#2: obj.length = {valueOf: function() {return 3}, toString: function() {return 2}} obj.join() === ",,". Actual: ' + (obj.join()));
throw new Test262Error('#2: obj.length = {valueOf: function() {return 3}, toString: function() {return 2}} obj.join() === ",,". Actual: ' + (obj.join()));
}
//CHECK#3
@ -47,7 +47,7 @@ obj.length = {
}
};
if (obj.join() !== ",,") {
$ERROR('#3: obj.length = {valueOf: function() {return 3}, toString: function() {return {}}} obj.join() === ",,". Actual: ' + (obj.join()));
throw new Test262Error('#3: obj.length = {valueOf: function() {return 3}, toString: function() {return {}}} obj.join() === ",,". Actual: ' + (obj.join()));
}
//CHECK#4
@ -61,14 +61,14 @@ try {
}
};
if (obj.join() !== ",,") {
$ERROR('#4.1: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.join() === ",". Actual: ' + (obj.join()));
throw new Test262Error('#4.1: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.join() === ",". Actual: ' + (obj.join()));
}
}
catch (e) {
if (e === "error") {
$ERROR('#4.2: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.join() not throw "error"');
throw new Test262Error('#4.2: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.join() not throw "error"');
} else {
$ERROR('#4.3: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.join() not throw Error. Actual: ' + (e));
throw new Test262Error('#4.3: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.join() not throw Error. Actual: ' + (e));
}
}
@ -79,7 +79,7 @@ obj.length = {
}
};
if (obj.join() !== ",") {
$ERROR('#5: obj.length = {toString: function() {return 2}} obj.join() === ",". Actual: ' + (obj.join()));
throw new Test262Error('#5: obj.length = {toString: function() {return 2}} obj.join() === ",". Actual: ' + (obj.join()));
}
//CHECK#6
@ -92,7 +92,7 @@ obj.length = {
}
}
if (obj.join() !== ",") {
$ERROR('#6: obj.length = {valueOf: function() {return {}}, toString: function() {return 2}} obj.join() === ",". Actual: ' + (obj.join()));
throw new Test262Error('#6: obj.length = {valueOf: function() {return {}}, toString: function() {return 2}} obj.join() === ",". Actual: ' + (obj.join()));
}
//CHECK#7
@ -106,11 +106,11 @@ try {
}
};
obj.join();
$ERROR('#7.1: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 2}}; obj.join() throw "error". Actual: ' + (obj.join()));
throw new Test262Error('#7.1: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 2}}; obj.join() throw "error". Actual: ' + (obj.join()));
}
catch (e) {
if (e !== "error") {
$ERROR('#7.2: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 2}}; obj.join() throw "error". Actual: ' + (e));
throw new Test262Error('#7.2: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 2}}; obj.join() throw "error". Actual: ' + (e));
}
}
@ -125,10 +125,10 @@ try {
}
};
obj.join();
$ERROR('#8.1: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.join() throw TypeError. Actual: ' + (obj.join()));
throw new Test262Error('#8.1: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.join() throw TypeError. Actual: ' + (obj.join()));
}
catch (e) {
if ((e instanceof TypeError) !== true) {
$ERROR('#8,2: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.join() throw TypeError. Actual: ' + (e));
throw new Test262Error('#8,2: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.join() throw TypeError. Actual: ' + (e));
}
}

View File

@ -12,41 +12,41 @@ description: >
//CHECK#0
var x = new Array(0, 1, 2, 3);
if (x.join("") !== "0123") {
$ERROR('#0: x = new Array(0,1,2,3); x.join("") === "0123". Actual: ' + (x.join("")));
throw new Test262Error('#0: x = new Array(0,1,2,3); x.join("") === "0123". Actual: ' + (x.join("")));
}
//CHECK#1
x = new Array(0, 1, 2, 3);
if (x.join("\\") !== "0\\1\\2\\3") {
$ERROR('#1: x = new Array(0,1,2,3); x.join("\\") === "0\\1\\2\\3". Actual: ' + (x.join("\\")));
throw new Test262Error('#1: x = new Array(0,1,2,3); x.join("\\") === "0\\1\\2\\3". Actual: ' + (x.join("\\")));
}
//CHECK#2
if (x.join("&") !== "0&1&2&3") {
$ERROR('#2: x = new Array(0,1,2,3); x.join("&") === "0&1&2&3". Actual: ' + (x.join("&")));
throw new Test262Error('#2: x = new Array(0,1,2,3); x.join("&") === "0&1&2&3". Actual: ' + (x.join("&")));
}
//CHECK#3
if (x.join(true) !== "0true1true2true3") {
$ERROR('#3: x = new Array(0,1,2,3); x.join(true) === "0true1true2true3". Actual: ' + (x.join(true)));
throw new Test262Error('#3: x = new Array(0,1,2,3); x.join(true) === "0true1true2true3". Actual: ' + (x.join(true)));
}
//CHECK#4
if (x.join(Infinity) !== "0Infinity1Infinity2Infinity3") {
$ERROR('#4: x = new Array(0,1,2,3); x.join(Infinity) === "0Infinity1Infinity2Infinity3". Actual: ' + (x.join(Infinity)));
throw new Test262Error('#4: x = new Array(0,1,2,3); x.join(Infinity) === "0Infinity1Infinity2Infinity3". Actual: ' + (x.join(Infinity)));
}
//CHECK#5
if (x.join(null) !== "0null1null2null3") {
$ERROR('#3: 5 = new Array(0,1,2,3); x.join(null) === "0null1null2null3". Actual: ' + (x.join(null)));
throw new Test262Error('#3: 5 = new Array(0,1,2,3); x.join(null) === "0null1null2null3". Actual: ' + (x.join(null)));
}
//CHECK#6
if (x.join(undefined) !== "0,1,2,3") {
$ERROR('#6: x = new Array(0,1,2,3); x.join(undefined) === "0,1,2,3". Actual: ' + (x.join(undefined)));
throw new Test262Error('#6: x = new Array(0,1,2,3); x.join(undefined) === "0,1,2,3". Actual: ' + (x.join(undefined)));
}
//CHECK#7
if (x.join(NaN) !== "0NaN1NaN2NaN3") {
$ERROR('#7: x = new Array(0,1,2,3); x.join(NaN) === "0NaN1NaN2NaN3". Actual: ' + (x.join(NaN)));
throw new Test262Error('#7: x = new Array(0,1,2,3); x.join(NaN) === "0NaN1NaN2NaN3". Actual: ' + (x.join(NaN)));
}

View File

@ -17,7 +17,7 @@ var object = {
}
};
if (x.join(object) !== "0[object Object]1[object Object]2[object Object]3") {
$ERROR('#1: var object = {valueOf: function() {return "+"}}; x.join(object) === "0[object Object]1[object Object]2[object Object]3". Actual: ' + (x.join(object)));
throw new Test262Error('#1: var object = {valueOf: function() {return "+"}}; x.join(object) === "0[object Object]1[object Object]2[object Object]3". Actual: ' + (x.join(object)));
}
//CHECK#2
@ -30,7 +30,7 @@ var object = {
}
};
if (x.join(object) !== "0*1*2*3") {
$ERROR('#2: var object = {valueOf: function() {return "+"}, toString: function() {return "*"}}; x.join(object) === "0*1*2*3". Actual: ' + (x.join(object)));
throw new Test262Error('#2: var object = {valueOf: function() {return "+"}, toString: function() {return "*"}}; x.join(object) === "0*1*2*3". Actual: ' + (x.join(object)));
}
//CHECK#3
@ -43,7 +43,7 @@ var object = {
}
};
if (x.join(object) !== "0+1+2+3") {
$ERROR('#3: var object = {valueOf: function() {return "+"}, toString: function() {return {}}}; x.join(object) === "0+1+2+3". Actual: ' + (x.join(object)));
throw new Test262Error('#3: var object = {valueOf: function() {return "+"}, toString: function() {return {}}}; x.join(object) === "0+1+2+3". Actual: ' + (x.join(object)));
}
//CHECK#4
@ -57,14 +57,14 @@ try {
}
};
if (x.join(object) !== "0*1*2*3") {
$ERROR('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}}; x.join(object) === "0*1*2*3". Actual: ' + (x.join(object)));
throw new Test262Error('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}}; x.join(object) === "0*1*2*3". Actual: ' + (x.join(object)));
}
}
catch (e) {
if (e === "error") {
$ERROR('#4.2: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}}; x.join(object) not throw "error"');
throw new Test262Error('#4.2: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}}; x.join(object) not throw "error"');
} else {
$ERROR('#4.3: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}}; x.join(object) not throw Error. Actual: ' + (e));
throw new Test262Error('#4.3: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}}; x.join(object) not throw Error. Actual: ' + (e));
}
}
@ -75,7 +75,7 @@ var object = {
}
};
if (x.join(object) !== "0*1*2*3") {
$ERROR('#5: var object = {toString: function() {return "*"}}; x.join(object) === "0*1*2*3". Actual: ' + (x.join(object)));
throw new Test262Error('#5: var object = {toString: function() {return "*"}}; x.join(object) === "0*1*2*3". Actual: ' + (x.join(object)));
}
//CHECK#6
@ -88,7 +88,7 @@ var object = {
}
}
if (x.join(object) !== "0*1*2*3") {
$ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return "*"}}; x.join(object) === "0*1*2*3". Actual: ' + (x.join(object)));
throw new Test262Error('#6: var object = {valueOf: function() {return {}}, toString: function() {return "*"}}; x.join(object) === "0*1*2*3". Actual: ' + (x.join(object)));
}
//CHECK#7
@ -102,11 +102,11 @@ try {
}
};
x.join(object);
$ERROR('#7.1: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}}; x.join(object) throw "error". Actual: ' + (x.join(object)));
throw new Test262Error('#7.1: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}}; x.join(object) throw "error". Actual: ' + (x.join(object)));
}
catch (e) {
if (e !== "error") {
$ERROR('#7.2: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}}; x.join(object) throw "error". Actual: ' + (e));
throw new Test262Error('#7.2: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}}; x.join(object) throw "error". Actual: ' + (e));
}
}
@ -121,11 +121,11 @@ try {
}
};
x.join(object);
$ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x.join(object) throw TypeError. Actual: ' + (x.join(object)));
throw new Test262Error('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x.join(object) throw TypeError. Actual: ' + (x.join(object)));
}
catch (e) {
if ((e instanceof TypeError) !== true) {
$ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x.join(object) throw TypeError. Actual: ' + (e));
throw new Test262Error('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x.join(object) throw TypeError. Actual: ' + (e));
}
}
@ -137,10 +137,10 @@ try {
}
};
[].join(object);
$ERROR('#9.1: var object = {toString: function() {throw "error"}}; [].join(object) throw "error". Actual: ' + ([].join(object)));
throw new Test262Error('#9.1: var object = {toString: function() {throw "error"}}; [].join(object) throw "error". Actual: ' + ([].join(object)));
}
catch (e) {
if (e !== "error") {
$ERROR('#9.2: var object = {toString: function() {throw "error"}}; [].join(object) throw "error". Actual: ' + (e));
throw new Test262Error('#9.2: var object = {toString: function() {throw "error"}}; [].join(object) throw "error". Actual: ' + (e));
}
}

View File

@ -12,47 +12,47 @@ description: >
//CHECK#0
var x = new Array("", "", "");
if (x.join("") !== "") {
$ERROR('#0: var x = new Array("","",""); x.join("") === "". Actual: ' + (x.join("")));
throw new Test262Error('#0: var x = new Array("","",""); x.join("") === "". Actual: ' + (x.join("")));
}
//CHECK#1
var x = new Array("\\", "\\", "\\");
if (x.join("\\") !== "\\\\\\\\\\") {
$ERROR('#1: var x = new Array("\\","\\","\\"); x.join("\\") === "\\\\\\\\\\". Actual: ' + (x.join("\\")));
throw new Test262Error('#1: var x = new Array("\\","\\","\\"); x.join("\\") === "\\\\\\\\\\". Actual: ' + (x.join("\\")));
}
//CHECK#2
var x = new Array("&", "&", "&");
if (x.join("&") !== "&&&&&") {
$ERROR('#2: var x = new Array("&", "&", "&"); x.join("&") === "&&&&&". Actual: ' + (x.join("&")));
throw new Test262Error('#2: var x = new Array("&", "&", "&"); x.join("&") === "&&&&&". Actual: ' + (x.join("&")));
}
//CHECK#3
var x = new Array(true, true, true);
if (x.join() !== "true,true,true") {
$ERROR('#3: var x = new Array(true,true,true); x.join(true,true,true) === "true,true,true". Actual: ' + (x.join(true, true, true)));
throw new Test262Error('#3: var x = new Array(true,true,true); x.join(true,true,true) === "true,true,true". Actual: ' + (x.join(true, true, true)));
}
//CHECK#4
var x = new Array(null, null, null);
if (x.join() !== ",,") {
$ERROR('#4: var x = new Array(null,null,null); x.join(null,null,null) === ",,". Actual: ' + (x.join(null, null, null)));
throw new Test262Error('#4: var x = new Array(null,null,null); x.join(null,null,null) === ",,". Actual: ' + (x.join(null, null, null)));
}
//CHECK#5
var x = new Array(undefined, undefined, undefined);
if (x.join() !== ",,") {
$ERROR('#5: var x = new Array(undefined,undefined,undefined); x.join(undefined,undefined,undefined) === ",,". Actual: ' + (x.join(undefined, undefined, undefined)));
throw new Test262Error('#5: var x = new Array(undefined,undefined,undefined); x.join(undefined,undefined,undefined) === ",,". Actual: ' + (x.join(undefined, undefined, undefined)));
}
//CHECK#6
var x = new Array(Infinity, Infinity, Infinity);
if (x.join() !== "Infinity,Infinity,Infinity") {
$ERROR('#6: var x = new Array(Infinity,Infinity,Infinity); x.join(Infinity,Infinity,Infinity) === "Infinity,Infinity,Infinity". Actual: ' + (x.join(Infinity, Infinity, Infinity)));
throw new Test262Error('#6: var x = new Array(Infinity,Infinity,Infinity); x.join(Infinity,Infinity,Infinity) === "Infinity,Infinity,Infinity". Actual: ' + (x.join(Infinity, Infinity, Infinity)));
}
//CHECK#7
var x = new Array(NaN, NaN, NaN);
if (x.join() !== "NaN,NaN,NaN") {
$ERROR('#7: var x = new Array(NaN,NaN,NaN); x.join(NaN,NaN,NaN) === "NaN,NaN,NaN". Actual: ' + (x.join(NaN, NaN, NaN)));
throw new Test262Error('#7: var x = new Array(NaN,NaN,NaN); x.join(NaN,NaN,NaN) === "NaN,NaN,NaN". Actual: ' + (x.join(NaN, NaN, NaN)));
}

View File

@ -15,7 +15,7 @@ var object = {
};
var x = new Array(object);
if (x.join() !== "[object Object]") {
$ERROR('#1: var object = {valueOf: function() {return "+"}} var x = new Array(object); x.join() === "[object Object]". Actual: ' + (x.join()));
throw new Test262Error('#1: var object = {valueOf: function() {return "+"}} var x = new Array(object); x.join() === "[object Object]". Actual: ' + (x.join()));
}
//CHECK#2
@ -29,7 +29,7 @@ var object = {
};
var x = new Array(object);
if (x.join() !== "*") {
$ERROR('#2: var object = {valueOf: function() {return "+"}, toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join()));
throw new Test262Error('#2: var object = {valueOf: function() {return "+"}, toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join()));
}
//CHECK#3
@ -43,7 +43,7 @@ var object = {
};
var x = new Array(object);
if (x.join() !== "+") {
$ERROR('#3: var object = {valueOf: function() {return "+"}, toString: function() {return {}}} var x = new Array(object); x.join() === "+". Actual: ' + (x.join()));
throw new Test262Error('#3: var object = {valueOf: function() {return "+"}, toString: function() {return {}}} var x = new Array(object); x.join() === "+". Actual: ' + (x.join()));
}
//CHECK#4
@ -58,14 +58,14 @@ try {
};
var x = new Array(object);
if (x.join() !== "*") {
$ERROR('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join()));
throw new Test262Error('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join()));
}
}
catch (e) {
if (e === "error") {
$ERROR('#4.2: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}} var x = new Array(object); x.join() not throw "error"');
throw new Test262Error('#4.2: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}} var x = new Array(object); x.join() not throw "error"');
} else {
$ERROR('#4.3: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}} var x = new Array(object); x.join() not throw Error. Actual: ' + (e));
throw new Test262Error('#4.3: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}} var x = new Array(object); x.join() not throw Error. Actual: ' + (e));
}
}
@ -77,7 +77,7 @@ var object = {
};
var x = new Array(object);
if (x.join() !== "*") {
$ERROR('#5: var object = {toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join()));
throw new Test262Error('#5: var object = {toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join()));
}
//CHECK#6
@ -91,7 +91,7 @@ var object = {
}
var x = new Array(object);
if (x.join() !== "*") {
$ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join()));
throw new Test262Error('#6: var object = {valueOf: function() {return {}}, toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join()));
}
//CHECK#7
@ -106,11 +106,11 @@ try {
};
var x = new Array(object);
x.join();
$ERROR('#7.1: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}} var x = new Array(object); x.join() throw "error". Actual: ' + (x.join()));
throw new Test262Error('#7.1: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}} var x = new Array(object); x.join() throw "error". Actual: ' + (x.join()));
}
catch (e) {
if (e !== "error") {
$ERROR('#7.2: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}} var x = new Array(object); x.join() throw "error". Actual: ' + (e));
throw new Test262Error('#7.2: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}} var x = new Array(object); x.join() throw "error". Actual: ' + (e));
}
}
@ -126,10 +126,10 @@ try {
};
var x = new Array(object);
x.join();
$ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}} var x = new Array(object); x.join() throw TypeError. Actual: ' + (x.join()));
throw new Test262Error('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}} var x = new Array(object); x.join() throw TypeError. Actual: ' + (x.join()));
}
catch (e) {
if ((e instanceof TypeError) !== true) {
$ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}} var x = new Array(object); x.join() throw TypeError. Actual: ' + (e));
throw new Test262Error('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}} var x = new Array(object); x.join() throw TypeError. Actual: ' + (e));
}
}

View File

@ -16,10 +16,10 @@ 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("")));
throw new Test262Error('#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("")));
}
//CHECK#2
if (obj.length !== -4294967294) {
$ERROR('#2: var obj = {}; obj.join = Array.prototype.join; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.join(""); obj.length === -4294967294. Actual: ' + (obj.length));
throw new Test262Error('#2: var obj = {}; obj.join = Array.prototype.join; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.join(""); obj.length === -4294967294. Actual: ' + (obj.length));
}

View File

@ -14,7 +14,7 @@ Array.prototype[1] = 1;
var x = [0];
x.length = 2;
if (x.join() !== "0,1") {
$ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.join() === "0,1". Actual: ' + (x.join()));
throw new Test262Error('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.join() === "0,1". Actual: ' + (x.join()));
}
//CHECK#2
@ -25,5 +25,5 @@ x = {
0: 0
};
if (x.join() !== "0,1") {
$ERROR('#2: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.join = Array.prototype.join; x = {0:0}; x.join() === "0,1". Actual: ' + (x.join()));
throw new Test262Error('#2: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.join = Array.prototype.join; x = {0:0}; x.join() === "0,1". Actual: ' + (x.join()));
}

View File

@ -9,5 +9,5 @@ description: Checking Array.prototype.join.prototype
//CHECK#1
if (Array.prototype.join.prototype !== undefined) {
$ERROR('#1: Array.prototype.join.prototype === undefined. Actual: ' + (Array.prototype.join.prototype));
throw new Test262Error('#1: Array.prototype.join.prototype === undefined. Actual: ' + (Array.prototype.join.prototype));
}

View File

@ -13,9 +13,9 @@ description: >
try {
new Array.prototype.join();
$ERROR('#1.1: new Array.prototype.join() throw TypeError. Actual: ' + (new Array.prototype.join()));
throw new Test262Error('#1.1: new Array.prototype.join() throw TypeError. Actual: ' + (new Array.prototype.join()));
} catch (e) {
if ((e instanceof TypeError) !== true) {
$ERROR('#1.2: new Array.prototype.join() throw TypeError. Actual: ' + (e));
throw new Test262Error('#1.2: new Array.prototype.join() throw TypeError. Actual: ' + (e));
}
}

View File

@ -13,12 +13,12 @@ description: Checking this algorithm
var x = new Array();
var pop = x.pop();
if (pop !== undefined) {
$ERROR('#1: var x = new Array(); x.pop() === undefined. Actual: ' + (pop));
throw new Test262Error('#1: var x = new Array(); x.pop() === undefined. Actual: ' + (pop));
}
//CHECK#2
if (x.length !== 0) {
$ERROR('#2: var x = new Array(); x.pop(); x.length === 0. Actual: ' + (x.length));
throw new Test262Error('#2: var x = new Array(); x.pop(); x.length === 0. Actual: ' + (x.length));
}
//CHECK#3
@ -26,10 +26,10 @@ var x = Array(1, 2, 3);
x.length = 0;
var pop = x.pop();
if (pop !== undefined) {
$ERROR('#2: var x = Array(1,2,3); x.length = 0; x.pop() === undefined. Actual: ' + (pop));
throw new Test262Error('#2: var x = Array(1,2,3); x.length = 0; x.pop() === undefined. Actual: ' + (pop));
}
//CHECK#4
if (x.length !== 0) {
$ERROR('#4: var x = new Array(1,2,3); x.length = 0; x.pop(); x.length === 0. Actual: ' + (x.length));
throw new Test262Error('#4: var x = new Array(1,2,3); x.length = 0; x.pop(); x.length === 0. Actual: ' + (x.length));
}

View File

@ -13,22 +13,22 @@ description: Checking this use new Array() and []
var x = new Array(0, 1, 2, 3);
var pop = x.pop();
if (pop !== 3) {
$ERROR('#1: x = new Array(0,1,2,3); x.pop() === 3. Actual: ' + (pop));
throw new Test262Error('#1: x = new Array(0,1,2,3); x.pop() === 3. Actual: ' + (pop));
}
//CHECK#2
if (x.length !== 3) {
$ERROR('#2: x = new Array(0,1,2,3); x.pop(); x.length == 3');
throw new Test262Error('#2: x = new Array(0,1,2,3); x.pop(); x.length == 3');
}
//CHECK#3
if (x[3] !== undefined) {
$ERROR('#3: x = new Array(0,1,2,3); x.pop(); x[3] == undefined');
throw new Test262Error('#3: x = new Array(0,1,2,3); x.pop(); x[3] == undefined');
}
//CHECK#4
if (x[2] !== 2) {
$ERROR('#4: x = new Array(0,1,2,3); x.pop(); x[2] == 2');
throw new Test262Error('#4: x = new Array(0,1,2,3); x.pop(); x[2] == 2');
}
//CHECK#5
@ -37,32 +37,32 @@ x[0] = 0;
x[3] = 3;
var pop = x.pop();
if (pop !== 3) {
$ERROR('#5: x = []; x[0] = 0; x[3] = 3; x.pop() === 3. Actual: ' + (pop));
throw new Test262Error('#5: x = []; x[0] = 0; x[3] = 3; x.pop() === 3. Actual: ' + (pop));
}
//CHECK#6
if (x.length !== 3) {
$ERROR('#6: x = []; x[0] = 0; x[3] = 3; x.pop(); x.length == 3');
throw new Test262Error('#6: x = []; x[0] = 0; x[3] = 3; x.pop(); x.length == 3');
}
//CHECK#7
if (x[3] !== undefined) {
$ERROR('#7: x = []; x[0] = 0; x[3] = 3; x.pop(); x[3] == undefined');
throw new Test262Error('#7: x = []; x[0] = 0; x[3] = 3; x.pop(); x[3] == undefined');
}
//CHECK#8
if (x[2] !== undefined) {
$ERROR('#8: x = []; x[0] = 0; x[3] = 3; x.pop(); x[2] == undefined');
throw new Test262Error('#8: x = []; x[0] = 0; x[3] = 3; x.pop(); x[2] == undefined');
}
//CHECK#9
x.length = 1;
var pop = x.pop();
if (pop !== 0) {
$ERROR('#9: x = []; x[0] = 0; x[3] = 3; x.pop(); x.length = 1; x.pop() === 0. Actual: ' + (pop));
throw new Test262Error('#9: x = []; x[0] = 0; x[3] = 3; x.pop(); x.length = 1; x.pop() === 0. Actual: ' + (pop));
}
//CHECK#10
if (x.length !== 0) {
$ERROR('#10: x = []; x[0] = 0; x[3] = 3; x.pop(); x.length = 1; x.pop(); x.length === 0. Actual: ' + (x.length));
throw new Test262Error('#10: x = []; x[0] = 0; x[3] = 3; x.pop(); x.length = 1; x.pop(); x.length === 0. Actual: ' + (x.length));
}

View File

@ -15,16 +15,16 @@ var obj = {};
obj.pop = Array.prototype.pop;
if (obj.length !== undefined) {
$ERROR('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length));
throw new Test262Error('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length));
} else {
//CHECK#1
var pop = obj.pop();
if (pop !== undefined) {
$ERROR('#1: var obj = {}; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
throw new Test262Error('#1: var obj = {}; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
}
//CHECK#2
if (obj.length !== 0) {
$ERROR('#2: var obj = {}; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length));
throw new Test262Error('#2: var obj = {}; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length));
}
}
@ -32,22 +32,22 @@ if (obj.length !== undefined) {
obj.length = undefined;
var pop = obj.pop();
if (pop !== undefined) {
$ERROR('#3: var obj = {}; obj.length = undefined; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
throw new Test262Error('#3: var obj = {}; obj.length = undefined; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
}
//CHECK#4
if (obj.length !== 0) {
$ERROR('#4: var obj = {}; obj.length = undefined; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length));
throw new Test262Error('#4: var obj = {}; obj.length = undefined; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length));
}
//CHECK#5
obj.length = null
var pop = obj.pop();
if (pop !== undefined) {
$ERROR('#5: var obj = {}; obj.length = null; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
throw new Test262Error('#5: var obj = {}; obj.length = null; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
}
//CHECK#6
if (obj.length !== 0) {
$ERROR('#6: var obj = {}; obj.length = null; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length));
throw new Test262Error('#6: var obj = {}; obj.length = null; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length));
}

View File

@ -18,51 +18,51 @@ obj.pop = Array.prototype.pop;
obj.length = NaN;
var pop = obj.pop();
if (pop !== undefined) {
$ERROR('#1: var obj = {}; obj.length = NaN; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
throw new Test262Error('#1: var obj = {}; obj.length = NaN; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
}
//CHECK#2
if (obj.length !== 0) {
$ERROR('#2: var obj = {}; obj.length = NaN; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length));
throw new Test262Error('#2: var obj = {}; obj.length = NaN; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length));
}
//CHECK#3
obj.length = Number.POSITIVE_INFINITY;
var pop = obj.pop();
if (pop !== undefined) {
$ERROR('#3: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
throw new Test262Error('#3: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
}
//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));
throw new Test262Error('#4: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 9007199254740990. Actual: ' + (obj.length));
}
//CHECK#5
obj.length = Number.NEGATIVE_INFINITY;
var pop = obj.pop();
if (pop !== undefined) {
$ERROR('#5: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
throw new Test262Error('#5: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
}
//CHECK#6
if (obj.length !== 0) {
$ERROR('#6: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length));
throw new Test262Error('#6: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length));
}
//CHECK#7
obj.length = -0;
var pop = obj.pop();
if (pop !== undefined) {
$ERROR('#7: var obj = {}; obj.length = -0; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
throw new Test262Error('#7: var obj = {}; obj.length = -0; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
}
//CHECK#8
if (obj.length !== 0) {
$ERROR('#8: var obj = {}; obj.length = -0; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length));
throw new Test262Error('#8: var obj = {}; obj.length = -0; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length));
} else {
if (1 / obj.length !== Number.POSITIVE_INFINITY) {
$ERROR('#8: var obj = {}; obj.length = -0; obj.pop = Array.prototype.pop; obj.pop(); obj.length === +0. Actual: ' + (obj.length));
throw new Test262Error('#8: var obj = {}; obj.length = -0; obj.pop = Array.prototype.pop; obj.pop(); obj.length === +0. Actual: ' + (obj.length));
}
}
@ -70,22 +70,22 @@ if (obj.length !== 0) {
obj.length = 0.5;
var pop = obj.pop();
if (pop !== undefined) {
$ERROR('#9: var obj = {}; obj.length = 0.5; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
throw new Test262Error('#9: var obj = {}; obj.length = 0.5; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
}
//CHECK#10
if (obj.length !== 0) {
$ERROR('#10: var obj = {}; obj.length = 0.5; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length));
throw new Test262Error('#10: var obj = {}; obj.length = 0.5; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length));
}
//CHECK#11
obj.length = new Number(0);
var pop = obj.pop();
if (pop !== undefined) {
$ERROR('#11: var obj = {}; obj.length = new Number(0); obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
throw new Test262Error('#11: var obj = {}; obj.length = new Number(0); obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
}
//CHECK#12
if (obj.length !== 0) {
$ERROR('#12: var obj = {}; obj.length = new Number(0); obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length));
throw new Test262Error('#12: var obj = {}; obj.length = new Number(0); obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length));
}

View File

@ -18,22 +18,22 @@ obj.pop = Array.prototype.pop;
obj.length = 2.5;
var pop = obj.pop();
if (pop !== undefined) {
$ERROR('#1: var obj = {}; obj.length = 2.5; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
throw new Test262Error('#1: var obj = {}; obj.length = 2.5; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
}
//CHECK#2
if (obj.length !== 1) {
$ERROR('#2: var obj = {}; obj.length = 2.5; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 1. Actual: ' + (obj.length));
throw new Test262Error('#2: var obj = {}; obj.length = 2.5; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 1. Actual: ' + (obj.length));
}
//CHECK#3
obj.length = new Number(2);
var pop = obj.pop();
if (pop !== undefined) {
$ERROR('#11: var obj = {}; obj.length = new Number(2); obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
throw new Test262Error('#11: var obj = {}; obj.length = new Number(2); obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
}
//CHECK#3
if (obj.length !== 1) {
$ERROR('#12: var obj = {}; obj.length = new Number(2); obj.pop = Array.prototype.pop; obj.pop(); obj.length === 1. Actual: ' + (obj.length));
throw new Test262Error('#12: var obj = {}; obj.length = new Number(2); obj.pop = Array.prototype.pop; obj.pop(); obj.length === 1. Actual: ' + (obj.length));
}

View File

@ -23,7 +23,7 @@ obj.length = {
};
var pop = obj.pop();
if (pop !== -1) {
$ERROR('#1: obj[0] = -1; obj.length = {valueOf: function() {return 1}} obj.pop() === -1. Actual: ' + (pop));
throw new Test262Error('#1: obj[0] = -1; obj.length = {valueOf: function() {return 1}} obj.pop() === -1. Actual: ' + (pop));
}
//CHECK#2
@ -38,7 +38,7 @@ obj.length = {
};
var pop = obj.pop();
if (pop !== -1) {
$ERROR('#0: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {return 0}} obj.pop() === -1. Actual: ' + (pop));
throw new Test262Error('#0: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {return 0}} obj.pop() === -1. Actual: ' + (pop));
}
//CHECK#3
@ -53,7 +53,7 @@ obj.length = {
};
var pop = obj.pop();
if (pop !== -1) {
$ERROR('#3: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {return {}}} obj.pop() === -1. Actual: ' + (pop));
throw new Test262Error('#3: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {return {}}} obj.pop() === -1. Actual: ' + (pop));
}
//CHECK#4
@ -69,14 +69,14 @@ try {
};
var pop = obj.pop();
if (pop !== -1) {
$ERROR('#4.1: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {throw "error"}}; obj.pop() === ",". Actual: ' + (pop));
throw new Test262Error('#4.1: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {throw "error"}}; obj.pop() === ",". Actual: ' + (pop));
}
}
catch (e) {
if (e === "error") {
$ERROR('#4.2: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {throw "error"}}; obj.pop() not throw "error"');
throw new Test262Error('#4.2: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {throw "error"}}; obj.pop() not throw "error"');
} else {
$ERROR('#4.3: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {throw "error"}}; obj.pop() not throw Error. Actual: ' + (e));
throw new Test262Error('#4.3: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {throw "error"}}; obj.pop() not throw Error. Actual: ' + (e));
}
}
@ -89,7 +89,7 @@ obj.length = {
};
var pop = obj.pop();
if (pop !== undefined) {
$ERROR('#5: obj[0] = -1; obj.length = {toString: function() {return 0}} obj.pop() === undefined. Actual: ' + (pop));
throw new Test262Error('#5: obj[0] = -1; obj.length = {toString: function() {return 0}} obj.pop() === undefined. Actual: ' + (pop));
}
//CHECK#6
@ -104,7 +104,7 @@ obj.length = {
}
var pop = obj.pop();
if (pop !== undefined) {
$ERROR('#6: obj[0] = -1; obj.length = {valueOf: function() {return {}}, toString: function() {return 0}} obj.pop() === undefined. Actual: ' + (pop));
throw new Test262Error('#6: obj[0] = -1; obj.length = {valueOf: function() {return {}}, toString: function() {return 0}} obj.pop() === undefined. Actual: ' + (pop));
}
//CHECK#7
@ -119,11 +119,11 @@ try {
}
};
var pop = obj.pop();
$ERROR('#7.1: obj[0] = -1; obj.length = {valueOf: function() {throw "error"}, toString: function() {return 0}}; obj.pop() throw "error". Actual: ' + (pop));
throw new Test262Error('#7.1: obj[0] = -1; obj.length = {valueOf: function() {throw "error"}, toString: function() {return 0}}; obj.pop() throw "error". Actual: ' + (pop));
}
catch (e) {
if (e !== "error") {
$ERROR('#7.2: obj[0] = -1; obj.length = {valueOf: function() {throw "error"}, toString: function() {return 0}}; obj.pop() throw "error". Actual: ' + (e));
throw new Test262Error('#7.2: obj[0] = -1; obj.length = {valueOf: function() {throw "error"}, toString: function() {return 0}}; obj.pop() throw "error". Actual: ' + (e));
}
}
@ -139,10 +139,10 @@ try {
}
};
var pop = obj.pop();
$ERROR('#8.1: obj[0] = -1; obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.pop() throw TypeError. Actual: ' + (pop));
throw new Test262Error('#8.1: obj[0] = -1; obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.pop() throw TypeError. Actual: ' + (pop));
}
catch (e) {
if ((e instanceof TypeError) !== true) {
$ERROR('#8.2: obj[0] = -1; obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.pop() throw TypeError. Actual: ' + (e));
throw new Test262Error('#8.2: obj[0] = -1; obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.pop() throw TypeError. Actual: ' + (e));
}
}

View File

@ -16,20 +16,20 @@ 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));
throw new Test262Error('#1: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.pop() === "y". 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));
throw new Test262Error('#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));
}
//CHECK#3
if (obj[0] !== "x") {
$ERROR('#3: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.pop(); obj[0] === "x". Actual: ' + (obj[0]));
throw new Test262Error('#3: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.pop(); obj[0] === "x". Actual: ' + (obj[0]));
}
//CHECK#4
if (obj[4294967295] !== undefined) {
$ERROR('#4: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.pop(); obj[4294967295] === undefined. Actual: ' + (obj[4294967295]));
throw new Test262Error('#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]));
}

View File

@ -16,20 +16,20 @@ 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));
throw new Test262Error('#1: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; obj.pop() === "y". 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));
throw new Test262Error('#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));
}
//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]));
throw new Test262Error('#3: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; obj.pop(); obj[0] === "x". Actual: ' + (obj[0]));
}
//CHECK#4
if (obj[4294967296] !== undefined) {
$ERROR('#4: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; obj.pop(); obj[4294967296] === undefined. Actual: ' + (obj[4294967296]));
throw new Test262Error('#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]));
}

View File

@ -15,15 +15,15 @@ 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));
throw new Test262Error('#1: var obj = {}; obj.pop = Array.prototype.pop; obj[4294967294] = "x"; obj.length = -1; obj.pop() === undefined. 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));
throw new Test262Error('#2: var obj = {}; obj.pop = Array.prototype.pop; obj[4294967294] = "x"; obj.length = -1; obj.pop(); obj.length === 0. 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]));
throw new Test262Error('#3: var obj = {}; obj.pop = Array.prototype.pop; obj[4294967294] = "x"; obj.length = -1; obj.pop(); obj[4294967294] === "x". Actual: ' + (obj[4294967294]));
}

View File

@ -16,12 +16,12 @@ x.length = 2;
//CHECK#1
var pop = x.pop();
if (pop !== 1) {
$ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.pop() === 1. Actual: ' + (pop));
throw new Test262Error('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.pop() === 1. Actual: ' + (pop));
}
//CHECK#2
if (x[1] !== 1) {
$ERROR('#2: Array.prototype[1] = 1; x = [0]; x.length = 2; x.pop(); x[1] === 1. Actual: ' + (x[1]));
throw new Test262Error('#2: Array.prototype[1] = 1; x = [0]; x.length = 2; x.pop(); x[1] === 1. Actual: ' + (x[1]));
}
Object.prototype[1] = 1;
@ -34,21 +34,21 @@ x = {
//CHECK#3
var pop = x.pop();
if (pop !== 1) {
$ERROR('#3: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0}; x.pop() === 1. Actual: ' + (pop));
throw new Test262Error('#3: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0}; x.pop() === 1. Actual: ' + (pop));
}
//CHECK#4
if (x[1] !== 1) {
$ERROR('#4: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0}; x.pop(); x[1] === 1. Actual: ' + (x[1]));
throw new Test262Error('#4: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0}; x.pop(); x[1] === 1. Actual: ' + (x[1]));
}
//CHECK#6
if (x.length !== 1) {
$ERROR('#6: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0}; x.pop(); x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#6: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0}; x.pop(); x.length === 1. Actual: ' + (x.length));
}
//CHECK#7
delete x.length;
if (x.length !== 2) {
$ERROR('#7: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0}; x.pop(); delete x; x.length === 2. Actual: ' + (x.length));
throw new Test262Error('#7: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0}; x.pop(); delete x; x.length === 2. Actual: ' + (x.length));
}

View File

@ -16,12 +16,12 @@ x.length = 2;
//CHECK#1
var pop = x.pop();
if (pop !== 1) {
$ERROR('#1: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.pop() === 1. Actual: ' + (pop));
throw new Test262Error('#1: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.pop() === 1. Actual: ' + (pop));
}
//CHECK#2
if (x[1] !== -1) {
$ERROR('#2: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.pop(); x[1] === -1. Actual: ' + (x[1]));
throw new Test262Error('#2: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.pop(); x[1] === -1. Actual: ' + (x[1]));
}
Object.prototype[1] = -1;
@ -35,21 +35,21 @@ x = {
//CHECK#3
var pop = x.pop();
if (pop !== 1) {
$ERROR('#3: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0,1:1}; x.pop() === 1. Actual: ' + (pop));
throw new Test262Error('#3: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0,1:1}; x.pop() === 1. Actual: ' + (pop));
}
//CHECK#4
if (x[1] !== -1) {
$ERROR('#4: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0,1:1}; x.pop(); x[1] === -1. Actual: ' + (x[1]));
throw new Test262Error('#4: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0,1:1}; x.pop(); x[1] === -1. Actual: ' + (x[1]));
}
//CHECK#6
if (x.length !== 1) {
$ERROR('#6: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0,1:1}; x.pop(); x.length === 1. Actual: ' + (x.length));
throw new Test262Error('#6: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0,1:1}; x.pop(); x.length === 1. Actual: ' + (x.length));
}
//CHECK#7
delete x.length;
if (x.length !== 2) {
$ERROR('#7: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0,1:1}; x.pop(); delete x; x.length === 2. Actual: ' + (x.length));
throw new Test262Error('#7: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0,1:1}; x.pop(); delete x; x.length === 2. Actual: ' + (x.length));
}

View File

@ -13,9 +13,9 @@ description: >
try {
new Array.prototype.pop();
$ERROR('#1.1: new Array.prototype.pop() throw TypeError. Actual: ' + (new Array.prototype.pop()));
throw new Test262Error('#1.1: new Array.prototype.pop() throw TypeError. Actual: ' + (new Array.prototype.pop()));
} catch (e) {
if ((e instanceof TypeError) !== true) {
$ERROR('#1.2: new Array.prototype.pop() throw TypeError. Actual: ' + (e));
throw new Test262Error('#1.2: new Array.prototype.pop() throw TypeError. Actual: ' + (e));
}
}

View File

@ -14,37 +14,37 @@ description: Checking case when push is given no arguments or one argument
var x = new Array();
var push = x.push(1);
if (push !== 1) {
$ERROR('#1: x = new Array(); x.push(1) === 1. Actual: ' + (push));
throw new Test262Error('#1: x = new Array(); x.push(1) === 1. Actual: ' + (push));
}
//CHECK#2
if (x[0] !== 1) {
$ERROR('#2: x = new Array(); x.push(1); x[0] === 1. Actual: ' + (x[0]));
throw new Test262Error('#2: x = new Array(); x.push(1); x[0] === 1. Actual: ' + (x[0]));
}
//CHECK#3
var push = x.push();
if (push !== 1) {
$ERROR('#3: x = new Array(); x.push(1); x.push() === 1. Actual: ' + (push));
throw new Test262Error('#3: x = new Array(); x.push(1); x.push() === 1. Actual: ' + (push));
}
//CHECK#4
if (x[1] !== undefined) {
$ERROR('#4: x = new Array(); x.push(1); x.push(); x[1] === unedfined. Actual: ' + (x[1]));
throw new Test262Error('#4: x = new Array(); x.push(1); x.push(); x[1] === unedfined. Actual: ' + (x[1]));
}
//CHECK#5
var push = x.push(-1);
if (push !== 2) {
$ERROR('#5: x = new Array(); x.push(1); x.push(); x.push(-1) === 2. Actual: ' + (push));
throw new Test262Error('#5: x = new Array(); x.push(1); x.push(); x.push(-1) === 2. Actual: ' + (push));
}
//CHECK#6
if (x[1] !== -1) {
$ERROR('#6: x = new Array(); x.push(1); x.push(-1); x[1] === -1. Actual: ' + (x[1]));
throw new Test262Error('#6: x = new Array(); x.push(1); x.push(-1); x[1] === -1. Actual: ' + (x[1]));
}
//CHECK#7
if (x.length !== 2) {
$ERROR('#7: x = new Array(); x.push(1); x.push(); x.push(-1); x.length === 2. Actual: ' + (x.length));
throw new Test262Error('#7: x = new Array(); x.push(1); x.push(); x.push(-1); x.length === 2. Actual: ' + (x.length));
}

View File

@ -13,47 +13,47 @@ description: Checking case when push is given many arguments
//CHECK#1
var x = [];
if (x.length !== 0) {
$ERROR('#1: x = []; x.length === 0. Actual: ' + (x.length));
throw new Test262Error('#1: x = []; x.length === 0. Actual: ' + (x.length));
}
//CHECK#2
x[0] = 0;
var push = x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1);
if (push !== 6) {
$ERROR('#2: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1) === 6. Actual: ' + (push));
throw new Test262Error('#2: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1) === 6. Actual: ' + (push));
}
//CHECK#3
if (x[0] !== 0) {
$ERROR('#3: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[0] === 0. Actual: ' + (x[0]));
throw new Test262Error('#3: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[0] === 0. Actual: ' + (x[0]));
}
//CHECK#4
if (x[1] !== true) {
$ERROR('#4: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[1] === true. Actual: ' + (x[1]));
throw new Test262Error('#4: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[1] === true. Actual: ' + (x[1]));
}
//CHECK#5
if (x[2] !== Number.POSITIVE_INFINITY) {
$ERROR('#5: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[2] === Number.POSITIVE_INFINITY. Actual: ' + (x[2]));
throw new Test262Error('#5: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[2] === Number.POSITIVE_INFINITY. Actual: ' + (x[2]));
}
//CHECK#6
if (x[3] !== "NaN") {
$ERROR('#6: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[3] === "NaN". Actual: ' + (x[3]));
throw new Test262Error('#6: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[3] === "NaN". Actual: ' + (x[3]));
}
//CHECK#7
if (x[4] !== "1") {
$ERROR('#7: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[4] === "1". Actual: ' + (x[4]));
throw new Test262Error('#7: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[4] === "1". Actual: ' + (x[4]));
}
//CHECK#8
if (x[5] !== -1) {
$ERROR('#8: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[5] === -1. Actual: ' + (x[5]));
throw new Test262Error('#8: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[5] === -1. Actual: ' + (x[5]));
}
//CHECK#9
if (x.length !== 6) {
$ERROR('#9: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x.length === 6. Actual: ' + (x.length));
throw new Test262Error('#9: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x.length === 6. Actual: ' + (x.length));
}

View File

@ -16,20 +16,20 @@ var obj = {};
obj.push = Array.prototype.push;
if (obj.length !== undefined) {
$ERROR('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length));
throw new Test262Error('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length));
} else {
//CHECK#1
var push = obj.push(-1);
if (push !== 1) {
$ERROR('#1: var obj = {}; obj.push = Array.prototype.push; obj.push(-1) === 1. Actual: ' + (push));
throw new Test262Error('#1: var obj = {}; obj.push = Array.prototype.push; obj.push(-1) === 1. Actual: ' + (push));
}
//CHECK#2
if (obj.length !== 1) {
$ERROR('#2: var obj = {}; obj.push = Array.prototype.push; obj.push(-1); obj.length === 1. Actual: ' + (obj.length));
throw new Test262Error('#2: var obj = {}; obj.push = Array.prototype.push; obj.push(-1); obj.length === 1. Actual: ' + (obj.length));
}
//CHECK#3
if (obj["0"] !== -1) {
$ERROR('#3: var obj = {}; obj.push = Array.prototype.push; obj.push(-1); obj["0"] === -1. Actual: ' + (obj["0"]));
throw new Test262Error('#3: var obj = {}; obj.push = Array.prototype.push; obj.push(-1); obj["0"] === -1. Actual: ' + (obj["0"]));
}
}
@ -37,32 +37,32 @@ if (obj.length !== undefined) {
obj.length = undefined;
var push = obj.push(-4);
if (push !== 1) {
$ERROR('#4: var obj = {}; obj.length = undefined; obj.push = Array.prototype.push; obj.push(-4) === 1. Actual: ' + (push));
throw new Test262Error('#4: var obj = {}; obj.length = undefined; obj.push = Array.prototype.push; obj.push(-4) === 1. Actual: ' + (push));
}
//CHECK#5
if (obj.length !== 1) {
$ERROR('#5: var obj = {}; obj.length = undefined; obj.push = Array.prototype.push; obj.push(-4); obj.length === 1. Actual: ' + (obj.length));
throw new Test262Error('#5: var obj = {}; obj.length = undefined; obj.push = Array.prototype.push; obj.push(-4); obj.length === 1. Actual: ' + (obj.length));
}
//CHECK#6
if (obj["0"] !== -4) {
$ERROR('#6: var obj = {}; obj.length = undefined; obj.push = Array.prototype.push; obj.push(-4); obj["0"] === -4. Actual: ' + (obj["0"]));
throw new Test262Error('#6: var obj = {}; obj.length = undefined; obj.push = Array.prototype.push; obj.push(-4); obj["0"] === -4. Actual: ' + (obj["0"]));
}
//CHECK#7
obj.length = null
var push = obj.push(-7);
if (push !== 1) {
$ERROR('#7: var obj = {}; obj.length = null; obj.push = Array.prototype.push; obj.push(-7) === 1. Actual: ' + (push));
throw new Test262Error('#7: var obj = {}; obj.length = null; obj.push = Array.prototype.push; obj.push(-7) === 1. Actual: ' + (push));
}
//CHECK#8
if (obj.length !== 1) {
$ERROR('#8: var obj = {}; obj.length = null; obj.push = Array.prototype.push; obj.push(-7); obj.length === 1. Actual: ' + (obj.length));
throw new Test262Error('#8: var obj = {}; obj.length = null; obj.push = Array.prototype.push; obj.push(-7); obj.length === 1. Actual: ' + (obj.length));
}
//CHECK#9
if (obj["0"] !== -7) {
$ERROR('#9: var obj = {}; obj.length = null; obj.push = Array.prototype.push; obj.push(-7); obj["0"] === -7. Actual: ' + (obj["0"]));
throw new Test262Error('#9: var obj = {}; obj.length = null; obj.push = Array.prototype.push; obj.push(-7); obj["0"] === -7. Actual: ' + (obj["0"]));
}

View File

@ -19,17 +19,17 @@ obj.push = Array.prototype.push;
obj.length = NaN;
var push = obj.push(-1);
if (push !== 1) {
$ERROR('#1: var obj = {}; obj.length = NaN; obj.push = Array.prototype.push; obj.push(-1) === 1. Actual: ' + (push));
throw new Test262Error('#1: var obj = {}; obj.length = NaN; obj.push = Array.prototype.push; obj.push(-1) === 1. Actual: ' + (push));
}
//CHECK#2
if (obj.length !== 1) {
$ERROR('#2: var obj = {}; obj.length = NaN; obj.push = Array.prototype.push; obj.push(-1); obj.length === 1. Actual: ' + (obj.length));
throw new Test262Error('#2: var obj = {}; obj.length = NaN; obj.push = Array.prototype.push; obj.push(-1); obj.length === 1. Actual: ' + (obj.length));
}
//CHECK#3
if (obj["0"] !== -1) {
$ERROR('#3: var obj = {}; obj.length = NaN; obj.push = Array.prototype.push; obj.push(-1); obj["0"] === -1. Actual: ' + (obj["0"]));
throw new Test262Error('#3: var obj = {}; obj.length = NaN; obj.push = Array.prototype.push; obj.push(-1); obj["0"] === -1. Actual: ' + (obj["0"]));
}
//CHECK#4
@ -40,78 +40,78 @@ assert.throws(TypeError, function() {
//CHECK#5
if (obj.length !== Number.POSITIVE_INFINITY) {
$ERROR('#6: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-4); obj.length === Number.POSITIVE_INFINITY. Actual: ' + (obj.length));
throw new Test262Error('#6: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-4); obj.length === Number.POSITIVE_INFINITY. Actual: ' + (obj.length));
}
//CHECK#6
if (obj[9007199254740991] !== undefined) {
$ERROR('#6: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-4); obj[9007199254740991] === undefined. Actual: ' + (obj["9007199254740991"]));
throw new Test262Error('#6: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-4); obj[9007199254740991] === undefined. Actual: ' + (obj["9007199254740991"]));
}
//CHECK#7
obj.length = Number.NEGATIVE_INFINITY;
var push = obj.push(-7);
if (push !== 1) {
$ERROR('#7: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-7) === 1. Actual: ' + (push));
throw new Test262Error('#7: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-7) === 1. Actual: ' + (push));
}
//CHECK#8
if (obj.length !== 1) {
$ERROR('#8: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-7); obj.length === 1. Actual: ' + (obj.length));
throw new Test262Error('#8: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-7); obj.length === 1. Actual: ' + (obj.length));
}
//CHECK#9
if (obj["0"] !== -7) {
$ERROR('#9: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-7); obj["0"] === -7. Actual: ' + (obj["0"]));
throw new Test262Error('#9: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-7); obj["0"] === -7. Actual: ' + (obj["0"]));
}
//CHECK#10
obj.length = 0.5;
var push = obj.push(-10);
if (push !== 1) {
$ERROR('#10: var obj = {}; obj.length = 0.5; obj.push = Array.prototype.push; obj.push(-10) === 1. Actual: ' + (push));
throw new Test262Error('#10: var obj = {}; obj.length = 0.5; obj.push = Array.prototype.push; obj.push(-10) === 1. Actual: ' + (push));
}
//CHECK#11
if (obj.length !== 1) {
$ERROR('#11: var obj = {}; obj.length = 0.5; obj.push = Array.prototype.push; obj.push(-10); obj.length === 1. Actual: ' + (obj.length));
throw new Test262Error('#11: var obj = {}; obj.length = 0.5; obj.push = Array.prototype.push; obj.push(-10); obj.length === 1. Actual: ' + (obj.length));
}
//CHECK#12
if (obj["0"] !== -10) {
$ERROR('#12: var obj = {}; obj.length = 0.5; obj.push = Array.prototype.push; obj.push(-10); obj["0"] === -10. Actual: ' + (obj["0"]));
throw new Test262Error('#12: var obj = {}; obj.length = 0.5; obj.push = Array.prototype.push; obj.push(-10); obj["0"] === -10. Actual: ' + (obj["0"]));
}
//CHECK#13
obj.length = 1.5;
var push = obj.push(-13);
if (push !== 2) {
$ERROR('#13: var obj = {}; obj.length = 1.5; obj.push = Array.prototype.push; obj.push(-13) === 2. Actual: ' + (push));
throw new Test262Error('#13: var obj = {}; obj.length = 1.5; obj.push = Array.prototype.push; obj.push(-13) === 2. Actual: ' + (push));
}
//CHECK#14
if (obj.length !== 2) {
$ERROR('#14: var obj = {}; obj.length = 1.5; obj.push = Array.prototype.push; obj.push(-13); obj.length === 2. Actual: ' + (obj.length));
throw new Test262Error('#14: var obj = {}; obj.length = 1.5; obj.push = Array.prototype.push; obj.push(-13); obj.length === 2. Actual: ' + (obj.length));
}
//CHECK#15
if (obj["1"] !== -13) {
$ERROR('#15: var obj = {}; obj.length = 1.5; obj.push = Array.prototype.push; obj.push(-13); obj["1"] === -13. Actual: ' + (obj["1"]));
throw new Test262Error('#15: var obj = {}; obj.length = 1.5; obj.push = Array.prototype.push; obj.push(-13); obj["1"] === -13. Actual: ' + (obj["1"]));
}
//CHECK#16
obj.length = new Number(0);
var push = obj.push(-16);
if (push !== 1) {
$ERROR('#16: var obj = {}; obj.length = new Number(0); obj.push = Array.prototype.push; obj.push(-16) === 1. Actual: ' + (push));
throw new Test262Error('#16: var obj = {}; obj.length = new Number(0); obj.push = Array.prototype.push; obj.push(-16) === 1. Actual: ' + (push));
}
//CHECK#17
if (obj.length !== 1) {
$ERROR('#17: var obj = {}; obj.length = new Number(0); obj.push = Array.prototype.push; obj.push(-16); obj.length === 1. Actual: ' + (obj.length));
throw new Test262Error('#17: var obj = {}; obj.length = new Number(0); obj.push = Array.prototype.push; obj.push(-16); obj.length === 1. Actual: ' + (obj.length));
}
//CHECK#18
if (obj["0"] !== -16) {
$ERROR('#18: var obj = {}; obj.length = new Number(0); obj.push = Array.prototype.push; obj.push(-16); obj["0"] === -16. Actual: ' + (obj["0"]));
throw new Test262Error('#18: var obj = {}; obj.length = new Number(0); obj.push = Array.prototype.push; obj.push(-16); obj["0"] === -16. Actual: ' + (obj["0"]));
}

View File

@ -22,7 +22,7 @@ obj.length = {
};
var push = obj.push();
if (push !== 3) {
$ERROR('#1: obj.length = {valueOf: function() {return 3}} obj.push() === 3. Actual: ' + (push));
throw new Test262Error('#1: obj.length = {valueOf: function() {return 3}} obj.push() === 3. Actual: ' + (push));
}
//CHECK#2
@ -36,7 +36,7 @@ obj.length = {
};
var push = obj.push();
if (push !== 3) {
$ERROR('#0: obj.length = {valueOf: function() {return 3}, toString: function() {return 1}} obj.push() === 3. Actual: ' + (push));
throw new Test262Error('#0: obj.length = {valueOf: function() {return 3}, toString: function() {return 1}} obj.push() === 3. Actual: ' + (push));
}
//CHECK#3
@ -50,7 +50,7 @@ obj.length = {
};
var push = obj.push();
if (push !== 3) {
$ERROR('#1: obj.length = {valueOf: function() {return 3}, toString: function() {return {}}} obj.push() === 3. Actual: ' + (push));
throw new Test262Error('#1: obj.length = {valueOf: function() {return 3}, toString: function() {return {}}} obj.push() === 3. Actual: ' + (push));
}
//CHECK#4
@ -66,14 +66,14 @@ try {
};
var push = obj.push();
if (push !== 3) {
$ERROR('#4.1: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.push() === ",". Actual: ' + (push));
throw new Test262Error('#4.1: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.push() === ",". Actual: ' + (push));
}
}
catch (e) {
if (e === "error") {
$ERROR('#4.2: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.push() not throw "error"');
throw new Test262Error('#4.2: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.push() not throw "error"');
} else {
$ERROR('#4.3: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.push() not throw Error. Actual: ' + (e));
throw new Test262Error('#4.3: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.push() not throw Error. Actual: ' + (e));
}
}
@ -85,7 +85,7 @@ obj.length = {
};
var push = obj.push();
if (push !== 1) {
$ERROR('#5: obj.length = {toString: function() {return 1}} obj.push() === 1. Actual: ' + (push));
throw new Test262Error('#5: obj.length = {toString: function() {return 1}} obj.push() === 1. Actual: ' + (push));
}
//CHECK#6
@ -99,7 +99,7 @@ obj.length = {
}
var push = obj.push();
if (push !== 1) {
$ERROR('#6: obj.length = {valueOf: function() {return {}}, toString: function() {return 1}} obj.push() === 1. Actual: ' + (push));
throw new Test262Error('#6: obj.length = {valueOf: function() {return {}}, toString: function() {return 1}} obj.push() === 1. Actual: ' + (push));
}
//CHECK#7
@ -114,11 +114,11 @@ try {
}
};
var push = obj.push();
$ERROR('#7.1: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; obj.push() throw "error". Actual: ' + (push));
throw new Test262Error('#7.1: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; obj.push() throw "error". Actual: ' + (push));
}
catch (e) {
if (e !== "error") {
$ERROR('#7.2: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; obj.push() throw "error". Actual: ' + (e));
throw new Test262Error('#7.2: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; obj.push() throw "error". Actual: ' + (e));
}
}
@ -134,10 +134,10 @@ try {
}
};
var push = obj.push();
$ERROR('#8.1: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.push() throw TypeError. Actual: ' + (push));
throw new Test262Error('#8.1: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.push() throw TypeError. Actual: ' + (push));
}
catch (e) {
if ((e instanceof TypeError) !== true) {
$ERROR('#8.2: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.push() throw TypeError. Actual: ' + (e));
throw new Test262Error('#8.2: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.push() throw TypeError. Actual: ' + (e));
}
}

View File

@ -13,25 +13,25 @@ x.length = 4294967295;
//CHECK#1
var push = x.push();
if (push !== 4294967295) {
$ERROR('#1: x = []; x.length = 4294967295; x.push() === 4294967295. Actual: ' + (push));
throw new Test262Error('#1: x = []; x.length = 4294967295; x.push() === 4294967295. Actual: ' + (push));
}
//CHECK#2
try {
x.push("x");
$ERROR('#2.1: x = []; x.length = 4294967295; x.push("x") throw RangeError. Actual: ' + (push));
throw new Test262Error('#2.1: x = []; x.length = 4294967295; x.push("x") throw RangeError. Actual: ' + (push));
} catch (e) {
if ((e instanceof RangeError) !== true) {
$ERROR('#2.2: x = []; x.length = 4294967295; x.push("x") throw RangeError. Actual: ' + (e));
throw new Test262Error('#2.2: x = []; x.length = 4294967295; x.push("x") throw RangeError. Actual: ' + (e));
}
}
//CHECK#3
if (x[4294967295] !== "x") {
$ERROR('#3: x = []; x.length = 4294967295; try {x.push("x")}catch(e){}; x[4294967295] === "x". Actual: ' + (x[4294967295]));
throw new Test262Error('#3: x = []; x.length = 4294967295; try {x.push("x")}catch(e){}; x[4294967295] === "x". Actual: ' + (x[4294967295]));
}
//CHECK#4
if (x.length !== 4294967295) {
$ERROR('#4: x = []; x.length = 4294967295; try {x.push("x")}catch(e){}; x.length === 4294967295. Actual: ' + (x.length));
throw new Test262Error('#4: x = []; x.length = 4294967295; try {x.push("x")}catch(e){}; x.length === 4294967295. Actual: ' + (x.length));
}

Some files were not shown because too many files have changed in this diff Show More