mirror of https://github.com/tc39/test262.git
Merge pull request #3143 from tc39/rwaldron/transform-legacy-001
Transform legacy format to harness assertions: test/built-ins/A*/**/*.js
This commit is contained in:
commit
2c4f2665ec
|
@ -12,7 +12,6 @@ description: >
|
|||
this property
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
Array.prototype.myproperty = 42;
|
||||
var x = Array();
|
||||
assert.sameValue(x.myproperty, 42, 'The value of x.myproperty is expected to be 42');
|
||||
|
|
|
@ -10,12 +10,10 @@ es5id: 15.4.1_A1.1_T2
|
|||
description: Array.prototype.toString = Object.prototype.toString
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
Array.prototype.toString = Object.prototype.toString;
|
||||
var x = Array();
|
||||
assert.sameValue(x.toString(), "[object Array]", 'x.toString() must return "[object Array]"');
|
||||
|
||||
//CHECK#2
|
||||
Array.prototype.toString = Object.prototype.toString;
|
||||
var x = Array(0, 1, 2);
|
||||
assert.sameValue(x.toString(), "[object Array]", 'x.toString() must return "[object Array]"');
|
||||
|
|
|
@ -7,12 +7,10 @@ es5id: 15.4.1_A1.2_T1
|
|||
description: Checking use Object.prototype.toString
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = Array();
|
||||
x.getClass = Object.prototype.toString;
|
||||
assert.sameValue(x.getClass(), "[object Array]", 'x.getClass() must return "[object Array]"');
|
||||
|
||||
//CHECK#2
|
||||
var x = Array(0, 1, 2);
|
||||
x.getClass = Object.prototype.toString;
|
||||
assert.sameValue(x.getClass(), "[object Array]", 'x.getClass() must return "[object Array]"');
|
||||
|
|
|
@ -12,7 +12,6 @@ es5id: 15.4.1_A2.2_T1
|
|||
description: Checking correct work this algorithm
|
||||
---*/
|
||||
|
||||
//CHECK#
|
||||
var x = Array(
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
||||
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
|
||||
|
|
|
@ -12,7 +12,6 @@ description: >
|
|||
this property
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
Array.prototype.myproperty = 1;
|
||||
var x = new Array();
|
||||
assert.sameValue(x.myproperty, 1, 'The value of x.myproperty is expected to be 1');
|
||||
|
|
|
@ -10,12 +10,10 @@ es5id: 15.4.2.1_A1.1_T2
|
|||
description: Array.prototype.toString = Object.prototype.toString
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
Array.prototype.toString = Object.prototype.toString;
|
||||
var x = new Array();
|
||||
assert.sameValue(x.toString(), "[object Array]", 'x.toString() must return "[object Array]"');
|
||||
|
||||
//CHECK#2
|
||||
Array.prototype.toString = Object.prototype.toString;
|
||||
var x = new Array(0, 1, 2);
|
||||
assert.sameValue(x.toString(), "[object Array]", 'x.toString() must return "[object Array]"');
|
||||
|
|
|
@ -7,12 +7,10 @@ es5id: 15.4.2.1_A1.2_T1
|
|||
description: Checking use Object.prototype.toString
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = new Array();
|
||||
x.getClass = Object.prototype.toString;
|
||||
assert.sameValue(x.getClass(), "[object Array]", 'x.getClass() must return "[object Array]"');
|
||||
|
||||
//CHECK#2
|
||||
var x = new Array(0, 1, 2);
|
||||
x.getClass = Object.prototype.toString;
|
||||
assert.sameValue(x.getClass(), "[object Array]", 'x.getClass() must return "[object Array]"');
|
||||
|
|
|
@ -12,7 +12,6 @@ es5id: 15.4.2.1_A2.2_T1
|
|||
description: Checking correct work this algorithm
|
||||
---*/
|
||||
|
||||
//CHECK#
|
||||
var x = new Array(
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
||||
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
|
||||
|
|
|
@ -9,7 +9,6 @@ es5id: 15.4.3_A1.1_T2
|
|||
description: Function.prototype.toString = Object.prototype.toString
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
Function.prototype.toString = Object.prototype.toString;
|
||||
|
||||
assert.sameValue(
|
||||
|
|
|
@ -11,11 +11,9 @@ es5id: 15.4.5.1_A1.2_T2
|
|||
description: Checking an inherited property
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
Array.prototype[2] = -1;
|
||||
var x = [0, 1, 2];
|
||||
assert.sameValue(x[2], 2, 'The value of x[2] is expected to be 2');
|
||||
|
||||
//CHECK#2
|
||||
x.length = 2;
|
||||
assert.sameValue(x[2], -1, 'The value of x[2] is expected to be -1');
|
||||
|
|
|
@ -9,19 +9,16 @@ es5id: 15.4.5.1_A2.1_T1
|
|||
description: P in [4294967295, -1, true]
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [];
|
||||
x[4294967295] = 1;
|
||||
assert.sameValue(x.length, 0, 'The value of x.length is expected to be 0');
|
||||
assert.sameValue(x[4294967295], 1, 'The value of x[4294967295] is expected to be 1');
|
||||
|
||||
//CHECK#2
|
||||
x = [];
|
||||
x[-1] = 1;
|
||||
assert.sameValue(x.length, 0, 'The value of x.length is expected to be 0');
|
||||
assert.sameValue(x[-1], 1, 'The value of x[-1] is expected to be 1');
|
||||
|
||||
//CHECK#3
|
||||
x = [];
|
||||
x[true] = 1;
|
||||
assert.sameValue(x.length, 0, 'The value of x.length is expected to be 0');
|
||||
|
|
|
@ -9,15 +9,12 @@ es5id: 15.4.5.1_A2.2_T1
|
|||
description: length === 100, P in [0, 98, 99]
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = Array(100);
|
||||
x[0] = 1;
|
||||
assert.sameValue(x.length, 100, 'The value of x.length is expected to be 100');
|
||||
|
||||
//CHECK#2
|
||||
x[98] = 1;
|
||||
assert.sameValue(x.length, 100, 'The value of x.length is expected to be 100');
|
||||
|
||||
//CHECK#3
|
||||
x[99] = 1;
|
||||
assert.sameValue(x.length, 100, 'The value of x.length is expected to be 100');
|
||||
|
|
|
@ -9,11 +9,9 @@ es5id: 15.4.5.1_A2.3_T1
|
|||
description: length = 100, P in [100, 199]
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = Array(100);
|
||||
x[100] = 1;
|
||||
assert.sameValue(x.length, 101, 'The value of x.length is expected to be 101');
|
||||
|
||||
//CHECK#2
|
||||
x[199] = 1;
|
||||
assert.sameValue(x.length, 200, 'The value of x.length is expected to be 200');
|
||||
|
|
|
@ -10,22 +10,17 @@ es5id: 15.4.5.2_A1_T1
|
|||
description: Checking boundary points
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [];
|
||||
assert.sameValue(x.length, 0, 'The value of x.length is expected to be 0');
|
||||
|
||||
//CHECK#2
|
||||
x[0] = 1;
|
||||
assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1');
|
||||
|
||||
//CHECK#3
|
||||
x[1] = 1;
|
||||
assert.sameValue(x.length, 2, 'The value of x.length is expected to be 2');
|
||||
|
||||
//CHECK#4
|
||||
x[2147483648] = 1;
|
||||
assert.sameValue(x.length, 2147483649, 'The value of x.length is expected to be 2147483649');
|
||||
|
||||
//CHECK#5
|
||||
x[4294967294] = 1;
|
||||
assert.sameValue(x.length, 4294967295, 'The value of x.length is expected to be 4294967295');
|
||||
|
|
|
@ -10,12 +10,10 @@ es5id: 15.4.5.2_A1_T2
|
|||
description: P = "2^32 - 1" is not index array
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [];
|
||||
x[4294967295] = 1;
|
||||
assert.sameValue(x.length, 0, 'The value of x.length is expected to be 0');
|
||||
|
||||
//CHECK#2
|
||||
var y = [];
|
||||
y[1] = 1;
|
||||
y[4294967295] = 1;
|
||||
|
|
|
@ -9,18 +9,14 @@ es5id: 15.4.5.2_A2_T1
|
|||
description: Checking length property
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [];
|
||||
assert.sameValue(x.length, 0, 'The value of x.length is expected to be 0');
|
||||
|
||||
//CHECK#2
|
||||
x[0] = 1;
|
||||
assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1');
|
||||
|
||||
//CHECK#3
|
||||
x[1] = 1;
|
||||
assert.sameValue(x.length, 2, 'The value of x.length is expected to be 2');
|
||||
|
||||
//CHECK#4
|
||||
x[9] = 1;
|
||||
assert.sameValue(x.length, 10, 'The value of x.length is expected to be 10');
|
||||
|
|
|
@ -11,12 +11,10 @@ description: >
|
|||
is an array index
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [];
|
||||
x.length = 1;
|
||||
assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1');
|
||||
|
||||
//CHECK#2
|
||||
x[5] = 1;
|
||||
x.length = 10;
|
||||
assert.sameValue(x.length, 10, 'The value of x.length is expected to be 10');
|
||||
|
|
|
@ -11,7 +11,6 @@ description: >
|
|||
is an array index
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [];
|
||||
x[1] = 1;
|
||||
x[3] = 3;
|
||||
|
@ -21,14 +20,11 @@ assert.sameValue(x.length, 4, 'The value of x.length is expected to be 4');
|
|||
assert.sameValue(x[5], undefined, 'The value of x[5] is expected to equal undefined');
|
||||
assert.sameValue(x[3], 3, 'The value of x[3] is expected to be 3');
|
||||
|
||||
//CHECK#4
|
||||
x.length = new Number(6);
|
||||
assert.sameValue(x[5], undefined, 'The value of x[5] is expected to equal undefined');
|
||||
|
||||
//CHECK#5
|
||||
x.length = 0;
|
||||
assert.sameValue(x[0], undefined, 'The value of x[0] is expected to equal undefined');
|
||||
|
||||
//CHECK#6
|
||||
x.length = 1;
|
||||
assert.sameValue(x[1], undefined, 'The value of x[1] is expected to equal undefined');
|
||||
|
|
|
@ -9,12 +9,10 @@ es5id: 15.4.5.2_A3_T3
|
|||
description: "[[Put]] (length, 4294967296)"
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [];
|
||||
x.length = 4294967295;
|
||||
assert.sameValue(x.length, 4294967295, 'The value of x.length is expected to be 4294967295');
|
||||
|
||||
//CHECK#2
|
||||
try {
|
||||
x = [];
|
||||
x.length = 4294967296;
|
||||
|
|
|
@ -9,7 +9,6 @@ es5id: 15.4_A1.1_T10
|
|||
description: Array index is power of two
|
||||
---*/
|
||||
|
||||
//CHECK#
|
||||
var x = [];
|
||||
var k = 1;
|
||||
for (var i = 0; i < 32; i++) {
|
||||
|
|
|
@ -9,12 +9,10 @@ es5id: 15.4_A1.1_T4
|
|||
description: Checking for string primitive
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [];
|
||||
x["0"] = 0;
|
||||
assert.sameValue(x[0], 0, 'The value of x[0] is expected to be 0');
|
||||
|
||||
//CHECK#2
|
||||
var y = [];
|
||||
y["1"] = 1;
|
||||
assert.sameValue(y[1], 1, 'The value of y[1] is expected to be 1');
|
||||
|
|
|
@ -9,13 +9,11 @@ es5id: 15.4_A1.1_T5
|
|||
description: Checking for null and undefined
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [];
|
||||
x[null] = 0;
|
||||
assert.sameValue(x[0], undefined, 'The value of x[0] is expected to equal undefined');
|
||||
assert.sameValue(x["null"], 0, 'The value of x["null"] is expected to be 0');
|
||||
|
||||
//CHECK#3
|
||||
var y = [];
|
||||
y[undefined] = 0;
|
||||
assert.sameValue(y[0], undefined, 'The value of y[0] is expected to equal undefined');
|
||||
|
|
|
@ -9,13 +9,11 @@ es5id: 15.4_A1.1_T6
|
|||
description: Checking for Boolean object
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [];
|
||||
x[new Boolean(true)] = 1;
|
||||
assert.sameValue(x[1], undefined, 'The value of x[1] is expected to equal undefined');
|
||||
assert.sameValue(x["true"], 1, 'The value of x["true"] is expected to be 1');
|
||||
|
||||
//CHECK#3
|
||||
x[new Boolean(false)] = 0;
|
||||
assert.sameValue(x[0], undefined, 'The value of x[0] is expected to equal undefined');
|
||||
assert.sameValue(x["false"], 0, 'The value of x["false"] is expected to be 0');
|
||||
|
|
|
@ -9,17 +9,14 @@ es5id: 15.4_A1.1_T7
|
|||
description: Checking for Number object
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [];
|
||||
x[new Number(0)] = 0;
|
||||
assert.sameValue(x[0], 0, 'The value of x[0] is expected to be 0');
|
||||
|
||||
//CHECK#2
|
||||
var y = [];
|
||||
y[new Number(1)] = 1;
|
||||
assert.sameValue(y[1], 1, 'The value of y[1] is expected to be 1');
|
||||
|
||||
//CHECK#3
|
||||
var z = [];
|
||||
z[new Number(1.1)] = 1;
|
||||
assert.sameValue(z["1.1"], 1, 'The value of z["1.1"] is expected to be 1');
|
||||
|
|
|
@ -9,17 +9,14 @@ es5id: 15.4_A1.1_T8
|
|||
description: Checking for Number object
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [];
|
||||
x[new String("0")] = 0;
|
||||
assert.sameValue(x[0], 0, 'The value of x[0] is expected to be 0');
|
||||
|
||||
//CHECK#2
|
||||
var y = [];
|
||||
y[new String("1")] = 1;
|
||||
assert.sameValue(y[1], 1, 'The value of y[1] is expected to be 1');
|
||||
|
||||
//CHECK#3
|
||||
var z = [];
|
||||
z[new String("1.1")] = 1;
|
||||
assert.sameValue(z["1.1"], 1, 'The value of z["1.1"] is expected to be 1');
|
||||
|
|
|
@ -9,7 +9,6 @@ es5id: 15.4_A1.1_T9
|
|||
description: If Type(value) is Object, evaluate ToPrimitive(value, String)
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [];
|
||||
var object = {
|
||||
valueOf: function() {
|
||||
|
@ -19,7 +18,6 @@ var object = {
|
|||
x[object] = 0;
|
||||
assert.sameValue(x["[object Object]"], 0, 'The value of x["[object Object]"] is expected to be 0');
|
||||
|
||||
//CHECK#2
|
||||
x = [];
|
||||
var object = {
|
||||
valueOf: function() {
|
||||
|
@ -32,7 +30,6 @@ var object = {
|
|||
x[object] = 0;
|
||||
assert.sameValue(x[0], 0, 'The value of x[0] is expected to be 0');
|
||||
|
||||
//CHECK#3
|
||||
x = [];
|
||||
var object = {
|
||||
valueOf: function() {
|
||||
|
@ -45,7 +42,6 @@ var object = {
|
|||
x[object] = 0;
|
||||
assert.sameValue(x[1], 0, 'The value of x[1] is expected to be 0');
|
||||
|
||||
//CHECK#4
|
||||
try {
|
||||
x = [];
|
||||
var object = {
|
||||
|
@ -63,7 +59,6 @@ catch (e) {
|
|||
assert.notSameValue(e, "error", 'The value of e is not "error"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
x = [];
|
||||
var object = {
|
||||
toString: function() {
|
||||
|
@ -73,7 +68,6 @@ var object = {
|
|||
x[object] = 0;
|
||||
assert.sameValue(x[1], 0, 'The value of x[1] is expected to be 0');
|
||||
|
||||
//CHECK#6
|
||||
x = [];
|
||||
var object = {
|
||||
valueOf: function() {
|
||||
|
@ -86,7 +80,6 @@ var object = {
|
|||
x[object] = 0;
|
||||
assert.sameValue(x[1], 0, 'The value of x[1] is expected to be 0');
|
||||
|
||||
//CHECK#7
|
||||
try {
|
||||
x = [];
|
||||
var object = {
|
||||
|
@ -104,7 +97,6 @@ catch (e) {
|
|||
assert.sameValue(e, "error", 'The value of e is expected to be "error"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
try {
|
||||
x = [];
|
||||
var object = {
|
||||
|
|
|
@ -13,7 +13,6 @@ description: >
|
|||
this property
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
Array.prototype.myproperty = 1;
|
||||
var x = new Array(0);
|
||||
assert.sameValue(x.myproperty, 1, 'The value of x.myproperty is expected to be 1');
|
||||
|
|
|
@ -11,7 +11,6 @@ es5id: 15.4.2.2_A1.1_T2
|
|||
description: Array.prototype.toString = Object.prototype.toString
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
Array.prototype.toString = Object.prototype.toString;
|
||||
var x = new Array(0);
|
||||
assert.sameValue(x.toString(), "[object Array]", 'x.toString() must return "[object Array]"');
|
||||
|
|
|
@ -8,6 +8,5 @@ es5id: 15.4.2.2_A1.2_T1
|
|||
description: Checking use Object.prototype.toString
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = new Array(0);
|
||||
assert.sameValue(Object.prototype.toString.call(x), "[object Array]", 'Object.prototype.toString.call(new Array(0)) must return "[object Array]"');
|
||||
|
|
|
@ -10,14 +10,11 @@ es5id: 15.4.2.2_A2.1_T1
|
|||
description: Array constructor is given one argument
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = new Array(0);
|
||||
assert.sameValue(x.length, 0, 'The value of x.length is expected to be 0');
|
||||
|
||||
//CHECK#2
|
||||
var x = new Array(1);
|
||||
assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1');
|
||||
|
||||
//CHECK#3
|
||||
var x = new Array(4294967295);
|
||||
assert.sameValue(x.length, 4294967295, 'The value of x.length is expected to be 4294967295');
|
||||
|
|
|
@ -10,7 +10,6 @@ es5id: 15.4.2.2_A2.2_T1
|
|||
description: Use try statement. len = -1, 4294967296, 4294967297
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
try {
|
||||
new Array(-1);
|
||||
throw new Test262Error('#1.1: new Array(-1) throw RangeError. Actual: ' + (new Array(-1)));
|
||||
|
@ -22,7 +21,6 @@ try {
|
|||
);
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
try {
|
||||
new Array(4294967296);
|
||||
throw new Test262Error('#2.1: new Array(4294967296) throw RangeError. Actual: ' + (new Array(4294967296)));
|
||||
|
@ -34,7 +32,6 @@ try {
|
|||
);
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
try {
|
||||
new Array(4294967297);
|
||||
throw new Test262Error('#3.1: new Array(4294967297) throw RangeError. Actual: ' + (new Array(4294967297)));
|
||||
|
|
|
@ -10,7 +10,6 @@ es5id: 15.4.2.2_A2.2_T2
|
|||
description: Use try statement. len = NaN, +/-Infinity
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
try {
|
||||
new Array(NaN);
|
||||
throw new Test262Error('#1.1: new Array(NaN) throw RangeError. Actual: ' + (new Array(NaN)));
|
||||
|
@ -22,7 +21,6 @@ try {
|
|||
);
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
try {
|
||||
new Array(Number.POSITIVE_INFINITY);
|
||||
throw new Test262Error('#2.1: new Array(Number.POSITIVE_INFINITY) throw RangeError. Actual: ' + (new Array(Number.POSITIVE_INFINITY)));
|
||||
|
@ -34,7 +32,6 @@ try {
|
|||
);
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
try {
|
||||
new Array(Number.NEGATIVE_INFINITY);
|
||||
throw new Test262Error('#3.1: new Array(Number.NEGATIVE_INFINITY) throw RangeError. Actual: ' + (new Array(Number.NEGATIVE_INFINITY)));
|
||||
|
|
|
@ -10,7 +10,6 @@ es5id: 15.4.2.2_A2.2_T3
|
|||
description: Use try statement. len = 1.5, Number.MAX_VALUE, Number.MIN_VALUE
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
try {
|
||||
new Array(1.5);
|
||||
throw new Test262Error('#1.1: new Array(1.5) throw RangeError. Actual: ' + (new Array(1.5)));
|
||||
|
@ -22,7 +21,6 @@ try {
|
|||
);
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
try {
|
||||
new Array(Number.MAX_VALUE);
|
||||
throw new Test262Error('#2.1: new Array(Number.MAX_VALUE) throw RangeError. Actual: ' + (new Array(Number.MAX_VALUE)));
|
||||
|
@ -34,7 +32,6 @@ try {
|
|||
);
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
try {
|
||||
new Array(Number.MIN_VALUE);
|
||||
throw new Test262Error('#3.1: new Array(Number.MIN_VALUE) throw RangeError. Actual: ' + (new Array(Number.MIN_VALUE)));
|
||||
|
|
|
@ -8,7 +8,6 @@ es5id: 15.4.5.1_A1.1_T1
|
|||
description: length in [4294967296, -1, 1.5]
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
try {
|
||||
var x = [];
|
||||
x.length = 4294967296;
|
||||
|
@ -21,7 +20,6 @@ try {
|
|||
);
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
try {
|
||||
x = [];
|
||||
x.length = -1;
|
||||
|
@ -34,7 +32,6 @@ try {
|
|||
);
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
try {
|
||||
x = [];
|
||||
x.length = 1.5;
|
||||
|
|
|
@ -8,7 +8,6 @@ es5id: 15.4.5.1_A1.1_T2
|
|||
description: length in [NaN, Infinity, -Infinity, undefined]
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
try {
|
||||
var x = [];
|
||||
x.length = NaN;
|
||||
|
@ -21,7 +20,6 @@ try {
|
|||
);
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
try {
|
||||
x = [];
|
||||
x.length = Number.POSITIVE_INFINITY;
|
||||
|
@ -34,7 +32,6 @@ try {
|
|||
);
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
try {
|
||||
x = [];
|
||||
x.length = Number.NEGATIVE_INFINITY;
|
||||
|
@ -47,7 +44,6 @@ try {
|
|||
);
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
try {
|
||||
x = [];
|
||||
x.length = undefined;
|
||||
|
|
|
@ -12,12 +12,10 @@ es5id: 15.4.5.1_A1.2_T1
|
|||
description: Change length of array
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [0, , 2, , 4];
|
||||
x.length = 4;
|
||||
assert.sameValue(x[4], undefined, 'The value of x[4] is expected to equal undefined');
|
||||
|
||||
//CHECK#2
|
||||
x.length = 3;
|
||||
assert.sameValue(x[3], undefined, 'The value of x[3] is expected to equal undefined');
|
||||
assert.sameValue(x[2], 2, 'The value of x[2] is expected to be 2');
|
||||
|
|
|
@ -12,12 +12,10 @@ es5id: 15.4.5.1_A1.2_T3
|
|||
description: Checking an inherited property
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
Array.prototype[2] = 2;
|
||||
var x = [0, 1];
|
||||
x.length = 3;
|
||||
assert.sameValue(x.hasOwnProperty('2'), false, 'x.hasOwnProperty("2") must return false');
|
||||
|
||||
//CHECK#2
|
||||
x.length = 2;
|
||||
assert.sameValue(x[2], 2, 'The value of x[2] is expected to be 2');
|
||||
|
|
|
@ -8,32 +8,26 @@ es5id: 15.4.5.1_A1.3_T1
|
|||
description: length is object or primitve
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [];
|
||||
x.length = true;
|
||||
assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1');
|
||||
|
||||
//CHECK#2
|
||||
x = [0];
|
||||
x.length = null;
|
||||
assert.sameValue(x.length, 0, 'The value of x.length is expected to be 0');
|
||||
|
||||
//CHECK#3
|
||||
x = [0];
|
||||
x.length = new Boolean(false);
|
||||
assert.sameValue(x.length, 0, 'The value of x.length is expected to be 0');
|
||||
|
||||
//CHECK#4
|
||||
x = [];
|
||||
x.length = new Number(1);
|
||||
assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1');
|
||||
|
||||
//CHECK#5
|
||||
x = [];
|
||||
x.length = "1";
|
||||
assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1');
|
||||
|
||||
//CHECK#6
|
||||
x = [];
|
||||
x.length = new String("1");
|
||||
assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1');
|
||||
|
|
|
@ -8,7 +8,6 @@ es5id: 15.4.5.1_A1.3_T2
|
|||
description: Uint32 use ToNumber and ToPrimitve
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [];
|
||||
x.length = {
|
||||
valueOf: function() {
|
||||
|
@ -17,7 +16,6 @@ x.length = {
|
|||
};
|
||||
assert.sameValue(x.length, 2, 'The value of x.length is expected to be 2');
|
||||
|
||||
//CHECK#2
|
||||
x = [];
|
||||
x.length = {
|
||||
valueOf: function() {
|
||||
|
@ -29,7 +27,6 @@ x.length = {
|
|||
};
|
||||
assert.sameValue(x.length, 2, 'The value of x.length is expected to be 2');
|
||||
|
||||
//CHECK#3
|
||||
x = [];
|
||||
x.length = {
|
||||
valueOf: function() {
|
||||
|
@ -41,7 +38,6 @@ x.length = {
|
|||
};
|
||||
assert.sameValue(x.length, 2, 'The value of x.length is expected to be 2');
|
||||
|
||||
//CHECK#4
|
||||
try {
|
||||
x = [];
|
||||
x.length = {
|
||||
|
@ -58,7 +54,6 @@ catch (e) {
|
|||
assert.notSameValue(e, "error", 'The value of e is not "error"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
x = [];
|
||||
x.length = {
|
||||
toString: function() {
|
||||
|
@ -67,7 +62,6 @@ x.length = {
|
|||
};
|
||||
assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1');
|
||||
|
||||
//CHECK#6
|
||||
x = [];
|
||||
x.length = {
|
||||
valueOf: function() {
|
||||
|
@ -79,7 +73,6 @@ x.length = {
|
|||
}
|
||||
assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1');
|
||||
|
||||
//CHECK#7
|
||||
try {
|
||||
x = [];
|
||||
x.length = {
|
||||
|
@ -97,7 +90,6 @@ catch (e) {
|
|||
assert.sameValue(e, "error", 'The value of e is expected to be "error"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
try {
|
||||
x = [];
|
||||
x.length = {
|
||||
|
|
|
@ -12,7 +12,6 @@ description: >
|
|||
is an array index
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [0, 1, 2];
|
||||
x[4294967294] = 4294967294;
|
||||
x.length = 2;
|
||||
|
|
|
@ -16,7 +16,6 @@ var y = new Array(0, 1);
|
|||
var z = new Array(2, 3, 4);
|
||||
var arr = x.concat(y, z);
|
||||
|
||||
//CHECK#0
|
||||
arr.getClass = Object.prototype.toString;
|
||||
assert.sameValue(arr.getClass(), "[object Array]", 'arr.getClass() must return "[object Array]"');
|
||||
assert.sameValue(arr[0], 0, 'The value of arr[0] is expected to be 0');
|
||||
|
|
|
@ -16,7 +16,6 @@ var y = new Object();
|
|||
var z = new Array(1, 2);
|
||||
var arr = x.concat(y, z, -1, true, "NaN");
|
||||
|
||||
//CHECK#0
|
||||
arr.getClass = Object.prototype.toString;
|
||||
assert.sameValue(arr.getClass(), "[object Array]", 'arr.getClass() must return "[object Array]"');
|
||||
assert.sameValue(arr[0], 0, 'The value of arr[0] is expected to be 0');
|
||||
|
|
|
@ -14,7 +14,6 @@ description: Checking this algorithm with no items
|
|||
var x = [0, 1];
|
||||
var arr = x.concat();
|
||||
|
||||
//CHECK#0
|
||||
arr.getClass = Object.prototype.toString;
|
||||
assert.sameValue(arr.getClass(), "[object Array]", 'arr.getClass() must return "[object Array]"');
|
||||
assert.sameValue(arr[0], 0, 'The value of arr[0] is expected to be 0');
|
||||
|
|
|
@ -14,7 +14,6 @@ description: Checking this algorithm, items are [], [,]
|
|||
var x = [, 1];
|
||||
var arr = x.concat([], [, ]);
|
||||
|
||||
//CHECK#0
|
||||
arr.getClass = Object.prototype.toString;
|
||||
assert.sameValue(arr.getClass(), "[object Array]", 'arr.getClass() must return "[object Array]"');
|
||||
assert.sameValue(arr[0], undefined, 'The value of arr[0] is expected to equal undefined');
|
||||
|
|
|
@ -16,7 +16,6 @@ var y = new Object();
|
|||
var z = new Array(1, 2);
|
||||
var arr = x.concat(y, z, -1, true, "NaN");
|
||||
|
||||
//CHECK#0
|
||||
arr.getClass = Object.prototype.toString;
|
||||
assert.sameValue(arr.getClass(), "[object Array]", 'arr.getClass() must return "[object Array]"');
|
||||
assert.sameValue(arr[0], x, 'The value of arr[0] is expected to equal the value of x');
|
||||
|
|
|
@ -14,7 +14,6 @@ var x = {};
|
|||
x.concat = Array.prototype.concat;
|
||||
var arr = x.concat();
|
||||
|
||||
//CHECK#0
|
||||
arr.getClass = Object.prototype.toString;
|
||||
assert.sameValue(arr.getClass(), "[object Array]", 'arr.getClass() must return "[object Array]"');
|
||||
assert.sameValue(arr[0], x, 'The value of arr[0] is expected to equal the value of x');
|
||||
|
|
|
@ -7,13 +7,11 @@ esid: sec-array.prototype.join
|
|||
description: Checking this use new Array() and []
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = new Array();
|
||||
if (x.join() !== "") {
|
||||
throw new Test262Error('#1: x = new Array(); x.join() === "". Actual: ' + (x.join()));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
x = [];
|
||||
x[0] = 1;
|
||||
x.length = 0;
|
||||
|
|
|
@ -7,13 +7,11 @@ esid: sec-array.prototype.join
|
|||
description: Checking this use new Array() and []
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = new Array(0, 1, 2, 3);
|
||||
if (x.join() !== "0,1,2,3") {
|
||||
throw new Test262Error('#1: x = new Array(0,1,2,3); x.join() === "0,1,2,3". Actual: ' + (x.join()));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
x = [];
|
||||
x[0] = 0;
|
||||
x[3] = 3;
|
||||
|
@ -21,7 +19,6 @@ if (x.join() !== "0,,,3") {
|
|||
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") {
|
||||
|
|
|
@ -7,13 +7,11 @@ esid: sec-array.prototype.join
|
|||
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") {
|
||||
throw new Test262Error('#1: x = new Array(0,1,2,3); x.join(undefined) === "0,1,2,3". Actual: ' + (x.join(undefined)));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
x = [];
|
||||
x[0] = 0;
|
||||
x[3] = 3;
|
||||
|
@ -21,7 +19,6 @@ if (x.join(undefined) !== "0,,,3") {
|
|||
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") {
|
||||
|
|
|
@ -7,21 +7,18 @@ esid: sec-array.prototype.join
|
|||
description: Checking this use new Array() and []
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [];
|
||||
x[0] = undefined;
|
||||
if (x.join() !== "") {
|
||||
throw new Test262Error('#1: x = []; x[0] = undefined; x.join() === "". Actual: ' + (x.join()));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
x = [];
|
||||
x[0] = null;
|
||||
if (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") {
|
||||
throw new Test262Error('#3: x = Array(undefined,1,null,3); x.join() === ",1,,3". Actual: ' + (x.join()));
|
||||
|
|
|
@ -15,34 +15,28 @@ obj.join = Array.prototype.join;
|
|||
if (obj.length !== undefined) {
|
||||
throw new Test262Error('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length));
|
||||
} else {
|
||||
//CHECK#1
|
||||
if (obj.join() !== "") {
|
||||
throw new Test262Error('#1: var obj = {}; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
|
||||
}
|
||||
//CHECK#2
|
||||
if (obj.length !== undefined) {
|
||||
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() !== "") {
|
||||
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) {
|
||||
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() !== "") {
|
||||
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) {
|
||||
throw new Test262Error('#6: var obj = {}; obj.length = null; obj.join = Array.prototype.join; obj.join(); obj.length === null. Actual: ' + (obj.length));
|
||||
}
|
||||
|
|
|
@ -12,33 +12,27 @@ description: If ToUint32(length) is zero, return the empty string
|
|||
var obj = {};
|
||||
obj.join = Array.prototype.join;
|
||||
|
||||
//CHECK#1
|
||||
obj.length = NaN;
|
||||
if (obj.join() !== "") {
|
||||
throw new Test262Error('#1: var obj = {}; obj.length = NaN; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
assert.sameValue(obj.length, NaN, "obj.length is NaN");
|
||||
|
||||
//CHECK#5
|
||||
obj.length = Number.NEGATIVE_INFINITY;
|
||||
if (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) {
|
||||
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() !== "") {
|
||||
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) {
|
||||
throw new Test262Error('#8: var obj = {}; obj.length = -0; obj.join = Array.prototype.join; obj.join(); obj.length === 0. Actual: ' + (obj.length));
|
||||
} else {
|
||||
|
@ -47,25 +41,21 @@ if (obj.length !== -0) {
|
|||
}
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
obj.length = 0.5;
|
||||
if (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) {
|
||||
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() !== "") {
|
||||
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) {
|
||||
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));
|
||||
}
|
||||
|
|
|
@ -12,13 +12,11 @@ description: If ToUint32(length) is zero, return the empty string
|
|||
var obj = {};
|
||||
obj.join = Array.prototype.join;
|
||||
|
||||
//CHECK#1
|
||||
obj.length = 4.5;
|
||||
if (obj.join() !== ",,,") {
|
||||
throw new Test262Error('#1: var obj = {}; obj.length = 4.5; obj.join = Array.prototype.join; obj.join() === ",,,". Actual: ' + (obj.join()));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
obj[0] = undefined;
|
||||
obj[1] = 1;
|
||||
obj[2] = null;
|
||||
|
@ -26,7 +24,6 @@ if (obj.join() !== ",1,,") {
|
|||
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) {
|
||||
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));
|
||||
}
|
||||
|
@ -34,14 +31,12 @@ if (obj.length !== 4.5) {
|
|||
var obj = {};
|
||||
obj.join = Array.prototype.join;
|
||||
|
||||
//CHECK#4
|
||||
var x = new Number(4.5);
|
||||
obj.length = x;
|
||||
if (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
|
||||
obj[0] = undefined;
|
||||
obj[1] = 1;
|
||||
obj[2] = null;
|
||||
|
@ -49,7 +44,6 @@ if (obj.join() !== ",1,,") {
|
|||
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) {
|
||||
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));
|
||||
}
|
||||
|
|
|
@ -14,121 +14,81 @@ description: >
|
|||
var obj = {};
|
||||
obj.join = Array.prototype.join;
|
||||
|
||||
//CHECK#1
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return 3
|
||||
}
|
||||
};
|
||||
if (obj.join() !== ",,") {
|
||||
throw new Test262Error('#1: obj.length = {valueOf: function() {return 3}} obj.join() === ",,". Actual: ' + (obj.join()));
|
||||
}
|
||||
assert.sameValue(obj.join(), ",,", 'obj.join() must return ",,"');
|
||||
|
||||
//CHECK#2
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return 3
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
return 2
|
||||
}
|
||||
};
|
||||
if (obj.join() !== ",,") {
|
||||
throw new Test262Error('#2: obj.length = {valueOf: function() {return 3}, toString: function() {return 2}} obj.join() === ",,". Actual: ' + (obj.join()));
|
||||
}
|
||||
assert.sameValue(obj.join(), ",,", 'obj.join() must return ",,"');
|
||||
|
||||
//CHECK#3
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return 3
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
return {}
|
||||
}
|
||||
};
|
||||
if (obj.join() !== ",,") {
|
||||
throw new Test262Error('#3: obj.length = {valueOf: function() {return 3}, toString: function() {return {}}} obj.join() === ",,". Actual: ' + (obj.join()));
|
||||
}
|
||||
assert.sameValue(obj.join(), ",,", 'obj.join() must return ",,"');
|
||||
|
||||
//CHECK#4
|
||||
try {
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
return 3
|
||||
},
|
||||
toString: function() {
|
||||
throw "error"
|
||||
}
|
||||
};
|
||||
if (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") {
|
||||
throw new Test262Error('#4.2: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.join() not throw "error"');
|
||||
} else {
|
||||
throw new Test262Error('#4.3: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.join() not throw Error. Actual: ' + (e));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
obj.length = {
|
||||
toString: function() {
|
||||
valueOf() {
|
||||
return 3
|
||||
},
|
||||
toString() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
};
|
||||
assert.sameValue(obj.join(), ",,", 'obj.join() must return ",,"');
|
||||
|
||||
obj.length = {
|
||||
toString() {
|
||||
return 2
|
||||
}
|
||||
};
|
||||
if (obj.join() !== ",") {
|
||||
throw new Test262Error('#5: obj.length = {toString: function() {return 2}} obj.join() === ",". Actual: ' + (obj.join()));
|
||||
}
|
||||
assert.sameValue(obj.join(), ",", 'obj.join() must return ","');
|
||||
|
||||
//CHECK#6
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return {}
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
return 2
|
||||
}
|
||||
}
|
||||
if (obj.join() !== ",") {
|
||||
throw new Test262Error('#6: obj.length = {valueOf: function() {return {}}, toString: function() {return 2}} obj.join() === ",". Actual: ' + (obj.join()));
|
||||
}
|
||||
assert.sameValue(obj.join(), ",", 'obj.join() must return ","');
|
||||
|
||||
//CHECK#7
|
||||
try {
|
||||
assert.throws(Test262Error, () => {
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
throw "error"
|
||||
valueOf() {
|
||||
throw new Test262Error();
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
return 2
|
||||
}
|
||||
};
|
||||
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") {
|
||||
throw new Test262Error('#7.2: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 2}}; obj.join() throw "error". Actual: ' + (e));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//CHECK#8
|
||||
try {
|
||||
assert.throws(TypeError, () => {
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return {}
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
return {}
|
||||
}
|
||||
};
|
||||
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) {
|
||||
throw new Test262Error('#8,2: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.join() throw TypeError. Actual: ' + (e));
|
||||
}
|
||||
}
|
||||
throw new Test262Error();
|
||||
});
|
||||
|
|
|
@ -9,44 +9,36 @@ description: >
|
|||
undefind, NaN]
|
||||
---*/
|
||||
|
||||
//CHECK#0
|
||||
var x = new Array(0, 1, 2, 3);
|
||||
if (x.join("") !== "0123") {
|
||||
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") {
|
||||
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") {
|
||||
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") {
|
||||
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") {
|
||||
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") {
|
||||
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") {
|
||||
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") {
|
||||
throw new Test262Error('#7: x = new Array(0,1,2,3); x.join(NaN) === "0NaN1NaN2NaN3". Actual: ' + (x.join(NaN)));
|
||||
}
|
||||
|
|
|
@ -10,137 +10,135 @@ description: >
|
|||
---*/
|
||||
|
||||
var x = new Array(0, 1, 2, 3);
|
||||
//CHECK#1
|
||||
var object = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return "+"
|
||||
}
|
||||
};
|
||||
if (x.join(object) !== "0[object Object]1[object Object]2[object Object]3") {
|
||||
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
|
||||
assert.sameValue(
|
||||
x.join(object),
|
||||
"0[object Object]1[object Object]2[object Object]3",
|
||||
'x.join({valueOf() {return "+"}}) must return "0[object Object]1[object Object]2[object Object]3"'
|
||||
);
|
||||
|
||||
var object = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return "+"
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
return "*"
|
||||
}
|
||||
};
|
||||
if (x.join(object) !== "0*1*2*3") {
|
||||
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
|
||||
assert.sameValue(
|
||||
x.join(object),
|
||||
"0*1*2*3",
|
||||
'x.join("{valueOf() {return "+"}, toString() {return "*"}}) must return "0*1*2*3"'
|
||||
);
|
||||
|
||||
var object = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return "+"
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
return {}
|
||||
}
|
||||
};
|
||||
if (x.join(object) !== "0+1+2+3") {
|
||||
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
|
||||
assert.sameValue(
|
||||
x.join(object),
|
||||
"0+1+2+3",
|
||||
'x.join({valueOf() {return "+"}, toString() {return {}}}) must return "0+1+2+3"'
|
||||
);
|
||||
|
||||
try {
|
||||
var object = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
throw "error"
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
return "*"
|
||||
}
|
||||
};
|
||||
if (x.join(object) !== "0*1*2*3") {
|
||||
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)));
|
||||
}
|
||||
|
||||
assert.sameValue(
|
||||
x.join(object),
|
||||
"0*1*2*3",
|
||||
'x.join("{valueOf() {throw "error"}, toString() {return "*"}}) must return "0*1*2*3"'
|
||||
);
|
||||
}
|
||||
catch (e) {
|
||||
if (e === "error") {
|
||||
throw new Test262Error('#4.2: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}}; x.join(object) not throw "error"');
|
||||
} else {
|
||||
throw new Test262Error('#4.3: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}}; x.join(object) not throw Error. Actual: ' + (e));
|
||||
}
|
||||
assert.notSameValue(e, "error", 'The value of e is not "error"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
var object = {
|
||||
toString: function() {
|
||||
toString() {
|
||||
return "*"
|
||||
}
|
||||
};
|
||||
if (x.join(object) !== "0*1*2*3") {
|
||||
throw new Test262Error('#5: var object = {toString: function() {return "*"}}; x.join(object) === "0*1*2*3". Actual: ' + (x.join(object)));
|
||||
}
|
||||
assert.sameValue(x.join(object), "0*1*2*3", 'x.join({toString() {return "*"}}) must return "0*1*2*3"');
|
||||
|
||||
//CHECK#6
|
||||
var object = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return {}
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
return "*"
|
||||
}
|
||||
}
|
||||
if (x.join(object) !== "0*1*2*3") {
|
||||
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
|
||||
assert.sameValue(
|
||||
x.join(object),
|
||||
"0*1*2*3",
|
||||
'x.join({valueOf() {return {}}, toString() {return "*"}}) must return "0*1*2*3"'
|
||||
);
|
||||
|
||||
try {
|
||||
var object = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return "+"
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
throw "error"
|
||||
}
|
||||
};
|
||||
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)));
|
||||
throw new Test262Error('#7.1: var object = {valueOf() {return "+"}, toString() {throw "error"}}; x.join(object) throw "error". Actual: ' + (x.join(object)));
|
||||
}
|
||||
catch (e) {
|
||||
if (e !== "error") {
|
||||
throw new Test262Error('#7.2: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}}; x.join(object) throw "error". Actual: ' + (e));
|
||||
}
|
||||
assert.sameValue(e, "error", 'The value of e is expected to be "error"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
try {
|
||||
var object = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return {}
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
return {}
|
||||
}
|
||||
};
|
||||
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)));
|
||||
throw new Test262Error('#8.1: var object = {valueOf() {return {}}, toString() {return {}}}; x.join(object) throw TypeError. Actual: ' + (x.join(object)));
|
||||
}
|
||||
catch (e) {
|
||||
if ((e instanceof TypeError) !== true) {
|
||||
throw new Test262Error('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x.join(object) throw TypeError. Actual: ' + (e));
|
||||
}
|
||||
assert.sameValue(
|
||||
e instanceof TypeError,
|
||||
true,
|
||||
'The result of evaluating (e instanceof TypeError) is expected to be true'
|
||||
);
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
try {
|
||||
var object = {
|
||||
toString: function() {
|
||||
toString() {
|
||||
throw "error"
|
||||
}
|
||||
};
|
||||
[].join(object);
|
||||
throw new Test262Error('#9.1: var object = {toString: function() {throw "error"}}; [].join(object) throw "error". Actual: ' + ([].join(object)));
|
||||
throw new Test262Error('#9.1: var object = {toString() {throw "error"}}; [].join(object) throw "error". Actual: ' + ([].join(object)));
|
||||
}
|
||||
catch (e) {
|
||||
if (e !== "error") {
|
||||
throw new Test262Error('#9.2: var object = {toString: function() {throw "error"}}; [].join(object) throw "error". Actual: ' + (e));
|
||||
}
|
||||
assert.sameValue(e, "error", 'The value of e is expected to be "error"');
|
||||
}
|
||||
|
|
|
@ -9,49 +9,41 @@ description: >
|
|||
Infinity, null, undefind, NaN]
|
||||
---*/
|
||||
|
||||
//CHECK#0
|
||||
var x = new Array("", "", "");
|
||||
if (x.join("") !== "") {
|
||||
throw new Test262Error('#0: var x = new Array("","",""); x.join("") === "". Actual: ' + (x.join("")));
|
||||
}
|
||||
|
||||
//CHECK#1
|
||||
var x = new Array("\\", "\\", "\\");
|
||||
if (x.join("\\") !== "\\\\\\\\\\") {
|
||||
throw new Test262Error('#1: var x = new Array("\\","\\","\\"); x.join("\\") === "\\\\\\\\\\". Actual: ' + (x.join("\\")));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
var x = new Array("&", "&", "&");
|
||||
if (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") {
|
||||
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() !== ",,") {
|
||||
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() !== ",,") {
|
||||
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") {
|
||||
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") {
|
||||
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)));
|
||||
|
|
|
@ -7,18 +7,14 @@ esid: sec-array.prototype.join
|
|||
description: If Type(argument) is Object, evaluate ToPrimitive(argument, String)
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var object = {
|
||||
valueOf: function() {
|
||||
return "+"
|
||||
}
|
||||
};
|
||||
var x = new Array(object);
|
||||
if (x.join() !== "[object Object]") {
|
||||
throw new Test262Error('#1: var object = {valueOf: function() {return "+"}} var x = new Array(object); x.join() === "[object Object]". Actual: ' + (x.join()));
|
||||
}
|
||||
assert.sameValue(x.join(), "[object Object]", 'x.join() must return "[object Object]"');
|
||||
|
||||
//CHECK#2
|
||||
var object = {
|
||||
valueOf: function() {
|
||||
return "+"
|
||||
|
@ -28,11 +24,8 @@ var object = {
|
|||
}
|
||||
};
|
||||
var x = new Array(object);
|
||||
if (x.join() !== "*") {
|
||||
throw new Test262Error('#2: var object = {valueOf: function() {return "+"}, toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join()));
|
||||
}
|
||||
assert.sameValue(x.join(), "*", 'x.join() must return "*"');
|
||||
|
||||
//CHECK#3
|
||||
var object = {
|
||||
valueOf: function() {
|
||||
return "+"
|
||||
|
@ -42,11 +35,8 @@ var object = {
|
|||
}
|
||||
};
|
||||
var x = new Array(object);
|
||||
if (x.join() !== "+") {
|
||||
throw new Test262Error('#3: var object = {valueOf: function() {return "+"}, toString: function() {return {}}} var x = new Array(object); x.join() === "+". Actual: ' + (x.join()));
|
||||
}
|
||||
assert.sameValue(x.join(), "+", 'x.join() must return "+"');
|
||||
|
||||
//CHECK#4
|
||||
try {
|
||||
var object = {
|
||||
valueOf: function() {
|
||||
|
@ -57,30 +47,20 @@ try {
|
|||
}
|
||||
};
|
||||
var x = new Array(object);
|
||||
if (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()));
|
||||
}
|
||||
assert.sameValue(x.join(), "*", 'x.join() must return "*"');
|
||||
}
|
||||
catch (e) {
|
||||
if (e === "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 {
|
||||
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));
|
||||
}
|
||||
assert.notSameValue(e, "error", 'The value of e is not "error"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
var object = {
|
||||
toString: function() {
|
||||
return "*"
|
||||
}
|
||||
};
|
||||
var x = new Array(object);
|
||||
if (x.join() !== "*") {
|
||||
throw new Test262Error('#5: var object = {toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join()));
|
||||
}
|
||||
assert.sameValue(x.join(), "*", 'x.join() must return "*"');
|
||||
|
||||
//CHECK#6
|
||||
var object = {
|
||||
valueOf: function() {
|
||||
return {}
|
||||
|
@ -90,11 +70,8 @@ var object = {
|
|||
}
|
||||
}
|
||||
var x = new Array(object);
|
||||
if (x.join() !== "*") {
|
||||
throw new Test262Error('#6: var object = {valueOf: function() {return {}}, toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join()));
|
||||
}
|
||||
assert.sameValue(x.join(), "*", 'x.join() must return "*"');
|
||||
|
||||
//CHECK#7
|
||||
try {
|
||||
var object = {
|
||||
valueOf: function() {
|
||||
|
@ -109,12 +86,9 @@ try {
|
|||
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") {
|
||||
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));
|
||||
}
|
||||
assert.sameValue(e, "error", 'The value of e is expected to be "error"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
try {
|
||||
var object = {
|
||||
valueOf: function() {
|
||||
|
@ -129,7 +103,9 @@ try {
|
|||
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) {
|
||||
throw new Test262Error('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}} var x = new Array(object); x.join() throw TypeError. Actual: ' + (e));
|
||||
}
|
||||
assert.sameValue(
|
||||
e instanceof TypeError,
|
||||
true,
|
||||
'The result of evaluating (e instanceof TypeError) is expected to be true'
|
||||
);
|
||||
}
|
||||
|
|
|
@ -14,12 +14,10 @@ obj[1] = "y";
|
|||
obj[2] = "z";
|
||||
obj.length = -4294967294;
|
||||
|
||||
//CHECK#1
|
||||
if (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) {
|
||||
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));
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@ description: >
|
|||
of Array.prototype is Object.prototype
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
Array.prototype[1] = 1;
|
||||
var x = [0];
|
||||
x.length = 2;
|
||||
|
@ -17,7 +16,6 @@ if (x.join() !== "0,1") {
|
|||
throw new Test262Error('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.join() === "0,1". Actual: ' + (x.join()));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
Object.prototype[1] = 1;
|
||||
Object.prototype.length = 2;
|
||||
Object.prototype.join = Array.prototype.join;
|
||||
|
|
|
@ -7,7 +7,6 @@ esid: sec-array.prototype.join
|
|||
description: Checking Array.prototype.join.prototype
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
if (Array.prototype.join.prototype !== undefined) {
|
||||
throw new Test262Error('#1: Array.prototype.join.prototype === undefined. Actual: ' + (Array.prototype.join.prototype));
|
||||
}
|
||||
|
|
|
@ -9,13 +9,7 @@ description: >
|
|||
throw a TypeError exception
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
|
||||
try {
|
||||
assert.throws(TypeError, () => {
|
||||
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) {
|
||||
throw new Test262Error('#1.2: new Array.prototype.join() throw TypeError. Actual: ' + (e));
|
||||
}
|
||||
}
|
||||
throw new Test262Error();
|
||||
});
|
||||
|
|
|
@ -9,19 +9,16 @@ esid: sec-array.prototype.pop
|
|||
description: Checking this algorithm
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = new Array();
|
||||
var pop = x.pop();
|
||||
if (pop !== undefined) {
|
||||
throw new Test262Error('#1: var x = new Array(); x.pop() === undefined. Actual: ' + (pop));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x.length !== 0) {
|
||||
throw new Test262Error('#2: var x = new Array(); x.pop(); x.length === 0. Actual: ' + (x.length));
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
var x = Array(1, 2, 3);
|
||||
x.length = 0;
|
||||
var pop = x.pop();
|
||||
|
@ -29,7 +26,6 @@ if (pop !== undefined) {
|
|||
throw new Test262Error('#2: var x = Array(1,2,3); x.length = 0; x.pop() === undefined. Actual: ' + (pop));
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (x.length !== 0) {
|
||||
throw new Test262Error('#4: var x = new Array(1,2,3); x.length = 0; x.pop(); x.length === 0. Actual: ' + (x.length));
|
||||
}
|
||||
|
|
|
@ -9,29 +9,24 @@ esid: sec-array.prototype.pop
|
|||
description: Checking this use new Array() and []
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = new Array(0, 1, 2, 3);
|
||||
var pop = x.pop();
|
||||
if (pop !== 3) {
|
||||
throw new Test262Error('#1: x = new Array(0,1,2,3); x.pop() === 3. Actual: ' + (pop));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (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) {
|
||||
throw new Test262Error('#3: x = new Array(0,1,2,3); x.pop(); x[3] == undefined');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (x[2] !== 2) {
|
||||
throw new Test262Error('#4: x = new Array(0,1,2,3); x.pop(); x[2] == 2');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
x = [];
|
||||
x[0] = 0;
|
||||
x[3] = 3;
|
||||
|
@ -40,29 +35,24 @@ if (pop !== 3) {
|
|||
throw new Test262Error('#5: x = []; x[0] = 0; x[3] = 3; x.pop() === 3. Actual: ' + (pop));
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (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) {
|
||||
throw new Test262Error('#7: x = []; x[0] = 0; x[3] = 3; x.pop(); x[3] == undefined');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if (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) {
|
||||
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) {
|
||||
throw new Test262Error('#10: x = []; x[0] = 0; x[3] = 3; x.pop(); x.length = 1; x.pop(); x.length === 0. Actual: ' + (x.length));
|
||||
}
|
||||
|
|
|
@ -17,37 +17,31 @@ obj.pop = Array.prototype.pop;
|
|||
if (obj.length !== undefined) {
|
||||
throw new Test262Error('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length));
|
||||
} else {
|
||||
//CHECK#1
|
||||
var pop = obj.pop();
|
||||
if (pop !== undefined) {
|
||||
throw new Test262Error('#1: var obj = {}; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop));
|
||||
}
|
||||
//CHECK#2
|
||||
if (obj.length !== 0) {
|
||||
throw new Test262Error('#2: var obj = {}; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
obj.length = undefined;
|
||||
var pop = obj.pop();
|
||||
if (pop !== undefined) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
throw new Test262Error('#6: var obj = {}; obj.length = null; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length));
|
||||
}
|
||||
|
|
|
@ -14,50 +14,42 @@ description: >
|
|||
var obj = {};
|
||||
obj.pop = Array.prototype.pop;
|
||||
|
||||
//CHECK#1
|
||||
obj.length = NaN;
|
||||
var pop = obj.pop();
|
||||
if (pop !== undefined) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
throw new Test262Error('#8: var obj = {}; obj.length = -0; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length));
|
||||
} else {
|
||||
|
@ -66,26 +58,22 @@ if (obj.length !== 0) {
|
|||
}
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
obj.length = 0.5;
|
||||
var pop = obj.pop();
|
||||
if (pop !== undefined) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
throw new Test262Error('#12: var obj = {}; obj.length = new Number(0); obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length));
|
||||
}
|
||||
|
|
|
@ -14,26 +14,22 @@ description: >
|
|||
var obj = {};
|
||||
obj.pop = Array.prototype.pop;
|
||||
|
||||
//CHECK#1
|
||||
obj.length = 2.5;
|
||||
var pop = obj.pop();
|
||||
if (pop !== undefined) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
throw new Test262Error('#12: var obj = {}; obj.length = new Number(2); obj.pop = Array.prototype.pop; obj.pop(); obj.length === 1. Actual: ' + (obj.length));
|
||||
}
|
||||
|
|
|
@ -14,135 +14,111 @@ description: >
|
|||
var obj = {};
|
||||
obj.pop = Array.prototype.pop;
|
||||
|
||||
//CHECK#1
|
||||
obj[0] = -1;
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return 1
|
||||
}
|
||||
};
|
||||
var pop = obj.pop();
|
||||
if (pop !== -1) {
|
||||
throw new Test262Error('#1: obj[0] = -1; obj.length = {valueOf: function() {return 1}} obj.pop() === -1. Actual: ' + (pop));
|
||||
}
|
||||
assert.sameValue(pop, -1, 'The value of pop is expected to be -1');
|
||||
|
||||
//CHECK#2
|
||||
obj[0] = -1;
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return 1
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
return 0
|
||||
}
|
||||
};
|
||||
var pop = obj.pop();
|
||||
if (pop !== -1) {
|
||||
throw new Test262Error('#0: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {return 0}} obj.pop() === -1. Actual: ' + (pop));
|
||||
}
|
||||
assert.sameValue(pop, -1, 'The value of pop is expected to be -1');
|
||||
|
||||
//CHECK#3
|
||||
obj[0] = -1;
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return 1
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
return {}
|
||||
}
|
||||
};
|
||||
var pop = obj.pop();
|
||||
if (pop !== -1) {
|
||||
throw new Test262Error('#3: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {return {}}} obj.pop() === -1. Actual: ' + (pop));
|
||||
}
|
||||
assert.sameValue(pop, -1, 'The value of pop is expected to be -1');
|
||||
|
||||
//CHECK#4
|
||||
try {
|
||||
obj[0] = -1;
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return 1
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
throw "error"
|
||||
}
|
||||
};
|
||||
var pop = obj.pop();
|
||||
if (pop !== -1) {
|
||||
throw new Test262Error('#4.1: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {throw "error"}}; obj.pop() === ",". Actual: ' + (pop));
|
||||
}
|
||||
assert.sameValue(pop, -1, 'The value of pop is expected to be -1');
|
||||
}
|
||||
catch (e) {
|
||||
if (e === "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 {
|
||||
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));
|
||||
}
|
||||
assert.notSameValue(e, "error", 'The value of e is not "error"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
obj[0] = -1;
|
||||
obj.length = {
|
||||
toString: function() {
|
||||
toString() {
|
||||
return 0
|
||||
}
|
||||
};
|
||||
var pop = obj.pop();
|
||||
if (pop !== undefined) {
|
||||
throw new Test262Error('#5: obj[0] = -1; obj.length = {toString: function() {return 0}} obj.pop() === undefined. Actual: ' + (pop));
|
||||
}
|
||||
assert.sameValue(pop, undefined, 'The value of pop is expected to equal undefined');
|
||||
|
||||
//CHECK#6
|
||||
obj[0] = -1;
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return {}
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
var pop = obj.pop();
|
||||
if (pop !== undefined) {
|
||||
throw new Test262Error('#6: obj[0] = -1; obj.length = {valueOf: function() {return {}}, toString: function() {return 0}} obj.pop() === undefined. Actual: ' + (pop));
|
||||
}
|
||||
assert.sameValue(pop, undefined, 'The value of pop is expected to equal undefined');
|
||||
|
||||
//CHECK#7
|
||||
try {
|
||||
obj[0] = -1;
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
throw "error"
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
return 0
|
||||
}
|
||||
};
|
||||
var pop = obj.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));
|
||||
throw new Test262Error('#7.1: obj[0] = -1; obj.length = {valueOf() {throw "error"}, toString() {return 0}}; obj.pop() throw "error". Actual: ' + (pop));
|
||||
}
|
||||
catch (e) {
|
||||
if (e !== "error") {
|
||||
throw new Test262Error('#7.2: obj[0] = -1; obj.length = {valueOf: function() {throw "error"}, toString: function() {return 0}}; obj.pop() throw "error". Actual: ' + (e));
|
||||
}
|
||||
assert.sameValue(e, "error", 'The value of e is expected to be "error"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
try {
|
||||
obj[0] = -1;
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return {}
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
return {}
|
||||
}
|
||||
};
|
||||
var pop = obj.pop();
|
||||
throw new Test262Error('#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() {return {}}, toString() {return {}}} obj.pop() throw TypeError. Actual: ' + (pop));
|
||||
}
|
||||
catch (e) {
|
||||
if ((e instanceof TypeError) !== true) {
|
||||
throw new Test262Error('#8.2: obj[0] = -1; obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.pop() throw TypeError. Actual: ' + (e));
|
||||
}
|
||||
assert.sameValue(
|
||||
e instanceof TypeError,
|
||||
true,
|
||||
'The result of evaluating (e instanceof TypeError) is expected to be true'
|
||||
);
|
||||
}
|
||||
|
|
|
@ -13,23 +13,19 @@ obj[0] = "x";
|
|||
obj[4294967295] = "y";
|
||||
obj.length = 4294967296;
|
||||
|
||||
//CHECK#1
|
||||
var pop = obj.pop();
|
||||
if (pop !== "y") {
|
||||
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) {
|
||||
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") {
|
||||
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) {
|
||||
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]));
|
||||
}
|
||||
|
|
|
@ -13,23 +13,19 @@ obj[0] = "x";
|
|||
obj[4294967296] = "y";
|
||||
obj.length = 4294967297;
|
||||
|
||||
//CHECK#1
|
||||
var pop = obj.pop();
|
||||
if (pop !== "y") {
|
||||
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) {
|
||||
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") {
|
||||
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) {
|
||||
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]));
|
||||
}
|
||||
|
|
|
@ -12,18 +12,15 @@ obj.pop = Array.prototype.pop;
|
|||
obj[4294967294] = "x";
|
||||
obj.length = -1;
|
||||
|
||||
//CHECK#1
|
||||
var pop = obj.pop();
|
||||
if (pop !== undefined) {
|
||||
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) {
|
||||
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") {
|
||||
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]));
|
||||
}
|
||||
|
|
|
@ -13,13 +13,11 @@ Array.prototype[1] = 1;
|
|||
var x = [0];
|
||||
x.length = 2;
|
||||
|
||||
//CHECK#1
|
||||
var pop = x.pop();
|
||||
if (pop !== 1) {
|
||||
throw new Test262Error('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.pop() === 1. Actual: ' + (pop));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x[1] !== 1) {
|
||||
throw new Test262Error('#2: Array.prototype[1] = 1; x = [0]; x.length = 2; x.pop(); x[1] === 1. Actual: ' + (x[1]));
|
||||
}
|
||||
|
@ -31,23 +29,19 @@ x = {
|
|||
0: 0
|
||||
};
|
||||
|
||||
//CHECK#3
|
||||
var pop = x.pop();
|
||||
if (pop !== 1) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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));
|
||||
|
|
|
@ -13,13 +13,11 @@ Array.prototype[1] = -1;
|
|||
var x = [0, 1];
|
||||
x.length = 2;
|
||||
|
||||
//CHECK#1
|
||||
var pop = x.pop();
|
||||
if (pop !== 1) {
|
||||
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) {
|
||||
throw new Test262Error('#2: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.pop(); x[1] === -1. Actual: ' + (x[1]));
|
||||
}
|
||||
|
@ -32,23 +30,19 @@ x = {
|
|||
1: 1
|
||||
};
|
||||
|
||||
//CHECK#3
|
||||
var pop = x.pop();
|
||||
if (pop !== 1) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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));
|
||||
|
|
|
@ -9,13 +9,7 @@ description: >
|
|||
throw a TypeError exception
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
|
||||
try {
|
||||
assert.throws(TypeError, () => {
|
||||
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) {
|
||||
throw new Test262Error('#1.2: new Array.prototype.pop() throw TypeError. Actual: ' + (e));
|
||||
}
|
||||
}
|
||||
throw new Test262Error();
|
||||
});
|
||||
|
|
|
@ -10,41 +10,34 @@ esid: sec-array.prototype.push
|
|||
description: Checking case when push is given no arguments or one argument
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = new Array();
|
||||
var push = x.push(1);
|
||||
if (push !== 1) {
|
||||
throw new Test262Error('#1: x = new Array(); x.push(1) === 1. Actual: ' + (push));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x[0] !== 1) {
|
||||
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) {
|
||||
throw new Test262Error('#3: x = new Array(); x.push(1); x.push() === 1. Actual: ' + (push));
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (x[1] !== undefined) {
|
||||
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) {
|
||||
throw new Test262Error('#5: x = new Array(); x.push(1); x.push(); x.push(-1) === 2. Actual: ' + (push));
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x[1] !== -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) {
|
||||
throw new Test262Error('#7: x = new Array(); x.push(1); x.push(); x.push(-1); x.length === 2. Actual: ' + (x.length));
|
||||
}
|
||||
|
|
|
@ -10,50 +10,41 @@ esid: sec-array.prototype.push
|
|||
description: Checking case when push is given many arguments
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [];
|
||||
if (x.length !== 0) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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") {
|
||||
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") {
|
||||
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) {
|
||||
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) {
|
||||
throw new Test262Error('#9: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x.length === 6. Actual: ' + (x.length));
|
||||
}
|
||||
|
|
|
@ -18,51 +18,42 @@ obj.push = Array.prototype.push;
|
|||
if (obj.length !== undefined) {
|
||||
throw new Test262Error('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length));
|
||||
} else {
|
||||
//CHECK#1
|
||||
var push = obj.push(-1);
|
||||
if (push !== 1) {
|
||||
throw new Test262Error('#1: var obj = {}; obj.push = Array.prototype.push; obj.push(-1) === 1. Actual: ' + (push));
|
||||
}
|
||||
//CHECK#2
|
||||
if (obj.length !== 1) {
|
||||
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) {
|
||||
throw new Test262Error('#3: var obj = {}; obj.push = Array.prototype.push; obj.push(-1); obj["0"] === -1. Actual: ' + (obj["0"]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
obj.length = undefined;
|
||||
var push = obj.push(-4);
|
||||
if (push !== 1) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
throw new Test262Error('#9: var obj = {}; obj.length = null; obj.push = Array.prototype.push; obj.push(-7); obj["0"] === -7. Actual: ' + (obj["0"]));
|
||||
}
|
||||
|
|
|
@ -15,103 +15,85 @@ description: >
|
|||
var obj = {};
|
||||
obj.push = Array.prototype.push;
|
||||
|
||||
//CHECK#1
|
||||
obj.length = NaN;
|
||||
var push = obj.push(-1);
|
||||
if (push !== 1) {
|
||||
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) {
|
||||
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) {
|
||||
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
|
||||
obj.length = Number.POSITIVE_INFINITY;
|
||||
assert.throws(TypeError, function() {
|
||||
obj.push(-4);
|
||||
});
|
||||
|
||||
//CHECK#5
|
||||
if (obj.length !== Number.POSITIVE_INFINITY) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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"]));
|
||||
}
|
||||
|
|
|
@ -14,130 +14,105 @@ description: >
|
|||
var obj = {};
|
||||
obj.push = Array.prototype.push;
|
||||
|
||||
//CHECK#1
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return 3
|
||||
}
|
||||
};
|
||||
var push = obj.push();
|
||||
if (push !== 3) {
|
||||
throw new Test262Error('#1: obj.length = {valueOf: function() {return 3}} obj.push() === 3. Actual: ' + (push));
|
||||
}
|
||||
assert.sameValue(push, 3, 'The value of push is expected to be 3');
|
||||
|
||||
//CHECK#2
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return 3
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
return 1
|
||||
}
|
||||
};
|
||||
var push = obj.push();
|
||||
if (push !== 3) {
|
||||
throw new Test262Error('#0: obj.length = {valueOf: function() {return 3}, toString: function() {return 1}} obj.push() === 3. Actual: ' + (push));
|
||||
}
|
||||
assert.sameValue(push, 3, 'The value of push is expected to be 3');
|
||||
|
||||
//CHECK#3
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return 3
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
return {}
|
||||
}
|
||||
};
|
||||
var push = obj.push();
|
||||
if (push !== 3) {
|
||||
throw new Test262Error('#1: obj.length = {valueOf: function() {return 3}, toString: function() {return {}}} obj.push() === 3. Actual: ' + (push));
|
||||
}
|
||||
assert.sameValue(push, 3, 'The value of push is expected to be 3');
|
||||
|
||||
//CHECK#4
|
||||
try {
|
||||
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return 3
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
throw "error"
|
||||
}
|
||||
};
|
||||
var push = obj.push();
|
||||
if (push !== 3) {
|
||||
throw new Test262Error('#4.1: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.push() === ",". Actual: ' + (push));
|
||||
}
|
||||
assert.sameValue(push, 3, 'The value of push is expected to be 3');
|
||||
}
|
||||
catch (e) {
|
||||
if (e === "error") {
|
||||
throw new Test262Error('#4.2: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.push() not throw "error"');
|
||||
} else {
|
||||
throw new Test262Error('#4.3: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.push() not throw Error. Actual: ' + (e));
|
||||
}
|
||||
assert.notSameValue(e, "error", 'The value of e is not "error"');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
obj.length = {
|
||||
toString: function() {
|
||||
toString() {
|
||||
return 1
|
||||
}
|
||||
};
|
||||
var push = obj.push();
|
||||
if (push !== 1) {
|
||||
throw new Test262Error('#5: obj.length = {toString: function() {return 1}} obj.push() === 1. Actual: ' + (push));
|
||||
}
|
||||
assert.sameValue(push, 1, 'The value of push is expected to be 1');
|
||||
|
||||
//CHECK#6
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return {}
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
var push = obj.push();
|
||||
if (push !== 1) {
|
||||
throw new Test262Error('#6: obj.length = {valueOf: function() {return {}}, toString: function() {return 1}} obj.push() === 1. Actual: ' + (push));
|
||||
}
|
||||
assert.sameValue(push, 1, 'The value of push is expected to be 1');
|
||||
|
||||
//CHECK#7
|
||||
try {
|
||||
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
throw "error"
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
return 1
|
||||
}
|
||||
};
|
||||
var push = obj.push();
|
||||
throw new Test262Error('#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() {throw "error"}, toString() {return 1}}; obj.push() throw "error". Actual: ' + (push));
|
||||
}
|
||||
catch (e) {
|
||||
if (e !== "error") {
|
||||
throw new Test262Error('#7.2: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; obj.push() throw "error". Actual: ' + (e));
|
||||
}
|
||||
assert.sameValue(e, "error", 'The value of e is expected to be "error"');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
try {
|
||||
|
||||
obj.length = {
|
||||
valueOf: function() {
|
||||
valueOf() {
|
||||
return {}
|
||||
},
|
||||
toString: function() {
|
||||
toString() {
|
||||
return {}
|
||||
}
|
||||
};
|
||||
var push = obj.push();
|
||||
throw new Test262Error('#8.1: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.push() throw TypeError. Actual: ' + (push));
|
||||
throw new Test262Error('#8.1: obj.length = {valueOf() {return {}}, toString() {return {}}} obj.push() throw TypeError. Actual: ' + (push));
|
||||
}
|
||||
catch (e) {
|
||||
if ((e instanceof TypeError) !== true) {
|
||||
throw new Test262Error('#8.2: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.push() throw TypeError. Actual: ' + (e));
|
||||
}
|
||||
assert.sameValue(
|
||||
e instanceof TypeError,
|
||||
true,
|
||||
'The result of evaluating (e instanceof TypeError) is expected to be true'
|
||||
);
|
||||
}
|
||||
|
|
|
@ -10,28 +10,19 @@ description: If ToUint32(length) !== length, throw RangeError
|
|||
var x = [];
|
||||
x.length = 4294967295;
|
||||
|
||||
//CHECK#1
|
||||
var push = x.push();
|
||||
if (push !== 4294967295) {
|
||||
throw new Test262Error('#1: x = []; x.length = 4294967295; x.push() === 4294967295. Actual: ' + (push));
|
||||
}
|
||||
assert.sameValue(push, 4294967295, 'The value of push is expected to be 4294967295');
|
||||
|
||||
//CHECK#2
|
||||
try {
|
||||
x.push("x");
|
||||
throw new Test262Error('#2.1: x = []; x.length = 4294967295; x.push("x") throw RangeError. Actual: ' + (push));
|
||||
} catch (e) {
|
||||
if ((e instanceof RangeError) !== true) {
|
||||
throw new Test262Error('#2.2: x = []; x.length = 4294967295; x.push("x") throw RangeError. Actual: ' + (e));
|
||||
}
|
||||
assert.sameValue(
|
||||
e instanceof RangeError,
|
||||
true,
|
||||
'The result of evaluating (e instanceof RangeError) is expected to be true'
|
||||
);
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (x[4294967295] !== "x") {
|
||||
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) {
|
||||
throw new Test262Error('#4: x = []; x.length = 4294967295; try {x.push("x")}catch(e){}; x.length === 4294967295. Actual: ' + (x.length));
|
||||
}
|
||||
assert.sameValue(x[4294967295], "x", 'The value of x[4294967295] is expected to be "x"');
|
||||
assert.sameValue(x.length, 4294967295, 'The value of x.length is expected to be 4294967295');
|
||||
|
|
|
@ -11,43 +11,35 @@ var obj = {};
|
|||
obj.push = Array.prototype.push;
|
||||
obj.length = 4294967296;
|
||||
|
||||
//CHECK#1
|
||||
var push = obj.push("x", "y", "z");
|
||||
if (push !== 4294967299) {
|
||||
throw new Test262Error('#1: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z") === 4294967299. Actual: ' + (push));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (obj.length !== 4294967299) {
|
||||
throw new Test262Error('#2: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj.length === 4294967299. Actual: ' + (obj.length));
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (obj[0] !== undefined) {
|
||||
throw new Test262Error('#3: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[0] === undefined. Actual: ' + (obj[0]));
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (obj[1] !== undefined) {
|
||||
throw new Test262Error('#4: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[1] === undefined. Actual: ' + (obj[1]));
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (obj[2] !== undefined) {
|
||||
throw new Test262Error('#5: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[2] === undefined. Actual: ' + (obj[2]));
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (obj[4294967296] !== "x") {
|
||||
throw new Test262Error('#6: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[4294967296] === "x". Actual: ' + (obj[4294967296]));
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (obj[4294967297] !== "y") {
|
||||
throw new Test262Error('#7: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[4294967297] === "y". Actual: ' + (obj[4294967297]));
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if (obj[4294967298] !== "z") {
|
||||
throw new Test262Error('#8: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[4294967298] === "z". Actual: ' + (obj[4294967298]));
|
||||
}
|
||||
|
@ -56,13 +48,11 @@ var obj = {};
|
|||
obj.push = Array.prototype.push;
|
||||
obj.length = 4294967296;
|
||||
|
||||
//CHECK#9
|
||||
var push = obj.push();
|
||||
if (push !== 4294967296) {
|
||||
throw new Test262Error('#9: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push() === 4294967296. Actual: ' + (push));
|
||||
}
|
||||
|
||||
//CHECK#10
|
||||
if (obj.length !== 4294967296) {
|
||||
throw new Test262Error('#10: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push(); obj.length === 4294967296. Actual: ' + (obj.length));
|
||||
}
|
||||
|
|
|
@ -11,28 +11,23 @@ var obj = {};
|
|||
obj.push = Array.prototype.push;
|
||||
obj.length = 4294967295;
|
||||
|
||||
//CHECK#1
|
||||
var push = obj.push("x", "y", "z");
|
||||
if (push !== 4294967298) {
|
||||
throw new Test262Error('#1: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967295; obj.push("x", "y", "z") === 4294967298. Actual: ' + (push));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (obj.length !== 4294967298) {
|
||||
throw new Test262Error('#2: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967295; obj.push("x", "y", "z"); obj.length === 4294967298. Actual: ' + (obj.length));
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (obj[4294967295] !== "x") {
|
||||
throw new Test262Error('#3: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967295; obj.push("x", "y", "z"); obj[4294967295] === "x". Actual: ' + (obj[4294967295]));
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (obj[4294967296] !== "y") {
|
||||
throw new Test262Error('#4: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967295; obj.push("x", "y", "z"); obj[4294967296] === "y". Actual: ' + (obj[4294967296]));
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (obj[4294967297] !== "z") {
|
||||
throw new Test262Error('#5: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967295; obj.push("x", "y", "z"); obj[4294967297] === "z". Actual: ' + (obj[4294967297]));
|
||||
}
|
||||
|
|
|
@ -11,43 +11,35 @@ var obj = {};
|
|||
obj.push = Array.prototype.push;
|
||||
obj.length = -1;
|
||||
|
||||
//CHECK#1
|
||||
var push = obj.push("x", "y", "z");
|
||||
if (push !== 3) {
|
||||
throw new Test262Error('#1: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z") === 3. Actual: ' + (push));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (obj.length !== 3) {
|
||||
throw new Test262Error('#2: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj.length === 3. Actual: ' + (obj.length));
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (obj[4294967295] !== undefined) {
|
||||
throw new Test262Error('#3: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[4294967295] === undefined. Actual: ' + (obj[4294967295]));
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (obj[4294967296] !== undefined) {
|
||||
throw new Test262Error('#4: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[4294967296] === undefined. Actual: ' + (obj[4294967296]));
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (obj[4294967297] !== undefined) {
|
||||
throw new Test262Error('#5: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[4294967297] === undefined. Actual: ' + (obj[4294967297]));
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (obj[0] !== "x") {
|
||||
throw new Test262Error('#3: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[0] === "x". Actual: ' + (obj[0]));
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (obj[1] !== "y") {
|
||||
throw new Test262Error('#4: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[1] === "y". Actual: ' + (obj[1]));
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if (obj[2] !== "z") {
|
||||
throw new Test262Error('#5: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[2] === "z". Actual: ' + (obj[2]));
|
||||
}
|
||||
|
|
|
@ -16,29 +16,24 @@ var x = {
|
|||
0: 0
|
||||
};
|
||||
|
||||
//CHECK#1
|
||||
var push = x.push(1);
|
||||
if (push !== 2) {
|
||||
throw new Test262Error('#1: Object.prototype[1] = 1; Object.prototype.length = -1; Object.prototype.push = Array.prototype.push; x = {0:0}; x.push(1) === 2. Actual: ' + (push));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x.length !== 2) {
|
||||
throw new Test262Error('#2: Object.prototype[1] = 1; Object.prototype.length = -1; Object.prototype.push = Array.prototype.push; x = {0:0}; x.push(1); x.length === 2. Actual: ' + (x.length));
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (x[1] !== 1) {
|
||||
throw new Test262Error('#3: Object.prototype[1] = 1; Object.prototype.length = -1; Object.prototype.push = Array.prototype.push; x = {0:0}; x.push(1); x[1] === 1. Actual: ' + (x[1]));
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
delete x[1];
|
||||
if (x[1] !== -1) {
|
||||
throw new Test262Error('#4: Object.prototype[1] = 1; Object.prototype.length = -1; Object.prototype.push = Array.prototype.push; x = {0:0}; x.push(1); delete x[1]; x[1] === -1. Actual: ' + (x[1]));
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
delete x.length;
|
||||
if (x.length !== 1) {
|
||||
throw new Test262Error('#5: Object.prototype[1] = 1; Object.prototype.length = -1; Object.prototype.push = Array.prototype.push; x = {0:0}; delete x; x.push(1); x.length === 1. Actual: ' + (x.length));
|
||||
|
|
|
@ -9,13 +9,7 @@ description: >
|
|||
throw a TypeError exception
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
|
||||
try {
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.push();
|
||||
throw new Test262Error('#1.1: new Array.prototype.push() throw TypeError. Actual: ' + (new Array.prototype.push()));
|
||||
} catch (e) {
|
||||
if ((e instanceof TypeError) !== true) {
|
||||
throw new Test262Error('#1.2: new Array.prototype.push() throw TypeError. Actual: ' + (e));
|
||||
}
|
||||
}
|
||||
throw new Test262Error();
|
||||
});
|
||||
|
|
|
@ -9,14 +9,12 @@ esid: sec-array.prototype.reverse
|
|||
description: Checking case when reverse is given no arguments or one argument
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [];
|
||||
var reverse = x.reverse();
|
||||
if (reverse !== x) {
|
||||
throw new Test262Error('#1: x = []; x.reverse() === x. Actual: ' + (reverse));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
x = [];
|
||||
x[0] = 1;
|
||||
var reverse = x.reverse();
|
||||
|
@ -24,24 +22,20 @@ if (reverse !== x) {
|
|||
throw new Test262Error('#2: x = []; x[0] = 1; x.reverse() === x. Actual: ' + (reverse));
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
x = new Array(1, 2);
|
||||
var reverse = x.reverse();
|
||||
if (reverse !== x) {
|
||||
throw new Test262Error('#3: x = new Array(1,2); x.reverse() === x. Actual: ' + (reverse));
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (x[0] !== 2) {
|
||||
throw new Test262Error('#4: x = new Array(1,2); x.reverse(); x[0] === 2. Actual: ' + (x[0]));
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (x[1] !== 1) {
|
||||
throw new Test262Error('#5: x = new Array(1,2); x.reverse(); x[1] === 1. Actual: ' + (x[1]));
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x.length !== 2) {
|
||||
throw new Test262Error('#6: x = new Array(1,2); x.reverse(); x.length === 2. Actual: ' + (x.length));
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@ esid: sec-array.prototype.reverse
|
|||
description: Checking this algorithm, elements are objects and primitives
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = [];
|
||||
x[0] = true;
|
||||
x[2] = Infinity;
|
||||
|
@ -23,52 +22,42 @@ if (reverse !== x) {
|
|||
throw new Test262Error('#1: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse() === x. Actual: ' + (reverse));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x[0] !== "-1") {
|
||||
throw new Test262Error('#2: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[0] === "-1". Actual: ' + (x[0]));
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (x[1] !== "NaN") {
|
||||
throw new Test262Error('#3: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[1] === "NaN". Actual: ' + (x[1]));
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (x[2] !== undefined) {
|
||||
throw new Test262Error('#4: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[2] === undefined. Actual: ' + (x[2]));
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (x[3] !== undefined) {
|
||||
throw new Test262Error('#5: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[3] === undefined. Actual: ' + (x[3]));
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x[4] !== undefined) {
|
||||
throw new Test262Error('#6: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[4] === undefined. Actual: ' + (x[4]));
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (x[5] !== undefined) {
|
||||
throw new Test262Error('#7: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[5] === undefined. Actual: ' + (x[5]));
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if (x[6] !== undefined) {
|
||||
throw new Test262Error('#8: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[6] === undefined. Actual: ' + (x[6]));
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if (x[7] !== Infinity) {
|
||||
throw new Test262Error('#9: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[7] === Infinity. Actual: ' + (x[7]));
|
||||
}
|
||||
|
||||
//CHECK#10
|
||||
if (x[8] !== undefined) {
|
||||
throw new Test262Error('#10: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[8] === undefined. Actual: ' + (x[8]));
|
||||
}
|
||||
|
||||
//CHECK#11
|
||||
if (x[9] !== true) {
|
||||
throw new Test262Error('#11: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[9] === true. Actual: ' + (x[9]));
|
||||
}
|
||||
|
@ -80,47 +69,38 @@ if (reverse !== x) {
|
|||
throw new Test262Error('#1: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse() === x. Actual: ' + (reverse));
|
||||
}
|
||||
|
||||
//CHECK#12
|
||||
if (x[0] !== undefined) {
|
||||
throw new Test262Error('#12: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[0] === undefined. Actual: ' + (x[0]));
|
||||
}
|
||||
|
||||
//CHECK#13
|
||||
if (x[1] !== Infinity) {
|
||||
throw new Test262Error('#13: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[1] === Infinity. Actual: ' + (x[1]));
|
||||
}
|
||||
|
||||
//CHECK#14
|
||||
if (x[2] !== undefined) {
|
||||
throw new Test262Error('#14: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[2] === undefined. Actual: ' + (x[2]));
|
||||
}
|
||||
|
||||
//CHECK#15
|
||||
if (x[3] !== undefined) {
|
||||
throw new Test262Error('#15: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[3] === undefined. Actual: ' + (x[3]));
|
||||
}
|
||||
|
||||
//CHECK#16
|
||||
if (x[4] !== undefined) {
|
||||
throw new Test262Error('#16: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[4] === undefined. Actual: ' + (x[4]));
|
||||
}
|
||||
|
||||
//CHECK#17
|
||||
if (x[5] !== undefined) {
|
||||
throw new Test262Error('#17: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[5] === undefined. Actual: ' + (x[5]));
|
||||
}
|
||||
|
||||
//CHECK#18
|
||||
if (x[6] !== undefined) {
|
||||
throw new Test262Error('#18: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[6] === undefined. Actual: ' + (x[6]));
|
||||
}
|
||||
|
||||
//CHECK#19
|
||||
if (x[7] !== "NaN") {
|
||||
throw new Test262Error('#19: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[7] === "NaN". Actual: ' + (x[7]));
|
||||
}
|
||||
|
||||
//CHECK#20
|
||||
if (x[8] !== "-1") {
|
||||
throw new Test262Error('#20: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[8] === "-1". Actual: ' + (x[8]));
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ description: >
|
|||
primitives, length is integer
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var obj = {};
|
||||
obj.length = 10;
|
||||
obj.reverse = Array.prototype.reverse;
|
||||
|
@ -28,52 +27,42 @@ if (reverse !== obj) {
|
|||
throw new Test262Error('#1: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse() === obj. Actual: ' + (reverse));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (obj[0] !== "-1") {
|
||||
throw new Test262Error('#2: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[0] === "-1". Actual: ' + (obj[0]));
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (obj[1] !== "NaN") {
|
||||
throw new Test262Error('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[1] === "NaN". Actual: ' + (obj[1]));
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (obj[2] !== undefined) {
|
||||
throw new Test262Error('#4: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2]));
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (obj[3] !== undefined) {
|
||||
throw new Test262Error('#5: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3]));
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (obj[4] !== undefined) {
|
||||
throw new Test262Error('#6: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4]));
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (obj[5] !== undefined) {
|
||||
throw new Test262Error('#7: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5]));
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if (obj[6] !== undefined) {
|
||||
throw new Test262Error('#8: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6]));
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if (obj[7] !== Infinity) {
|
||||
throw new Test262Error('#9: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[7] === Infinity. Actual: ' + (obj[7]));
|
||||
}
|
||||
|
||||
//CHECK#10
|
||||
if (obj[8] !== undefined) {
|
||||
throw new Test262Error('#10: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[8] === undefined. Actual: ' + (obj[8]));
|
||||
}
|
||||
|
||||
//CHECK#11
|
||||
if (obj[9] !== true) {
|
||||
throw new Test262Error('#11: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[9] === true. Actual: ' + (obj[9]));
|
||||
}
|
||||
|
@ -85,47 +74,38 @@ if (reverse !== obj) {
|
|||
throw new Test262Error('#1: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse() === obj. Actual: ' + (reverse));
|
||||
}
|
||||
|
||||
//CHECK#12
|
||||
if (obj[0] !== undefined) {
|
||||
throw new Test262Error('#12: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[0] === undefined. Actual: ' + (obj[0]));
|
||||
}
|
||||
|
||||
//CHECK#13
|
||||
if (obj[1] !== Infinity) {
|
||||
throw new Test262Error('#13: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[1] === Infinity. Actual: ' + (obj[1]));
|
||||
}
|
||||
|
||||
//CHECK#14
|
||||
if (obj[2] !== undefined) {
|
||||
throw new Test262Error('#14: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2]));
|
||||
}
|
||||
|
||||
//CHECK#15
|
||||
if (obj[3] !== undefined) {
|
||||
throw new Test262Error('#15: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3]));
|
||||
}
|
||||
|
||||
//CHECK#16
|
||||
if (obj[4] !== undefined) {
|
||||
throw new Test262Error('#16: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4]));
|
||||
}
|
||||
|
||||
//CHECK#17
|
||||
if (obj[5] !== undefined) {
|
||||
throw new Test262Error('#17: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5]));
|
||||
}
|
||||
|
||||
//CHECK#18
|
||||
if (obj[6] !== undefined) {
|
||||
throw new Test262Error('#18: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6]));
|
||||
}
|
||||
|
||||
//CHECK#19
|
||||
if (obj[7] !== "NaN") {
|
||||
throw new Test262Error('#19: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[7] === "NaN". Actual: ' + (obj[7]));
|
||||
}
|
||||
|
||||
//CHECK#20
|
||||
if (obj[8] !== "-1") {
|
||||
throw new Test262Error('#20: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[8] === "-1". Actual: ' + (obj[8]));
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ description: >
|
|||
primitives, length is not integer
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var obj = {};
|
||||
obj.length = 10.5;
|
||||
obj.reverse = Array.prototype.reverse;
|
||||
|
@ -28,52 +27,42 @@ if (reverse !== obj) {
|
|||
throw new Test262Error('#1: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse() === obj. Actual: ' + (reverse));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (obj[0] !== "-1") {
|
||||
throw new Test262Error('#2: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[0] === "-1". Actual: ' + (obj[0]));
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (obj[1] !== "NaN") {
|
||||
throw new Test262Error('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[1] === "NaN". Actual: ' + (obj[1]));
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (obj[2] !== undefined) {
|
||||
throw new Test262Error('#4: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2]));
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (obj[3] !== undefined) {
|
||||
throw new Test262Error('#5: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3]));
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (obj[4] !== undefined) {
|
||||
throw new Test262Error('#6: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4]));
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (obj[5] !== undefined) {
|
||||
throw new Test262Error('#7: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5]));
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if (obj[6] !== undefined) {
|
||||
throw new Test262Error('#8: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6]));
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if (obj[7] !== Infinity) {
|
||||
throw new Test262Error('#9: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[7] === Infinity. Actual: ' + (obj[7]));
|
||||
}
|
||||
|
||||
//CHECK#10
|
||||
if (obj[8] !== undefined) {
|
||||
throw new Test262Error('#10: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[8] === undefined. Actual: ' + (obj[8]));
|
||||
}
|
||||
|
||||
//CHECK#11
|
||||
if (obj[9] !== true) {
|
||||
throw new Test262Error('#11: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[9] === true. Actual: ' + (obj[9]));
|
||||
}
|
||||
|
@ -85,47 +74,38 @@ if (reverse !== obj) {
|
|||
throw new Test262Error('#1: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse() === obj. Actual: ' + (reverse));
|
||||
}
|
||||
|
||||
//CHECK#12
|
||||
if (obj[0] !== undefined) {
|
||||
throw new Test262Error('#12: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[0] === undefined. Actual: ' + (obj[0]));
|
||||
}
|
||||
|
||||
//CHECK#13
|
||||
if (obj[1] !== Infinity) {
|
||||
throw new Test262Error('#13: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[1] === Infinity. Actual: ' + (obj[1]));
|
||||
}
|
||||
|
||||
//CHECK#14
|
||||
if (obj[2] !== undefined) {
|
||||
throw new Test262Error('#14: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2]));
|
||||
}
|
||||
|
||||
//CHECK#15
|
||||
if (obj[3] !== undefined) {
|
||||
throw new Test262Error('#15: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3]));
|
||||
}
|
||||
|
||||
//CHECK#16
|
||||
if (obj[4] !== undefined) {
|
||||
throw new Test262Error('#16: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4]));
|
||||
}
|
||||
|
||||
//CHECK#17
|
||||
if (obj[5] !== undefined) {
|
||||
throw new Test262Error('#17: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5]));
|
||||
}
|
||||
|
||||
//CHECK#18
|
||||
if (obj[6] !== undefined) {
|
||||
throw new Test262Error('#18: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6]));
|
||||
}
|
||||
|
||||
//CHECK#19
|
||||
if (obj[7] !== "NaN") {
|
||||
throw new Test262Error('#19: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[7] === "NaN". Actual: ' + (obj[7]));
|
||||
}
|
||||
|
||||
//CHECK#20
|
||||
if (obj[8] !== "-1") {
|
||||
throw new Test262Error('#20: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[8] === "-1". Actual: ' + (obj[8]));
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ description: >
|
|||
primitives, length is string
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var obj = {};
|
||||
obj.length = "10";
|
||||
obj.reverse = Array.prototype.reverse;
|
||||
|
@ -28,52 +27,42 @@ if (reverse !== obj) {
|
|||
throw new Test262Error('#1: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse() === obj. Actual: ' + (reverse));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (obj[0] !== "-1") {
|
||||
throw new Test262Error('#2: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[0] === "-1". Actual: ' + (obj[0]));
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (obj[1] !== "NaN") {
|
||||
throw new Test262Error('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[1] === "NaN". Actual: ' + (obj[1]));
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (obj[2] !== undefined) {
|
||||
throw new Test262Error('#4: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2]));
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (obj[3] !== undefined) {
|
||||
throw new Test262Error('#5: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3]));
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (obj[4] !== undefined) {
|
||||
throw new Test262Error('#6: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4]));
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (obj[5] !== undefined) {
|
||||
throw new Test262Error('#7: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5]));
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if (obj[6] !== undefined) {
|
||||
throw new Test262Error('#8: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6]));
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if (obj[7] !== Infinity) {
|
||||
throw new Test262Error('#9: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[7] === Infinity. Actual: ' + (obj[7]));
|
||||
}
|
||||
|
||||
//CHECK#10
|
||||
if (obj[8] !== undefined) {
|
||||
throw new Test262Error('#10: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[8] === undefined. Actual: ' + (obj[8]));
|
||||
}
|
||||
|
||||
//CHECK#11
|
||||
if (obj[9] !== true) {
|
||||
throw new Test262Error('#11: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[9] === true. Actual: ' + (obj[9]));
|
||||
}
|
||||
|
@ -85,47 +74,38 @@ if (reverse !== obj) {
|
|||
throw new Test262Error('#1: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse() === obj. Actual: ' + (reverse));
|
||||
}
|
||||
|
||||
//CHECK#12
|
||||
if (obj[0] !== undefined) {
|
||||
throw new Test262Error('#12: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[0] === undefined. Actual: ' + (obj[0]));
|
||||
}
|
||||
|
||||
//CHECK#13
|
||||
if (obj[1] !== Infinity) {
|
||||
throw new Test262Error('#13: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[1] === Infinity. Actual: ' + (obj[1]));
|
||||
}
|
||||
|
||||
//CHECK#14
|
||||
if (obj[2] !== undefined) {
|
||||
throw new Test262Error('#14: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2]));
|
||||
}
|
||||
|
||||
//CHECK#15
|
||||
if (obj[3] !== undefined) {
|
||||
throw new Test262Error('#15: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3]));
|
||||
}
|
||||
|
||||
//CHECK#16
|
||||
if (obj[4] !== undefined) {
|
||||
throw new Test262Error('#16: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4]));
|
||||
}
|
||||
|
||||
//CHECK#17
|
||||
if (obj[5] !== undefined) {
|
||||
throw new Test262Error('#17: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5]));
|
||||
}
|
||||
|
||||
//CHECK#18
|
||||
if (obj[6] !== undefined) {
|
||||
throw new Test262Error('#18: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6]));
|
||||
}
|
||||
|
||||
//CHECK#19
|
||||
if (obj[7] !== "NaN") {
|
||||
throw new Test262Error('#19: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[7] === "NaN". Actual: ' + (obj[7]));
|
||||
}
|
||||
|
||||
//CHECK#20
|
||||
if (obj[8] !== "-1") {
|
||||
throw new Test262Error('#20: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[8] === "-1". Actual: ' + (obj[8]));
|
||||
}
|
||||
|
|
|
@ -14,28 +14,23 @@ obj[1] = "y";
|
|||
obj[2] = "z";
|
||||
obj.length = -4294967294;
|
||||
|
||||
//CHECK#1
|
||||
var reverse = obj.reverse();
|
||||
if (reverse !== obj) {
|
||||
throw new Test262Error('#1: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.reverse() === obj. Actual: ' + (reverse));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (obj.length !== -4294967294) {
|
||||
throw new Test262Error('#2: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.reverse(); obj.length === -4294967294. Actual: ' + (obj.length));
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (obj[0] !== "x") {
|
||||
throw new Test262Error('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.reverse(); obj[0] === "x". Actual: ' + (obj[0]));
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (obj[1] !== "y") {
|
||||
throw new Test262Error('#4: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.reverse(); obj[1] === "y". Actual: ' + (obj[1]));
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (obj[2] !== "z") {
|
||||
throw new Test262Error('#5: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.reverse(); obj[2] === "z". Actual: ' + (obj[2]));
|
||||
}
|
||||
|
|
|
@ -14,24 +14,20 @@ var x = [0];
|
|||
x.length = 2;
|
||||
x.reverse();
|
||||
|
||||
//CHECK#1
|
||||
if (x[0] !== 1) {
|
||||
throw new Test262Error('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.reverse(); x[0] === 1. Actual: ' + (x[0]));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x[1] !== 0) {
|
||||
throw new Test262Error('#2: Array.prototype[1] = 1; x = [0]; x.length = 2; x.reverse(); x[1] === 0. Actual: ' + (x[1]));
|
||||
}
|
||||
|
||||
x.length = 0;
|
||||
|
||||
//CHECK#3
|
||||
if (x[0] !== undefined) {
|
||||
throw new Test262Error('#3: Array.prototype[1] = 1; x = [0]; x.length = 2; x.reverse(); x.length = 0; x[0] === undefined. Actual: ' + (x[0]));
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (x[1] !== 1) {
|
||||
throw new Test262Error('#4: Array.prototype[1] = 1; x = [0]; x.length = 2; x.reverse(); x.length = 0; x[1] === 1. Actual: ' + (x[1]));
|
||||
}
|
||||
|
@ -44,12 +40,10 @@ x = {
|
|||
};
|
||||
x.reverse();
|
||||
|
||||
//CHECK#5
|
||||
if (x[0] !== 1) {
|
||||
throw new Test262Error('#5: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.reverse = Array.prototype.reverse; x = {0:0}; x.reverse(); x[0] === 0. Actual: ' + (x[0]));
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x[1] !== 0) {
|
||||
throw new Test262Error('#6: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.reverse = Array.prototype.reverse; x = {0:0}; x.reverse(); x[1] === 0. Actual: ' + (x[1]));
|
||||
}
|
||||
|
@ -57,12 +51,10 @@ if (x[1] !== 0) {
|
|||
delete x[0];
|
||||
delete x[1];
|
||||
|
||||
//CHECK#7
|
||||
if (x[0] !== undefined) {
|
||||
throw new Test262Error('#7: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.reverse = Array.prototype.reverse; x = {0:0}; x.reverse(); delete x[0]; delete x[1]; x[0] === undefined. Actual: ' + (x[0]));
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if (x[1] !== 1) {
|
||||
throw new Test262Error('#8: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.reverse = Array.prototype.reverse; x = {0:0}; x.reverse(); delete x[0]; delete x[1]; x[1] === 1. Actual: ' + (x[1]));
|
||||
}
|
||||
|
|
|
@ -14,24 +14,20 @@ var x = [0, 1];
|
|||
x.length = 2;
|
||||
x.reverse();
|
||||
|
||||
//CHECK#1
|
||||
if (x[0] !== 1) {
|
||||
throw new Test262Error('#1: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.reverse(); x[0] === 1. Actual: ' + (x[0]));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x[1] !== 0) {
|
||||
throw new Test262Error('#2: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.reverse(); x[1] === 0. Actual: ' + (x[1]));
|
||||
}
|
||||
|
||||
x.length = 0;
|
||||
|
||||
//CHECK#3
|
||||
if (x[0] !== undefined) {
|
||||
throw new Test262Error('#3: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.reverse(); x.length = 0; x[0] === undefined. Actual: ' + (x[0]));
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (x[1] !== -1) {
|
||||
throw new Test262Error('#4: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.reverse(); x.length = 0; x[1] === -1. Actual: ' + (x[1]));
|
||||
}
|
||||
|
@ -45,12 +41,10 @@ x = {
|
|||
};
|
||||
x.reverse();
|
||||
|
||||
//CHECK#5
|
||||
if (x[0] !== 1) {
|
||||
throw new Test262Error('#5: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.reverse = Array.prototype.reverse; x = {0:0,1:1}; x.reverse(); x[0] === 0. Actual: ' + (x[0]));
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x[1] !== 0) {
|
||||
throw new Test262Error('#6: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.reverse = Array.prototype.reverse; x = {0:0,1:1}; x.reverse(); x[1] === 0. Actual: ' + (x[1]));
|
||||
}
|
||||
|
@ -58,12 +52,10 @@ if (x[1] !== 0) {
|
|||
delete x[0];
|
||||
delete x[1];
|
||||
|
||||
//CHECK#7
|
||||
if (x[0] !== undefined) {
|
||||
throw new Test262Error('#7: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.reverse = Array.prototype.reverse; x = {0:0,1:1}; x.reverse(); delete x[0]; delete x[1]; x[0] === undefined. Actual: ' + (x[0]));
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if (x[1] !== -1) {
|
||||
throw new Test262Error('#8: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.reverse = Array.prototype.reverse; x = {0:0,1:1}; x.reverse(); delete x[0]; delete x[1]; x[1] === -1. Actual: ' + (x[1]));
|
||||
}
|
||||
|
|
|
@ -9,13 +9,7 @@ description: >
|
|||
throw a TypeError exception
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
|
||||
try {
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.reverse();
|
||||
throw new Test262Error('#1.1: new Array.prototype.reverse() throw TypeError. Actual: ' + (new Array.prototype.reverse()));
|
||||
} catch (e) {
|
||||
if ((e instanceof TypeError) !== true) {
|
||||
throw new Test262Error('#1.2: new Array.prototype.reverse() throw TypeError. Actual: ' + (e));
|
||||
}
|
||||
}
|
||||
throw new Test262Error();
|
||||
});
|
||||
|
|
|
@ -9,19 +9,16 @@ esid: sec-array.prototype.shift
|
|||
description: Checking this algorithm
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = new Array();
|
||||
var shift = x.shift();
|
||||
if (shift !== undefined) {
|
||||
throw new Test262Error('#1: var x = new Array(); x.shift() === undefined. Actual: ' + (shift));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x.length !== 0) {
|
||||
throw new Test262Error('#2: var x = new Array(); x.shift(); x.length === 0. Actual: ' + (x.length));
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
var x = Array(1, 2, 3);
|
||||
x.length = 0;
|
||||
var shift = x.shift();
|
||||
|
@ -29,7 +26,6 @@ if (shift !== undefined) {
|
|||
throw new Test262Error('#2: var x = Array(1,2,3); x.length = 0; x.shift() === undefined. Actual: ' + (shift));
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (x.length !== 0) {
|
||||
throw new Test262Error('#4: var x = new Array(1,2,3); x.length = 0; x.shift(); x.length === 0. Actual: ' + (x.length));
|
||||
}
|
||||
|
|
|
@ -9,29 +9,24 @@ esid: sec-array.prototype.shift
|
|||
description: Checking this use new Array() and []
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var x = new Array(0, 1, 2, 3);
|
||||
var shift = x.shift();
|
||||
if (shift !== 0) {
|
||||
throw new Test262Error('#1: x = new Array(0,1,2,3); x.shift() === 0. Actual: ' + (shift));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x.length !== 3) {
|
||||
throw new Test262Error('#2: x = new Array(0,1,2,3); x.shift(); x.length == 3');
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (x[0] !== 1) {
|
||||
throw new Test262Error('#3: x = new Array(0,1,2,3); x.shift(); x[0] == 1');
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (x[1] !== 2) {
|
||||
throw new Test262Error('#4: x = new Array(0,1,2,3); x.shift(); x[1] == 2');
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
x = [];
|
||||
x[0] = 0;
|
||||
x[3] = 3;
|
||||
|
@ -40,29 +35,24 @@ if (shift !== 0) {
|
|||
throw new Test262Error('#5: x = []; x[0] = 0; x[3] = 3; x.shift() === 0. Actual: ' + (shift));
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x.length !== 3) {
|
||||
throw new Test262Error('#6: x = []; x[0] = 0; x[3] = 3; x.shift(); x.length == 3');
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (x[0] !== undefined) {
|
||||
throw new Test262Error('#7: x = []; x[0] = 0; x[3] = 3; x.shift(); x[0] == undefined');
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if (x[12] !== undefined) {
|
||||
throw new Test262Error('#8: x = []; x[0] = 0; x[3] = 3; x.shift(); x[1] == undefined');
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
x.length = 1;
|
||||
var shift = x.shift();
|
||||
if (shift !== undefined) {
|
||||
throw new Test262Error('#9: x = []; x[0] = 0; x[3] = 3; x.shift(); x.length = 1; x.shift() === undefined. Actual: ' + (shift));
|
||||
}
|
||||
|
||||
//CHECK#10
|
||||
if (x.length !== 0) {
|
||||
throw new Test262Error('#10: x = []; x[0] = 0; x[3] = 3; x.shift(); x.length = 1; x.shift(); x.length === 0. Actual: ' + (x.length));
|
||||
}
|
||||
|
|
|
@ -17,37 +17,31 @@ obj.shift = Array.prototype.shift;
|
|||
if (obj.length !== undefined) {
|
||||
throw new Test262Error('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length));
|
||||
} else {
|
||||
//CHECK#1
|
||||
var shift = obj.shift();
|
||||
if (shift !== undefined) {
|
||||
throw new Test262Error('#1: var obj = {}; obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift));
|
||||
}
|
||||
//CHECK#2
|
||||
if (obj.length !== 0) {
|
||||
throw new Test262Error('#2: var obj = {}; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 0. Actual: ' + (obj.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
obj.length = undefined;
|
||||
var shift = obj.shift();
|
||||
if (shift !== undefined) {
|
||||
throw new Test262Error('#3: var obj = {}; obj.length = undefined; obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift));
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (obj.length !== 0) {
|
||||
throw new Test262Error('#4: var obj = {}; obj.length = undefined; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 0. Actual: ' + (obj.length));
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
obj.length = null
|
||||
var shift = obj.shift();
|
||||
if (shift !== undefined) {
|
||||
throw new Test262Error('#5: var obj = {}; obj.length = null; obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift));
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (obj.length !== 0) {
|
||||
throw new Test262Error('#6: var obj = {}; obj.length = null; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 0. Actual: ' + (obj.length));
|
||||
}
|
||||
|
|
|
@ -14,38 +14,32 @@ description: >
|
|||
var obj = {};
|
||||
obj.shift = Array.prototype.shift;
|
||||
|
||||
//CHECK#1
|
||||
obj.length = NaN;
|
||||
var shift = obj.shift();
|
||||
if (shift !== undefined) {
|
||||
throw new Test262Error('#1: var obj = {}; obj.length = NaN; obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (obj.length !== 0) {
|
||||
throw new Test262Error('#2: var obj = {}; obj.length = NaN; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 0. Actual: ' + (obj.length));
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
obj.length = Number.NEGATIVE_INFINITY;
|
||||
var shift = obj.shift();
|
||||
if (shift !== undefined) {
|
||||
throw new Test262Error('#5: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift));
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (obj.length !== 0) {
|
||||
throw new Test262Error('#6: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 0. Actual: ' + (obj.length));
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
obj.length = -0;
|
||||
var shift = obj.shift();
|
||||
if (shift !== undefined) {
|
||||
throw new Test262Error('#7: var obj = {}; obj.length = -0; obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift));
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if (obj.length !== 0) {
|
||||
throw new Test262Error('#8: var obj = {}; obj.length = -0; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 0. Actual: ' + (obj.length));
|
||||
} else {
|
||||
|
@ -54,26 +48,22 @@ if (obj.length !== 0) {
|
|||
}
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
obj.length = 0.5;
|
||||
var shift = obj.shift();
|
||||
if (shift !== undefined) {
|
||||
throw new Test262Error('#9: var obj = {}; obj.length = 0.5; obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift));
|
||||
}
|
||||
|
||||
//CHECK#10
|
||||
if (obj.length !== 0) {
|
||||
throw new Test262Error('#10: var obj = {}; obj.length = 0.5; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 0. Actual: ' + (obj.length));
|
||||
}
|
||||
|
||||
//CHECK#11
|
||||
obj.length = new Number(0);
|
||||
var shift = obj.shift();
|
||||
if (shift !== undefined) {
|
||||
throw new Test262Error('#11: var obj = {}; obj.length = new Number(0); obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift));
|
||||
}
|
||||
|
||||
//CHECK#12
|
||||
if (obj.length !== 0) {
|
||||
throw new Test262Error('#12: var obj = {}; obj.length = new Number(0); obj.shift = Array.prototype.shift; obj.shift(); obj.length === 0. Actual: ' + (obj.length));
|
||||
}
|
||||
|
|
|
@ -14,26 +14,22 @@ description: >
|
|||
var obj = {};
|
||||
obj.shift = Array.prototype.shift;
|
||||
|
||||
//CHECK#1
|
||||
obj.length = 2.5;
|
||||
var shift = obj.shift();
|
||||
if (shift !== undefined) {
|
||||
throw new Test262Error('#1: var obj = {}; obj.length = 2.5; obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (obj.length !== 1) {
|
||||
throw new Test262Error('#2: var obj = {}; obj.length = 2.5; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 1. Actual: ' + (obj.length));
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
obj.length = new Number(2);
|
||||
var shift = obj.shift();
|
||||
if (shift !== undefined) {
|
||||
throw new Test262Error('#11: var obj = {}; obj.length = new Number(2); obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift));
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (obj.length !== 1) {
|
||||
throw new Test262Error('#12: var obj = {}; obj.length = new Number(2); obj.shift = Array.prototype.shift; obj.shift(); obj.length === 1. Actual: ' + (obj.length));
|
||||
}
|
||||
|
|
|
@ -16,37 +16,31 @@ obj["0"] = 0;
|
|||
obj["3"] = 3;
|
||||
obj.shift = Array.prototype.shift;
|
||||
|
||||
//CHECK#1
|
||||
obj.length = 4;
|
||||
var shift = obj.shift();
|
||||
if (shift !== 0) {
|
||||
throw new Test262Error('#1: var obj = {}; obj["0"] = 0; obj["3"] = 3; obj.length = 4; obj.shift = Array.prototype.shift; obj.shift() === 0. Actual: ' + (shift));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (obj.length !== 3) {
|
||||
throw new Test262Error('#2: var obj = {}; obj["0"] = 0; obj["3"] = 3; obj.length = 4; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 3. Actual: ' + (obj.length));
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
var shift = obj.shift();
|
||||
if (shift !== undefined) {
|
||||
throw new Test262Error('#3: var obj = {}; obj["0"] = 0; obj["3"] = 3; obj.length = 4; obj.shift = Array.prototype.shift; obj.shift(); obj.shift() === undefined. Actual: ' + (shift));
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (obj.length !== 2) {
|
||||
throw new Test262Error('#4: var obj = {}; obj["0"] = 0; obj["3"] = 3; obj.length = 4; obj.shift = Array.prototype.shift; obj.shift(); obj.shift(); obj.length === 2. Actual: ' + (obj.length));
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
obj.length = 1;
|
||||
var shift = obj.shift();
|
||||
if (shift !== undefined) {
|
||||
throw new Test262Error('#5: var obj = {}; obj["0"] = 0; obj["3"] = 3; obj.length = 4; obj.shift = Array.prototype.shift; obj.shift(); obj.shift(); obj.length = 1; obj.shift() === undefined. Actual: ' + (shift));
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (obj.length !== 0) {
|
||||
throw new Test262Error('#6: var obj = {}; obj["0"] = 0; obj["3"] = 3; obj.length = 4; obj.shift = Array.prototype.shift; obj.shift(); obj.shift(); obj.length = 1; obj.shift(); obj.length === 0. Actual: ' + (obj.length));
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue