mirror of https://github.com/tc39/test262.git
add esid to array/prototype/reverse tests
This commit is contained in:
parent
8da8fff0ad
commit
a62da2b499
|
@ -5,6 +5,7 @@
|
|||
info: >
|
||||
The elements of the array are rearranged so as to reverse their order.
|
||||
The object is returned as the result of the call
|
||||
esid: sec-array.prototype.reverse
|
||||
es5id: 15.4.4.8_A1_T1
|
||||
description: Checking case when reverse is given no arguments or one argument
|
||||
---*/
|
||||
|
@ -14,7 +15,7 @@ var x = [];
|
|||
var reverse = x.reverse();
|
||||
if (reverse !== x) {
|
||||
$ERROR('#1: x = []; x.reverse() === x. Actual: ' + (reverse));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
x = [];
|
||||
|
@ -39,7 +40,7 @@ if (x[0] !== 2) {
|
|||
//CHECK#5
|
||||
if (x[1] !== 1) {
|
||||
$ERROR('#5: x = new Array(1,2); x.reverse(); x[1] === 1. Actual: ' + (x[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x.length !== 2) {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
info: >
|
||||
The elements of the array are rearranged so as to reverse their order.
|
||||
The object is returned as the result of the call
|
||||
esid: sec-array.prototype.reverse
|
||||
es5id: 15.4.4.8_A1_T2
|
||||
description: Checking this algorithm, elements are objects and primitives
|
||||
---*/
|
||||
|
@ -31,7 +32,7 @@ if (x[0] !== "-1") {
|
|||
//CHECK#3
|
||||
if (x[1] !== "NaN") {
|
||||
$ERROR('#3: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[1] === "NaN". Actual: ' + (x[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (x[2] !== undefined) {
|
||||
|
@ -41,7 +42,7 @@ if (x[2] !== undefined) {
|
|||
//CHECK#5
|
||||
if (x[3] !== undefined) {
|
||||
$ERROR('#5: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[3] === undefined. Actual: ' + (x[3]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x[4] !== undefined) {
|
||||
|
@ -56,7 +57,7 @@ if (x[5] !== undefined) {
|
|||
//CHECK#8
|
||||
if (x[6] !== undefined) {
|
||||
$ERROR('#8: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[6] === undefined. Actual: ' + (x[6]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if (x[7] !== Infinity) {
|
||||
|
@ -71,7 +72,7 @@ if (x[8] !== undefined) {
|
|||
//CHECK#11
|
||||
if (x[9] !== true) {
|
||||
$ERROR('#11: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[9] === true. Actual: ' + (x[9]));
|
||||
}
|
||||
}
|
||||
|
||||
x.length = 9;
|
||||
|
||||
|
@ -88,7 +89,7 @@ if (x[0] !== undefined) {
|
|||
//CHECK#13
|
||||
if (x[1] !== Infinity) {
|
||||
$ERROR('#13: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[1] === Infinity. Actual: ' + (x[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#14
|
||||
if (x[2] !== undefined) {
|
||||
|
@ -98,7 +99,7 @@ if (x[2] !== undefined) {
|
|||
//CHECK#15
|
||||
if (x[3] !== undefined) {
|
||||
$ERROR('#15: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[3] === undefined. Actual: ' + (x[3]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#16
|
||||
if (x[4] !== undefined) {
|
||||
|
@ -113,7 +114,7 @@ if (x[5] !== undefined) {
|
|||
//CHECK#18
|
||||
if (x[6] !== undefined) {
|
||||
$ERROR('#18: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[6] === undefined. Actual: ' + (x[6]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#19
|
||||
if (x[7] !== "NaN") {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
info: >
|
||||
The reverse function is intentionally generic.
|
||||
It does not require that its this value be an Array object
|
||||
esid: sec-array.prototype.reverse
|
||||
es5id: 15.4.4.8_A2_T1
|
||||
description: >
|
||||
Checking this for Object object, elements are objects and
|
||||
|
@ -36,7 +37,7 @@ if (obj[0] !== "-1") {
|
|||
//CHECK#3
|
||||
if (obj[1] !== "NaN") {
|
||||
$ERROR('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[1] === "NaN". Actual: ' + (obj[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (obj[2] !== undefined) {
|
||||
|
@ -46,7 +47,7 @@ if (obj[2] !== undefined) {
|
|||
//CHECK#5
|
||||
if (obj[3] !== undefined) {
|
||||
$ERROR('#5: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (obj[4] !== undefined) {
|
||||
|
@ -61,7 +62,7 @@ if (obj[5] !== undefined) {
|
|||
//CHECK#8
|
||||
if (obj[6] !== undefined) {
|
||||
$ERROR('#8: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if (obj[7] !== Infinity) {
|
||||
|
@ -76,7 +77,7 @@ if (obj[8] !== undefined) {
|
|||
//CHECK#11
|
||||
if (obj[9] !== true) {
|
||||
$ERROR('#11: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[9] === true. Actual: ' + (obj[9]));
|
||||
}
|
||||
}
|
||||
|
||||
obj.length = 9;
|
||||
|
||||
|
@ -93,7 +94,7 @@ if (obj[0] !== undefined) {
|
|||
//CHECK#13
|
||||
if (obj[1] !== Infinity) {
|
||||
$ERROR('#13: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[1] === Infinity. Actual: ' + (obj[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#14
|
||||
if (obj[2] !== undefined) {
|
||||
|
@ -103,7 +104,7 @@ if (obj[2] !== undefined) {
|
|||
//CHECK#15
|
||||
if (obj[3] !== undefined) {
|
||||
$ERROR('#15: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#16
|
||||
if (obj[4] !== undefined) {
|
||||
|
@ -118,7 +119,7 @@ if (obj[5] !== undefined) {
|
|||
//CHECK#18
|
||||
if (obj[6] !== undefined) {
|
||||
$ERROR('#18: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#19
|
||||
if (obj[7] !== "NaN") {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
info: >
|
||||
The reverse function is intentionally generic.
|
||||
It does not require that its this value be an Array object
|
||||
esid: sec-array.prototype.reverse
|
||||
es5id: 15.4.4.8_A2_T2
|
||||
description: >
|
||||
Checking this for Object object, elements are objects and
|
||||
|
@ -36,7 +37,7 @@ if (obj[0] !== "-1") {
|
|||
//CHECK#3
|
||||
if (obj[1] !== "NaN") {
|
||||
$ERROR('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[1] === "NaN". Actual: ' + (obj[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (obj[2] !== undefined) {
|
||||
|
@ -46,7 +47,7 @@ if (obj[2] !== undefined) {
|
|||
//CHECK#5
|
||||
if (obj[3] !== undefined) {
|
||||
$ERROR('#5: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (obj[4] !== undefined) {
|
||||
|
@ -61,7 +62,7 @@ if (obj[5] !== undefined) {
|
|||
//CHECK#8
|
||||
if (obj[6] !== undefined) {
|
||||
$ERROR('#8: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if (obj[7] !== Infinity) {
|
||||
|
@ -76,7 +77,7 @@ if (obj[8] !== undefined) {
|
|||
//CHECK#11
|
||||
if (obj[9] !== true) {
|
||||
$ERROR('#11: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[9] === true. Actual: ' + (obj[9]));
|
||||
}
|
||||
}
|
||||
|
||||
obj.length = new Number(9.5);
|
||||
|
||||
|
@ -93,7 +94,7 @@ if (obj[0] !== undefined) {
|
|||
//CHECK#13
|
||||
if (obj[1] !== Infinity) {
|
||||
$ERROR('#13: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[1] === Infinity. Actual: ' + (obj[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#14
|
||||
if (obj[2] !== undefined) {
|
||||
|
@ -103,7 +104,7 @@ if (obj[2] !== undefined) {
|
|||
//CHECK#15
|
||||
if (obj[3] !== undefined) {
|
||||
$ERROR('#15: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#16
|
||||
if (obj[4] !== undefined) {
|
||||
|
@ -118,7 +119,7 @@ if (obj[5] !== undefined) {
|
|||
//CHECK#18
|
||||
if (obj[6] !== undefined) {
|
||||
$ERROR('#18: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#19
|
||||
if (obj[7] !== "NaN") {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
info: >
|
||||
The reverse function is intentionally generic.
|
||||
It does not require that its this value be an Array object
|
||||
esid: sec-array.prototype.reverse
|
||||
es5id: 15.4.4.8_A2_T3
|
||||
description: >
|
||||
Checking this for Object object, elements are objects and
|
||||
|
@ -36,7 +37,7 @@ if (obj[0] !== "-1") {
|
|||
//CHECK#3
|
||||
if (obj[1] !== "NaN") {
|
||||
$ERROR('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[1] === "NaN". Actual: ' + (obj[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (obj[2] !== undefined) {
|
||||
|
@ -46,7 +47,7 @@ if (obj[2] !== undefined) {
|
|||
//CHECK#5
|
||||
if (obj[3] !== undefined) {
|
||||
$ERROR('#5: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (obj[4] !== undefined) {
|
||||
|
@ -61,7 +62,7 @@ if (obj[5] !== undefined) {
|
|||
//CHECK#8
|
||||
if (obj[6] !== undefined) {
|
||||
$ERROR('#8: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if (obj[7] !== Infinity) {
|
||||
|
@ -76,7 +77,7 @@ if (obj[8] !== undefined) {
|
|||
//CHECK#11
|
||||
if (obj[9] !== true) {
|
||||
$ERROR('#11: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[9] === true. Actual: ' + (obj[9]));
|
||||
}
|
||||
}
|
||||
|
||||
obj.length = new String("9");
|
||||
|
||||
|
@ -93,7 +94,7 @@ if (obj[0] !== undefined) {
|
|||
//CHECK#13
|
||||
if (obj[1] !== Infinity) {
|
||||
$ERROR('#13: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[1] === Infinity. Actual: ' + (obj[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#14
|
||||
if (obj[2] !== undefined) {
|
||||
|
@ -103,7 +104,7 @@ if (obj[2] !== undefined) {
|
|||
//CHECK#15
|
||||
if (obj[3] !== undefined) {
|
||||
$ERROR('#15: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#16
|
||||
if (obj[4] !== undefined) {
|
||||
|
@ -118,7 +119,7 @@ if (obj[5] !== undefined) {
|
|||
//CHECK#18
|
||||
if (obj[6] !== undefined) {
|
||||
$ERROR('#18: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#19
|
||||
if (obj[7] !== "NaN") {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
/*---
|
||||
info: Check ToLength(length) for non Array objects
|
||||
esid: sec-array.prototype.reverse
|
||||
es5id: 15.4.4.8_A3_T3
|
||||
description: length = -4294967294
|
||||
---*/
|
||||
|
@ -28,12 +29,12 @@ if (obj.length !== -4294967294) {
|
|||
//CHECK#3
|
||||
if (obj[0] !== "x") {
|
||||
$ERROR('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.reverse(); obj[0] === "x". Actual: ' + (obj[0]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (obj[1] !== "y") {
|
||||
$ERROR('#4: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.reverse(); obj[1] === "y". Actual: ' + (obj[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (obj[2] !== "z") {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
/*---
|
||||
info: "[[Get]], [[Delete]] from not an inherited property"
|
||||
esid: sec-array.prototype.reverse
|
||||
es5id: 15.4.4.8_A4_T1
|
||||
description: >
|
||||
[[Prototype]] of Array instance is Array.prototype, [[Prototype]
|
||||
|
@ -15,25 +16,25 @@ x.length = 2;
|
|||
x.reverse();
|
||||
|
||||
//CHECK#1
|
||||
if (x[0] !== 1) {
|
||||
$ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.reverse(); x[0] === 1. Actual: ' + (x[0]));
|
||||
if (x[0] !== 1) {
|
||||
$ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.reverse(); x[0] === 1. Actual: ' + (x[0]));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x[1] !== 0) {
|
||||
$ERROR('#2: Array.prototype[1] = 1; x = [0]; x.length = 2; x.reverse(); x[1] === 0. Actual: ' + (x[1]));
|
||||
if (x[1] !== 0) {
|
||||
$ERROR('#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) {
|
||||
$ERROR('#3: Array.prototype[1] = 1; x = [0]; x.length = 2; x.reverse(); x.length = 0; x[0] === undefined. Actual: ' + (x[0]));
|
||||
if (x[0] !== undefined) {
|
||||
$ERROR('#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) {
|
||||
$ERROR('#4: Array.prototype[1] = 1; x = [0]; x.length = 2; x.reverse(); x.length = 0; x[1] === 1. Actual: ' + (x[1]));
|
||||
if (x[1] !== 1) {
|
||||
$ERROR('#4: Array.prototype[1] = 1; x = [0]; x.length = 2; x.reverse(); x.length = 0; x[1] === 1. Actual: ' + (x[1]));
|
||||
}
|
||||
|
||||
Object.prototype[1] = 1;
|
||||
|
@ -43,24 +44,24 @@ x = {0:0};
|
|||
x.reverse();
|
||||
|
||||
//CHECK#5
|
||||
if (x[0] !== 1) {
|
||||
$ERROR('#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]));
|
||||
if (x[0] !== 1) {
|
||||
$ERROR('#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) {
|
||||
$ERROR('#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]));
|
||||
if (x[1] !== 0) {
|
||||
$ERROR('#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]));
|
||||
}
|
||||
|
||||
delete x[0];
|
||||
delete x[1];
|
||||
|
||||
//CHECK#7
|
||||
if (x[0] !== undefined) {
|
||||
$ERROR('#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]));
|
||||
if (x[0] !== undefined) {
|
||||
$ERROR('#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) {
|
||||
$ERROR('#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]));
|
||||
if (x[1] !== 1) {
|
||||
$ERROR('#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]));
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
/*---
|
||||
info: "[[Get]], [[Delete]] from not an inherited property"
|
||||
esid: sec-array.prototype.reverse
|
||||
es5id: 15.4.4.8_A4_T2
|
||||
description: >
|
||||
[[Prototype]] of Array instance is Array.prototype, [[Prototype]
|
||||
|
@ -15,25 +16,25 @@ x.length = 2;
|
|||
x.reverse();
|
||||
|
||||
//CHECK#1
|
||||
if (x[0] !== 1) {
|
||||
$ERROR('#1: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.reverse(); x[0] === 1. Actual: ' + (x[0]));
|
||||
if (x[0] !== 1) {
|
||||
$ERROR('#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) {
|
||||
$ERROR('#2: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.reverse(); x[1] === 0. Actual: ' + (x[1]));
|
||||
if (x[1] !== 0) {
|
||||
$ERROR('#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) {
|
||||
$ERROR('#3: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.reverse(); x.length = 0; x[0] === undefined. Actual: ' + (x[0]));
|
||||
if (x[0] !== undefined) {
|
||||
$ERROR('#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) {
|
||||
$ERROR('#4: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.reverse(); x.length = 0; x[1] === -1. Actual: ' + (x[1]));
|
||||
if (x[1] !== -1) {
|
||||
$ERROR('#4: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.reverse(); x.length = 0; x[1] === -1. Actual: ' + (x[1]));
|
||||
}
|
||||
|
||||
Object.prototype[1] = -1;
|
||||
|
@ -43,24 +44,24 @@ x = {0:0,1:1};
|
|||
x.reverse();
|
||||
|
||||
//CHECK#5
|
||||
if (x[0] !== 1) {
|
||||
$ERROR('#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]));
|
||||
if (x[0] !== 1) {
|
||||
$ERROR('#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) {
|
||||
$ERROR('#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]));
|
||||
if (x[1] !== 0) {
|
||||
$ERROR('#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]));
|
||||
}
|
||||
|
||||
delete x[0];
|
||||
delete x[1];
|
||||
|
||||
//CHECK#7
|
||||
if (x[0] !== undefined) {
|
||||
$ERROR('#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]));
|
||||
if (x[0] !== undefined) {
|
||||
$ERROR('#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) {
|
||||
$ERROR('#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]));
|
||||
if (x[1] !== -1) {
|
||||
$ERROR('#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]));
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
/*---
|
||||
info: The reverse property of Array can't be used as constructor
|
||||
esid: sec-array.prototype.reverse
|
||||
es5id: 15.4.4.8_A5.7
|
||||
description: >
|
||||
If property does not implement the internal [[Construct]] method,
|
||||
|
|
|
@ -18,6 +18,7 @@ info: >
|
|||
i. If upperExists is true, then
|
||||
i. Let upperValue be Get(O, upperP).
|
||||
ii. ReturnIfAbrupt(upperValue).
|
||||
esid: sec-array.prototype.reverse
|
||||
es6id: 22.1.3.20
|
||||
---*/
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-array.prototype.reverse
|
||||
es6id: 22.1.3.20
|
||||
description: >
|
||||
Array.prototype.reverse.name is "reverse".
|
||||
|
|
Loading…
Reference in New Issue