mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
add esid to array/prototype/splice tests
This commit is contained in:
parent
e07385fff4
commit
20b8c9b896
test/built-ins/Array/prototype/splice
15.4.4.12-9-a-1.js15.4.4.12-9-c-ii-1.jsS15.4.4.12_A1.1_T1.jsS15.4.4.12_A1.1_T2.jsS15.4.4.12_A1.1_T3.jsS15.4.4.12_A1.1_T4.jsS15.4.4.12_A1.1_T5.jsS15.4.4.12_A1.1_T6.jsS15.4.4.12_A1.2_T1.jsS15.4.4.12_A1.2_T2.jsS15.4.4.12_A1.2_T3.jsS15.4.4.12_A1.2_T4.jsS15.4.4.12_A1.2_T5.jsS15.4.4.12_A1.3_T1.jsS15.4.4.12_A1.3_T2.jsS15.4.4.12_A1.3_T3.jsS15.4.4.12_A1.3_T4.jsS15.4.4.12_A1.3_T5.jsS15.4.4.12_A1.4_T1.jsS15.4.4.12_A1.4_T2.jsS15.4.4.12_A1.4_T3.jsS15.4.4.12_A1.4_T4.jsS15.4.4.12_A1.4_T5.jsS15.4.4.12_A1.4_T6.jsS15.4.4.12_A1.5_T1.jsS15.4.4.12_A1.5_T2.jsS15.4.4.12_A2.1_T1.jsS15.4.4.12_A2.1_T2.jsS15.4.4.12_A2.1_T3.jsS15.4.4.12_A2.1_T4.jsS15.4.4.12_A2.1_T5.jsS15.4.4.12_A2.2_T1.jsS15.4.4.12_A2.2_T2.jsS15.4.4.12_A2.2_T3.jsS15.4.4.12_A2.2_T4.jsS15.4.4.12_A2.2_T5.jsS15.4.4.12_A2_T1.jsS15.4.4.12_A2_T2.jsS15.4.4.12_A2_T3.jsS15.4.4.12_A2_T4.jsS15.4.4.12_A3_T1.jsS15.4.4.12_A3_T3.jsS15.4.4.12_A4_T1.jsS15.4.4.12_A4_T2.jsS15.4.4.12_A4_T3.jsS15.4.4.12_A5.7.jsS15.4.4.12_A6.1_T1.jsS15.4.4.12_A6.1_T2.jsS15.4.4.12_A6.1_T3.jscalled_with_one_argument.jsname.jsset_length_no_args.js
@ -2,6 +2,7 @@
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12-9-a-1
|
||||
description: >
|
||||
Array.prototype.splice - 'from' is the result of
|
||||
|
@ -2,6 +2,7 @@
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12-9-c-ii-1
|
||||
description: >
|
||||
Array.prototype.splice will splice an array even when
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is positive, use min(start, length).
|
||||
If deleteCount is positive, use min(deleteCount, length - start)
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.1_T1
|
||||
description: length > deleteCount > start = 0, itemCount = 0
|
||||
---*/
|
||||
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 3) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(0,3); arr.length === 3. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== 0) {
|
||||
@ -31,17 +32,17 @@ if (arr[0] !== 0) {
|
||||
//CHECK#4
|
||||
if (arr[1] !== 1) {
|
||||
$ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(0,3); arr[1] === 1. Actual: ' + (arr[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[2] !== 2) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(0,3); arr[2] === 2. Actual: ' + (arr[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x.length !== 1) {
|
||||
$ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(0,3); x.length === 1. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (x[0] !== 3) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is positive, use min(start, length).
|
||||
If deleteCount is positive, use min(deleteCount, length - start)
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.1_T2
|
||||
description: length > deleteCount > start = 0, itemCount > 0
|
||||
---*/
|
||||
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 3) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(0,3,4,5); arr.length === 3. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== 0) {
|
||||
@ -31,17 +32,17 @@ if (arr[0] !== 0) {
|
||||
//CHECK#4
|
||||
if (arr[1] !== 1) {
|
||||
$ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(0,3,4,5); arr[1] === 1. Actual: ' + (arr[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[2] !== 2) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(0,3,4,5); arr[2] === 2. Actual: ' + (arr[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x.length !== 3) {
|
||||
$ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(0,3,4,5); x.length === 3. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (x[0] !== 4) {
|
||||
@ -51,7 +52,7 @@ if (x[0] !== 4) {
|
||||
//CHECK#8
|
||||
if (x[1] !== 5) {
|
||||
$ERROR('#8: var x = [0,1,2,3]; var arr = x.splice(0,3,4,5); x[1] === 5. Actual: ' + (x[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if (x[2] !== 3) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is positive, use min(start, length).
|
||||
If deleteCount is positive, use min(deleteCount, length - start)
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.1_T3
|
||||
description: length = deleteCount > start = 0
|
||||
---*/
|
||||
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 4) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(0,4); arr.length === 4. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== 0) {
|
||||
@ -31,17 +32,17 @@ if (arr[0] !== 0) {
|
||||
//CHECK#4
|
||||
if (arr[1] !== 1) {
|
||||
$ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(0,4); arr[1] === 1. Actual: ' + (arr[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[2] !== 2) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(0,4); arr[2] === 2. Actual: ' + (arr[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (arr[3] !== 3) {
|
||||
$ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(0,4); arr[3] === 3. Actual: ' + (arr[3]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (x.length !== 0) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is positive, use min(start, length).
|
||||
If deleteCount is positive, use min(deleteCount, length - start)
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.1_T4
|
||||
description: length > deleteCount > start > 0, itemCount > 0
|
||||
---*/
|
||||
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 3) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(1,3,4,5); arr.length === 3. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== 1) {
|
||||
@ -31,17 +32,17 @@ if (arr[0] !== 1) {
|
||||
//CHECK#4
|
||||
if (arr[1] !== 2) {
|
||||
$ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(1,3,4,5); arr[1] === 2. Actual: ' + (arr[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[2] !== 3) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(1,3,4,5); arr[2] === 3. Actual: ' + (arr[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x.length !== 3) {
|
||||
$ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(1,3,4,5); x.length === 3. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (x[0] !== 0) {
|
||||
@ -51,7 +52,7 @@ if (x[0] !== 0) {
|
||||
//CHECK#8
|
||||
if (x[1] !== 4) {
|
||||
$ERROR('#8: var x = [0,1,2,3]; var arr = x.splice(1,3,4,5); x[1] === 4. Actual: ' + (x[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if (x[2] !== 5) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is positive, use min(start, length).
|
||||
If deleteCount is positive, use min(deleteCount, length - start)
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.1_T5
|
||||
description: deleteCount > length > start = 0, itemCount = 0
|
||||
---*/
|
||||
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 4) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(0,5); arr.length === 4. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== 0) {
|
||||
@ -31,17 +32,17 @@ if (arr[0] !== 0) {
|
||||
//CHECK#4
|
||||
if (arr[1] !== 1) {
|
||||
$ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(0,5); arr[1] === 1. Actual: ' + (arr[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[2] !== 2) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(0,5); arr[2] === 2. Actual: ' + (arr[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (arr[3] !== 3) {
|
||||
$ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(0,5); arr[3] === 3. Actual: ' + (arr[3]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (x.length !== 0) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is positive, use min(start, length).
|
||||
If deleteCount is positive, use min(deleteCount, length - start)
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.1_T6
|
||||
description: length = deleteCount > start > 0, itemCount > 0
|
||||
---*/
|
||||
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 3) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(1,4,4,5); arr.length === 3. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== 1) {
|
||||
@ -31,17 +32,17 @@ if (arr[0] !== 1) {
|
||||
//CHECK#4
|
||||
if (arr[1] !== 2) {
|
||||
$ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(1,4,4,5); arr[1] === 2. Actual: ' + (arr[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[2] !== 3) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(1,4,4,5); arr[2] === 3. Actual: ' + (arr[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x.length !== 3) {
|
||||
$ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(1,4,4,5); x.length === 3. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (x[0] !== 0) {
|
||||
@ -51,7 +52,7 @@ if (x[0] !== 0) {
|
||||
//CHECK#8
|
||||
if (x[1] !== 4) {
|
||||
$ERROR('#8: var x = [0,1,2,3]; var arr = x.splice(1,4,4,5); x[1] === 4. Actual: ' + (x[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if (x[2] !== 5) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is negative, use max(start + length, 0).
|
||||
If deleteCount is negative, use 0
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.2_T1
|
||||
description: -length = start < deleteCount < 0, itemCount = 0
|
||||
---*/
|
||||
@ -21,12 +22,12 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#1
|
||||
if (arr.length !== 0) {
|
||||
$ERROR('#1: var x = [0,1]; var arr = x.splice(-2,-1); arr.length === 0. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x.length !== 2) {
|
||||
$ERROR('#2: var x = [0,1]; var arr = x.splice(-2,-1); x.length === 2. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (x[0] !== 0) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is negative, use max(start + length, 0).
|
||||
If deleteCount is negative, use 0
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.2_T2
|
||||
description: -length < start = deleteCount < 0, itemCount = 0
|
||||
---*/
|
||||
@ -21,12 +22,12 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#1
|
||||
if (arr.length !== 0) {
|
||||
$ERROR('#1: var x = [0,1]; var arr = x.splice(-1,-1); arr.length === 0. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x.length !== 2) {
|
||||
$ERROR('#2: var x = [0,1]; var arr = x.splice(-1,-1); x.length === 2. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (x[0] !== 0) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is negative, use max(start + length, 0).
|
||||
If deleteCount is negative, use 0
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.2_T3
|
||||
description: -length = start < deleteCount < 0, itemCount > 0
|
||||
---*/
|
||||
@ -21,12 +22,12 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#1
|
||||
if (arr.length !== 0) {
|
||||
$ERROR('#1: var x = [0,1]; var arr = x.splice(-2,-1,2,3); arr.length === 0. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x.length !== 4) {
|
||||
$ERROR('#2: var x = [0,1]; var arr = x.splice(-2,-1,2,3); x.length === 4. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (x[0] !== 2) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is negative, use max(start + length, 0).
|
||||
If deleteCount is negative, use 0
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.2_T4
|
||||
description: -length < start = deleteCount < 0, itemCount > 0
|
||||
---*/
|
||||
@ -21,12 +22,12 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#1
|
||||
if (arr.length !== 0) {
|
||||
$ERROR('#1: var x = [0,1]; var arr = x.splice(-1,-1,2,3); arr.length === 0. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x.length !== 4) {
|
||||
$ERROR('#2: var x = [0,1]; var arr = x.splice(-1,-1,2,3); x.length === 4. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (x[0] !== 0) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is negative, use max(start + length, 0).
|
||||
If deleteCount is negative, use 0
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.2_T5
|
||||
description: start < -length < deleteCount < 0, itemCount > 0
|
||||
---*/
|
||||
@ -21,12 +22,12 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#1
|
||||
if (arr.length !== 0) {
|
||||
$ERROR('#1: var x = [0,1]; var arr = x.splice(-3,-1,2,3); arr.length === 0. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x.length !== 4) {
|
||||
$ERROR('#2: var x = [0,1]; var arr = x.splice(-3,-1,2,3); x.length === 4. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (x[0] !== 2) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is positive, use min(start, length).
|
||||
If deleteCount is negative, use 0
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.3_T1
|
||||
description: -length < deleteCount < start = 0, itemCount = 0
|
||||
---*/
|
||||
@ -21,12 +22,12 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#1
|
||||
if (arr.length !== 0) {
|
||||
$ERROR('#1: var x = [0,1]; var arr = x.splice(0,-1); arr.length === 0. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x.length !== 2) {
|
||||
$ERROR('#2: var x = [0,1]; var arr = x.splice(0,-1); x.length === 2. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (x[0] !== 0) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is positive, use min(start, length).
|
||||
If deleteCount is negative, use 0
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.3_T2
|
||||
description: -length = -start < deleteCount < 0, itemCount = 0
|
||||
---*/
|
||||
@ -21,12 +22,12 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#1
|
||||
if (arr.length !== 0) {
|
||||
$ERROR('#1: var x = [0,1]; var arr = x.splice(2,-1); arr.length === 0. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x.length !== 2) {
|
||||
$ERROR('#2: var x = [0,1]; var arr = x.splice(2,-1); x.length === 2. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (x[0] !== 0) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is positive, use min(start, length).
|
||||
If deleteCount is negative, use 0
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.3_T3
|
||||
description: -length < deleteCount < start = 0, itemCount > 0
|
||||
---*/
|
||||
@ -21,12 +22,12 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#1
|
||||
if (arr.length !== 0) {
|
||||
$ERROR('#1: var x = [0,1]; var arr = x.splice(0,-1,2,3); arr.length === 0. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x.length !== 4) {
|
||||
$ERROR('#2: var x = [0,1]; var arr = x.splice(0,-1,2,3); x.length === 4. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (x[0] !== 2) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is positive, use min(start, length).
|
||||
If deleteCount is negative, use 0
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.3_T4
|
||||
description: -length = -start < deleteCount < 0, itemCount > 0
|
||||
---*/
|
||||
@ -21,12 +22,12 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#1
|
||||
if (arr.length !== 0) {
|
||||
$ERROR('#1: var x = [0,1]; var arr = x.splice(2,-1,2,3); arr.length === 0. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x.length !== 4) {
|
||||
$ERROR('#2: var x = [0,1]; var arr = x.splice(2,-1,2,3); x.length === 4. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (x[0] !== 0) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is positive, use min(start, length).
|
||||
If deleteCount is negative, use 0
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.3_T5
|
||||
description: -start < -length < deleteCount < 0, itemCount > 0
|
||||
---*/
|
||||
@ -21,12 +22,12 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#1
|
||||
if (arr.length !== 0) {
|
||||
$ERROR('#1: var x = [0,1]; var arr = x.splice(3,-1,2,3); arr.length === 0. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x.length !== 4) {
|
||||
$ERROR('#2: var x = [0,1]; var arr = x.splice(3,-1,2,3); x.length === 4. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (x[0] !== 0) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is negative, use max(start + length, 0).
|
||||
If deleteCount is positive, use min(deleteCount, length - start)
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.4_T1
|
||||
description: length = -start > deleteCount > 0, itemCount = 0
|
||||
---*/
|
||||
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 3) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(-4,3); arr.length === 3. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== 0) {
|
||||
@ -31,17 +32,17 @@ if (arr[0] !== 0) {
|
||||
//CHECK#4
|
||||
if (arr[1] !== 1) {
|
||||
$ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(-4,3); arr[1] === 1. Actual: ' + (arr[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[2] !== 2) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(-4,3); arr[2] === 2. Actual: ' + (arr[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x.length !== 1) {
|
||||
$ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(-4,3); x.length === 1. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (x[0] !== 3) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is negative, use max(start + length, 0).
|
||||
If deleteCount is positive, use min(deleteCount, length - start)
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.4_T2
|
||||
description: length = -start > deleteCount > 0, itemCount > 0
|
||||
---*/
|
||||
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 3) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(-4,3,4,5); arr.length === 3. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== 0) {
|
||||
@ -31,17 +32,17 @@ if (arr[0] !== 0) {
|
||||
//CHECK#4
|
||||
if (arr[1] !== 1) {
|
||||
$ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(-4,3,4,5); arr[1] === 1. Actual: ' + (arr[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[2] !== 2) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(-4,3,4,5); arr[2] === 2. Actual: ' + (arr[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x.length !== 3) {
|
||||
$ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(-4,3,4,5); x.length === 3. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (x[0] !== 4) {
|
||||
@ -51,7 +52,7 @@ if (x[0] !== 4) {
|
||||
//CHECK#8
|
||||
if (x[1] !== 5) {
|
||||
$ERROR('#8: var x = [0,1,2,3]; var arr = x.splice(-4,3,4,5); x[1] === 5. Actual: ' + (x[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if (x[2] !== 3) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is negative, use max(start + length, 0).
|
||||
If deleteCount is positive, use min(deleteCount, length - start)
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.4_T3
|
||||
description: -start > length = deleteCount > 0, itemCount = 0
|
||||
---*/
|
||||
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 4) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(-5,4); arr.length === 4. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== 0) {
|
||||
@ -31,17 +32,17 @@ if (arr[0] !== 0) {
|
||||
//CHECK#4
|
||||
if (arr[1] !== 1) {
|
||||
$ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(-5,4); arr[1] === 1. Actual: ' + (arr[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[2] !== 2) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(-5,4); arr[2] === 2. Actual: ' + (arr[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (arr[3] !== 3) {
|
||||
$ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(-5,4); arr[3] === 3. Actual: ' + (arr[3]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (x.length !== 0) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is negative, use max(start + length, 0).
|
||||
If deleteCount is positive, use min(deleteCount, length - start)
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.4_T4
|
||||
description: length > -start = deleteCount > 0, itemCount > 0
|
||||
---*/
|
||||
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 3) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(-3,3,4,5); arr.length === 3. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== 1) {
|
||||
@ -31,17 +32,17 @@ if (arr[0] !== 1) {
|
||||
//CHECK#4
|
||||
if (arr[1] !== 2) {
|
||||
$ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(-3,3,4,5); arr[1] === 2. Actual: ' + (arr[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[2] !== 3) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(-3,3,4,5); arr[2] === 3. Actual: ' + (arr[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x.length !== 3) {
|
||||
$ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(-3,3,4,5); x.length === 3. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (x[0] !== 0) {
|
||||
@ -51,7 +52,7 @@ if (x[0] !== 0) {
|
||||
//CHECK#8
|
||||
if (x[1] !== 4) {
|
||||
$ERROR('#8: var x = [0,1,2,3]; var arr = x.splice(-3,3,4,5); x[1] === 4. Actual: ' + (x[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if (x[2] !== 5) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is negative, use max(start + length, 0).
|
||||
If deleteCount is positive, use min(deleteCount, length - start)
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.4_T5
|
||||
description: -start > deleteCount > length > 0, itemCount = 0
|
||||
---*/
|
||||
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 4) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(-9,5); arr.length === 4. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== 0) {
|
||||
@ -31,17 +32,17 @@ if (arr[0] !== 0) {
|
||||
//CHECK#4
|
||||
if (arr[1] !== 1) {
|
||||
$ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(-9,5); arr[1] === 1. Actual: ' + (arr[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[2] !== 2) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(-9,5); arr[2] === 2. Actual: ' + (arr[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (arr[3] !== 3) {
|
||||
$ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(-9,5); arr[3] === 3. Actual: ' + (arr[3]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (x.length !== 0) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
If start is negative, use max(start + length, 0).
|
||||
If deleteCount is positive, use min(deleteCount, length - start)
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.4_T6
|
||||
description: length = deleteCount > -start > 0, itemCount > 0
|
||||
---*/
|
||||
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 3) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(-3,4,4,5); arr.length === 3. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== 1) {
|
||||
@ -31,17 +32,17 @@ if (arr[0] !== 1) {
|
||||
//CHECK#4
|
||||
if (arr[1] !== 2) {
|
||||
$ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(-3,4,4,5); arr[1] === 2. Actual: ' + (arr[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[2] !== 3) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(-3,4,4,5); arr[2] === 3. Actual: ' + (arr[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x.length !== 3) {
|
||||
$ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(-3,4,4,5); x.length === 3. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (x[0] !== 0) {
|
||||
@ -51,7 +52,7 @@ if (x[0] !== 0) {
|
||||
//CHECK#8
|
||||
if (x[1] !== 4) {
|
||||
$ERROR('#8: var x = [0,1,2,3]; var arr = x.splice(-3,4,4,5); x[1] === 4. Actual: ' + (x[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if (x[2] !== 5) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*---
|
||||
info: Splice with undefined arguments
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.5_T1
|
||||
description: start === undefined, end === undefined
|
||||
---*/
|
||||
@ -19,12 +20,12 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 0) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(undefined, undefined); arr.length === 0. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (x.length !== 4) {
|
||||
$ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(undefined, undefined); x.length === 4. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (x[0] !== 0) {
|
||||
@ -34,7 +35,7 @@ if (x[0] !== 0) {
|
||||
//CHECK#5
|
||||
if (x[1] !== 1) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(undefined, undefined); x[1] === 1. Actual: ' + (x[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x[2] !== 2) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*---
|
||||
info: Splice with undefined arguments
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A1.5_T2
|
||||
description: end === undefined
|
||||
---*/
|
||||
@ -19,12 +20,12 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 0) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(1,undefined); arr.length === 0. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (x.length !== 4) {
|
||||
$ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(1,undefined); x.length === 4. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (x[0] !== 0) {
|
||||
@ -34,7 +35,7 @@ if (x[0] !== 0) {
|
||||
//CHECK#5
|
||||
if (x[1] !== 1) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(1,undefined); x[1] === 1. Actual: ' + (x[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x[2] !== 2) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*---
|
||||
info: Operator use ToInteger from start
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A2.1_T1
|
||||
description: start is not integer
|
||||
---*/
|
||||
@ -19,7 +20,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 3) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(1.5,3); arr.length === 3. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== 1) {
|
||||
@ -29,17 +30,17 @@ if (arr[0] !== 1) {
|
||||
//CHECK#4
|
||||
if (arr[1] !== 2) {
|
||||
$ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(1.5,3); arr[1] === 2. Actual: ' + (arr[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[2] !== 3) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(1.5,3); arr[2] === 3. Actual: ' + (arr[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x.length !== 1) {
|
||||
$ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(1.5,3); x.length === 1. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (x[0] !== 0) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*---
|
||||
info: Operator use ToInteger from start
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A2.1_T2
|
||||
description: start = NaN
|
||||
---*/
|
||||
@ -19,7 +20,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 3) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(NaN,3); arr.length === 3. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== 0) {
|
||||
@ -29,17 +30,17 @@ if (arr[0] !== 0) {
|
||||
//CHECK#4
|
||||
if (arr[1] !== 1) {
|
||||
$ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(NaN,3); arr[1] === 1. Actual: ' + (arr[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[2] !== 2) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(NaN,3); arr[2] === 2. Actual: ' + (arr[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x.length !== 1) {
|
||||
$ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(NaN,3); x.length === 1. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (x[0] !== 3) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*---
|
||||
info: Operator use ToInteger from start
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A2.1_T3
|
||||
description: start = Infinity
|
||||
---*/
|
||||
@ -19,7 +20,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 0) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(Number.POSITIVE_INFINITY,3); arr.length === 0. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (x[0] !== 0) {
|
||||
@ -29,12 +30,12 @@ if (x[0] !== 0) {
|
||||
//CHECK#4
|
||||
if (x[1] !== 1) {
|
||||
$ERROR('#4: var x = [0,1,2,3]; var x = x.splice(Number.POSITIVE_INFINITY,3); x[1] === 1. Actual: ' + (x[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (x[2] !== 2) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var x = x.splice(Number.POSITIVE_INFINITY,3); x[2] === 2. Actual: ' + (x[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x[3] !== 3) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*---
|
||||
info: Operator use ToInteger from start
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A2.1_T4
|
||||
description: start = -Infinity
|
||||
---*/
|
||||
@ -19,7 +20,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 3) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(Number.NEGATIVE_INFINITY,3); arr.length === 3. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== 0) {
|
||||
@ -29,17 +30,17 @@ if (arr[0] !== 0) {
|
||||
//CHECK#4
|
||||
if (arr[1] !== 1) {
|
||||
$ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(Number.NEGATIVE_INFINITY,3); arr[1] === 1. Actual: ' + (arr[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[2] !== 2) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(Number.NEGATIVE_INFINITY,3); arr[2] === 2. Actual: ' + (arr[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x.length !== 1) {
|
||||
$ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(Number.NEGATIVE_INFINITY,3); x.length === 1. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (x[0] !== 3) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*---
|
||||
info: Operator use ToInteger from start
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A2.1_T5
|
||||
description: ToInteger use ToNumber
|
||||
---*/
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*---
|
||||
info: Operator use ToInteger from deleteCount
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A2.2_T1
|
||||
description: deleteCount is not integer
|
||||
---*/
|
||||
@ -19,7 +20,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 3) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(1,3.5); arr.length === 3. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== 1) {
|
||||
@ -29,17 +30,17 @@ if (arr[0] !== 1) {
|
||||
//CHECK#4
|
||||
if (arr[1] !== 2) {
|
||||
$ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(1,3.5); arr[1] === 2. Actual: ' + (arr[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[2] !== 3) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(1,3.5); arr[2] === 3. Actual: ' + (arr[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x.length !== 1) {
|
||||
$ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(1,3.5); x.length === 1. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (x[0] !== 0) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*---
|
||||
info: Operator use ToInteger from deleteCount
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A2.2_T2
|
||||
description: deleteCount = NaN
|
||||
---*/
|
||||
@ -19,12 +20,12 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#1
|
||||
if (arr.length !== 0) {
|
||||
$ERROR('#1: var x = [0,1]; var arr = x.splice(0,NaN); arr.length === 0. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x.length !== 2) {
|
||||
$ERROR('#2: var x = [0,1]; var arr = x.splice(0,NaN); x.length === 2. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (x[0] !== 0) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*---
|
||||
info: Operator use ToInteger from deleteCount
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A2.2_T3
|
||||
description: deleteCount = Infinity
|
||||
---*/
|
||||
@ -19,7 +20,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 4) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(0,Number.POSITIVE_INFINITY); arr.length === 4. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== 0) {
|
||||
@ -29,17 +30,17 @@ if (arr[0] !== 0) {
|
||||
//CHECK#4
|
||||
if (arr[1] !== 1) {
|
||||
$ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(0,Number.POSITIVE_INFINITY); arr[1] === 1. Actual: ' + (arr[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[2] !== 2) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(0,Number.POSITIVE_INFINITY); arr[2] === 2. Actual: ' + (arr[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (arr[3] !== 3) {
|
||||
$ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(0,Number.POSITIVE_INFINITY); arr[3] === 3. Actual: ' + (arr[3]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (x.length !== 0) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*---
|
||||
info: Operator use ToInteger from deleteCount
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A2.2_T4
|
||||
description: deleteCount = -Infinity
|
||||
---*/
|
||||
@ -19,12 +20,12 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#1
|
||||
if (arr.length !== 0) {
|
||||
$ERROR('#1: var x = [0,1]; var arr = x.splice(0,Number.NEGATIVE_INFINITY); arr.length === 0. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (x.length !== 2) {
|
||||
$ERROR('#2: var x = [0,1]; var arr = x.splice(0,Number.NEGATIVE_INFINITY); x.length === 2. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (x[0] !== 0) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*---
|
||||
info: Operator use ToInteger from deleteCount
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A2.2_T5
|
||||
description: ToInteger use ToNumber
|
||||
---*/
|
||||
@ -19,7 +20,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 3) {
|
||||
$ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); arr.length === 3. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== 0) {
|
||||
@ -29,17 +30,17 @@ if (arr[0] !== 0) {
|
||||
//CHECK#4
|
||||
if (arr[1] !== 1) {
|
||||
$ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); arr[1] === 1. Actual: ' + (arr[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[2] !== 2) {
|
||||
$ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); arr[2] === 2. Actual: ' + (arr[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x.length !== 1) {
|
||||
$ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); x.length === 1. Actual: ' + (x.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (x[0] !== 3) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
The splice function is intentionally generic.
|
||||
It does not require that its this value be an Array object
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A2_T1
|
||||
description: >
|
||||
If start is positive, use min(start, length). If deleteCount is
|
||||
@ -25,7 +26,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 3) {
|
||||
$ERROR('#2: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(0,3,4,5); arr.length === 3. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== 0) {
|
||||
@ -35,17 +36,17 @@ if (arr[0] !== 0) {
|
||||
//CHECK#4
|
||||
if (arr[1] !== 1) {
|
||||
$ERROR('#4: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(0,3,4,5); arr[1] === 1. Actual: ' + (arr[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[2] !== 2) {
|
||||
$ERROR('#5: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(0,3,4,5); arr[2] === 2. Actual: ' + (arr[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (obj.length !== 3) {
|
||||
$ERROR('#6: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(0,3,4,5); obj.length === 3. Actual: ' + (obj.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (obj[0] !== 4) {
|
||||
@ -55,7 +56,7 @@ if (obj[0] !== 4) {
|
||||
//CHECK#8
|
||||
if (obj[1] !== 5) {
|
||||
$ERROR('#8: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(0,3,4,5); obj[1] === 5. Actual: ' + (obj[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if (obj[2] !== 3) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
The splice function is intentionally generic.
|
||||
It does not require that its this value be an Array object
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A2_T2
|
||||
description: >
|
||||
If start is negative, use max(start + length, 0). If deleteCount
|
||||
@ -25,12 +26,12 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#1
|
||||
if (arr.length !== 0) {
|
||||
$ERROR('#1: var obj = {0:0,1:1}; obj.length = 2; obj.splice = Array.prototype.splice; var arr = obj.splice(-2,-1,2,3); arr.length === 0. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (obj.length !== 4) {
|
||||
$ERROR('#2: var obj = {0:0,1:1}; obj.length = 2; obj.splice = Array.prototype.splice; var arr = obj.splice(-2,-1,2,3); obj.length === 4. Actual: ' + (obj.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (obj[0] !== 2) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
The splice function is intentionally generic.
|
||||
It does not require that its this value be an Array object
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A2_T3
|
||||
description: >
|
||||
If start is positive, use min(start, length). If deleteCount is
|
||||
@ -25,12 +26,12 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#1
|
||||
if (arr.length !== 0) {
|
||||
$ERROR('#1: var obj = {0:0,1:1}; obj.length = 2; obj.splice = Array.prototype.splice; var arr = obj.splice(0,-1,2,3); arr.length === 0. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (obj.length !== 4) {
|
||||
$ERROR('#2: var obj = {0:0,1:1}; obj.length = 2; obj.splice = Array.prototype.splice; var arr = obj.splice(0,-1,2,3); obj.length === 4. Actual: ' + (obj.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (obj[0] !== 2) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
info: >
|
||||
The splice function is intentionally generic.
|
||||
It does not require that its this value be an Array object
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A2_T4
|
||||
description: >
|
||||
If start is negative, use max(start + length, 0). If deleteCount
|
||||
@ -25,7 +26,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
|
||||
//CHECK#2
|
||||
if (arr.length !== 3) {
|
||||
$ERROR('#2: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(-4,3,4,5); arr.length === 3. Actual: ' + (arr.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== 0) {
|
||||
@ -35,17 +36,17 @@ if (arr[0] !== 0) {
|
||||
//CHECK#4
|
||||
if (arr[1] !== 1) {
|
||||
$ERROR('#4: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(-4,3,4,5); arr[1] === 1. Actual: ' + (arr[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[2] !== 2) {
|
||||
$ERROR('#5: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(-4,3,4,5); arr[2] === 2. Actual: ' + (arr[2]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (obj.length !== 3) {
|
||||
$ERROR('#6: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(-4,3,4,5); obj.length === 3. Actual: ' + (obj.length));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (obj[0] !== 4) {
|
||||
@ -55,7 +56,7 @@ if (obj[0] !== 4) {
|
||||
//CHECK#8
|
||||
if (obj[1] !== 5) {
|
||||
$ERROR('#8: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(-4,3,4,5); obj[1] === 5. Actual: ' + (obj[1]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if (obj[2] !== 3) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*---
|
||||
info: Check ToLength(length) for non Array objects
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A3_T1
|
||||
description: length is arbitrarily
|
||||
---*/
|
||||
@ -27,12 +28,12 @@ if (obj.length !== 4294967295) {
|
||||
//CHECK#3
|
||||
if (obj[0] !== "x") {
|
||||
$ERROR('#3: var obj = {}; obj.splice = Array.prototype.splice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.splice(4294967295,1); obj[0] === "x". Actual: ' + (obj[0]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (obj[4294967295] !== undefined) {
|
||||
$ERROR('#4: var obj = {}; obj.splice = Array.prototype.splice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.splice(4294967295,1); obj[4294967295] === undefined. Actual: ' + (obj[4294967295]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (arr[0] !== "y") {
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*---
|
||||
info: Check ToLength(length) for non Array objects
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A3_T3
|
||||
description: length is arbitrarily
|
||||
---*/
|
||||
@ -21,7 +22,7 @@ if (arr.length !== 0) {
|
||||
//CHECK#2
|
||||
if (arr[0] !== undefined) {
|
||||
$ERROR('#2: var obj = {}; obj.splice = Array.prototype.splice; obj[4294967294] = "x"; obj.length = 1; var arr = obj.splice(4294967294,1); arr[0] === undefined. Actual: ' + (arr[0]));
|
||||
}
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (obj.length !== 0) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*---
|
||||
info: "[[Get]] from not an inherited property"
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A4_T1
|
||||
description: >
|
||||
[[Prototype]] of Array instance is Array.prototype, [[Prototype]
|
||||
@ -14,33 +15,33 @@ var x = [0,1];
|
||||
var arr = x.splice(1,1);
|
||||
|
||||
//CHECK#1
|
||||
if (arr.length !== 1) {
|
||||
$ERROR('#1: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1); arr.length === 1. Actual: ' + (arr.length));
|
||||
if (arr.length !== 1) {
|
||||
$ERROR('#1: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1); arr.length === 1. Actual: ' + (arr.length));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (arr[0] !== 1) {
|
||||
$ERROR('#2: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1); arr[0] === 1. Actual: ' + (arr[0]));
|
||||
if (arr[0] !== 1) {
|
||||
$ERROR('#2: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1); arr[0] === 1. Actual: ' + (arr[0]));
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[1] !== -1) {
|
||||
$ERROR('#3: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1); arr[1] === -1. Actual: ' + (arr[1]));
|
||||
if (arr[1] !== -1) {
|
||||
$ERROR('#3: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1); arr[1] === -1. Actual: ' + (arr[1]));
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (x.length !== 1) {
|
||||
$ERROR('#4: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1); x.length === 1. Actual: ' + (x.length));
|
||||
if (x.length !== 1) {
|
||||
$ERROR('#4: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1); x.length === 1. Actual: ' + (x.length));
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (x[0] !== 0) {
|
||||
$ERROR('#5: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1); x[0] === 0. Actual: ' + (x[0]));
|
||||
if (x[0] !== 0) {
|
||||
$ERROR('#5: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1); x[0] === 0. Actual: ' + (x[0]));
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x[1] !== -1) {
|
||||
$ERROR('#6: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1); x[1] === -1. Actual: ' + (x[1]));
|
||||
if (x[1] !== -1) {
|
||||
$ERROR('#6: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1); x[1] === -1. Actual: ' + (x[1]));
|
||||
}
|
||||
|
||||
|
||||
@ -51,31 +52,31 @@ x = {0:0, 1:1};
|
||||
var arr = x.splice(1,1);
|
||||
|
||||
//CHECK#7
|
||||
if (arr.length !== 1) {
|
||||
$ERROR('#7: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1); arr.length === 1. Actual: ' + (arr.length));
|
||||
if (arr.length !== 1) {
|
||||
$ERROR('#7: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1); arr.length === 1. Actual: ' + (arr.length));
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if (arr[0] !== 1) {
|
||||
$ERROR('#8: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1); arr[0] === 1. Actual: ' + (arr[0]));
|
||||
if (arr[0] !== 1) {
|
||||
$ERROR('#8: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1); arr[0] === 1. Actual: ' + (arr[0]));
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if (arr[1] !== -1) {
|
||||
$ERROR('#9: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1); arr[1] === -1. Actual: ' + (arr[1]));
|
||||
if (arr[1] !== -1) {
|
||||
$ERROR('#9: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1); arr[1] === -1. Actual: ' + (arr[1]));
|
||||
}
|
||||
|
||||
//CHECK#10
|
||||
if (x.length !== 1) {
|
||||
$ERROR('#10: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1); x.length === 1. Actual: ' + (x.length));
|
||||
if (x.length !== 1) {
|
||||
$ERROR('#10: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1); x.length === 1. Actual: ' + (x.length));
|
||||
}
|
||||
|
||||
//CHECK#11
|
||||
if (x[0] !== 0) {
|
||||
$ERROR('#11: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1); x[0] === 0. Actual: ' + (x[0]));
|
||||
if (x[0] !== 0) {
|
||||
$ERROR('#11: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1); x[0] === 0. Actual: ' + (x[0]));
|
||||
}
|
||||
|
||||
//CHECK#12
|
||||
if (x[1] !== -1) {
|
||||
$ERROR('#12: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1); x[1] === -1. Actual: ' + (x[1]));
|
||||
if (x[1] !== -1) {
|
||||
$ERROR('#12: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1); x[1] === -1. Actual: ' + (x[1]));
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*---
|
||||
info: "[[Get]] from not an inherited property"
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A4_T2
|
||||
description: >
|
||||
[[Prototype]] of Array instance is Array.prototype, [[Prototype]
|
||||
@ -14,33 +15,33 @@ var x = [0,1];
|
||||
var arr = x.splice(1,1,2);
|
||||
|
||||
//CHECK#1
|
||||
if (arr.length !== 1) {
|
||||
$ERROR('#1: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1,2); arr.length === 1. Actual: ' + (arr.length));
|
||||
if (arr.length !== 1) {
|
||||
$ERROR('#1: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1,2); arr.length === 1. Actual: ' + (arr.length));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (arr[0] !== 1) {
|
||||
$ERROR('#2: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1,2); arr[0] === 1. Actual: ' + (arr[0]));
|
||||
if (arr[0] !== 1) {
|
||||
$ERROR('#2: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1,2); arr[0] === 1. Actual: ' + (arr[0]));
|
||||
}
|
||||
|
||||
//CHECK#3
|
||||
if (arr[1] !== -1) {
|
||||
$ERROR('#3: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1,2); arr[1] === -1. Actual: ' + (arr[1]));
|
||||
if (arr[1] !== -1) {
|
||||
$ERROR('#3: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1,2); arr[1] === -1. Actual: ' + (arr[1]));
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (x.length !== 2) {
|
||||
$ERROR('#4: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1,2); x.length === 2. Actual: ' + (x.length));
|
||||
if (x.length !== 2) {
|
||||
$ERROR('#4: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1,2); x.length === 2. Actual: ' + (x.length));
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (x[0] !== 0) {
|
||||
$ERROR('#5: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1,2); x[0] === 0. Actual: ' + (x[0]));
|
||||
if (x[0] !== 0) {
|
||||
$ERROR('#5: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1,2); x[0] === 0. Actual: ' + (x[0]));
|
||||
}
|
||||
|
||||
//CHECK#6
|
||||
if (x[1] !== 2) {
|
||||
$ERROR('#6: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1,2); x[1] === 2. Actual: ' + (x[1]));
|
||||
if (x[1] !== 2) {
|
||||
$ERROR('#6: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1,2); x[1] === 2. Actual: ' + (x[1]));
|
||||
}
|
||||
|
||||
|
||||
@ -51,31 +52,31 @@ x = {0:0, 1:1};
|
||||
var arr = x.splice(1,1,2);
|
||||
|
||||
//CHECK#7
|
||||
if (arr.length !== 1) {
|
||||
$ERROR('#7: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1,2); arr.length === 1. Actual: ' + (arr.length));
|
||||
if (arr.length !== 1) {
|
||||
$ERROR('#7: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1,2); arr.length === 1. Actual: ' + (arr.length));
|
||||
}
|
||||
|
||||
//CHECK#8
|
||||
if (arr[0] !== 1) {
|
||||
$ERROR('#8: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1,2); arr[0] === 1. Actual: ' + (arr[0]));
|
||||
if (arr[0] !== 1) {
|
||||
$ERROR('#8: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1,2); arr[0] === 1. Actual: ' + (arr[0]));
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if (arr[1] !== -1) {
|
||||
$ERROR('#9: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1,2); arr[1] === -1. Actual: ' + (arr[1]));
|
||||
if (arr[1] !== -1) {
|
||||
$ERROR('#9: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1,2); arr[1] === -1. Actual: ' + (arr[1]));
|
||||
}
|
||||
|
||||
//CHECK#10
|
||||
if (x.length !== 2) {
|
||||
$ERROR('#10: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1,2); x.length === 2. Actual: ' + (x.length));
|
||||
if (x.length !== 2) {
|
||||
$ERROR('#10: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1,2); x.length === 2. Actual: ' + (x.length));
|
||||
}
|
||||
|
||||
//CHECK#11
|
||||
if (x[0] !== 0) {
|
||||
$ERROR('#11: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1,2); x[0] === 0. Actual: ' + (x[0]));
|
||||
if (x[0] !== 0) {
|
||||
$ERROR('#11: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1,2); x[0] === 0. Actual: ' + (x[0]));
|
||||
}
|
||||
|
||||
//CHECK#12
|
||||
if (x[1] !== 2) {
|
||||
$ERROR('#12: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1,2); x[1] === 2. Actual: ' + (x[1]));
|
||||
if (x[1] !== 2) {
|
||||
$ERROR('#12: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1,2); x[1] === 2. Actual: ' + (x[1]));
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*---
|
||||
info: "[[Get]] from not an inherited property"
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A4_T3
|
||||
description: >
|
||||
[[Prototype]] of Array instance is Array.prototype, [[Prototype]
|
||||
@ -15,30 +16,30 @@ x.length = 1;
|
||||
var arr = x.splice(0,1);
|
||||
|
||||
//CHECK#1
|
||||
if (arr.length !== 1) {
|
||||
$ERROR('#1: Array.prototype[0] = -1; x = []; x.length = 1; var arr = x.splice(0,1); arr.length === 1. Actual: ' + (arr.length));
|
||||
if (arr.length !== 1) {
|
||||
$ERROR('#1: Array.prototype[0] = -1; x = []; x.length = 1; var arr = x.splice(0,1); arr.length === 1. Actual: ' + (arr.length));
|
||||
}
|
||||
|
||||
//CHECK#2
|
||||
if (arr[0] !== -1) {
|
||||
$ERROR('#2: Array.prototype[0] = -1; x = []; x.length = 1; var arr = x.splice(0,1); arr[0] === -1. Actual: ' + (arr[0]));
|
||||
if (arr[0] !== -1) {
|
||||
$ERROR('#2: Array.prototype[0] = -1; x = []; x.length = 1; var arr = x.splice(0,1); arr[0] === -1. Actual: ' + (arr[0]));
|
||||
}
|
||||
|
||||
delete arr[0];
|
||||
|
||||
//CHECK#3
|
||||
if (arr[0] !== -1) {
|
||||
$ERROR('#3: Array.prototype[0] = -1; x = []; x.length = 1; var arr = x.splice(0,1); delete arr[0]; arr[0] === -1. Actual: ' + (arr[0]));
|
||||
if (arr[0] !== -1) {
|
||||
$ERROR('#3: Array.prototype[0] = -1; x = []; x.length = 1; var arr = x.splice(0,1); delete arr[0]; arr[0] === -1. Actual: ' + (arr[0]));
|
||||
}
|
||||
|
||||
//CHECK#4
|
||||
if (x.length !== 0) {
|
||||
$ERROR('#4: Array.prototype[0] = -1; x = []; x.length = 1; var arr = x.splice(0,1); x.length === 0. Actual: ' + (x.length));
|
||||
if (x.length !== 0) {
|
||||
$ERROR('#4: Array.prototype[0] = -1; x = []; x.length = 1; var arr = x.splice(0,1); x.length === 0. Actual: ' + (x.length));
|
||||
}
|
||||
|
||||
//CHECK#5
|
||||
if (x[0] !== -1) {
|
||||
$ERROR('#5: Array.prototype[0] = -1; x = []; x.length = 1; var arr = x.splice(0,1); x[0] === -1. Actual: ' + (x[0]));
|
||||
if (x[0] !== -1) {
|
||||
$ERROR('#5: Array.prototype[0] = -1; x = []; x.length = 1; var arr = x.splice(0,1); x[0] === -1. Actual: ' + (x[0]));
|
||||
}
|
||||
|
||||
Object.prototype[0] = -1;
|
||||
@ -48,28 +49,28 @@ x = {};
|
||||
var arr = x.splice(0,1);
|
||||
|
||||
//CHECK#6
|
||||
if (arr.length !== 1) {
|
||||
$ERROR('#6: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.splice = Array.prototype.splice; x = {}; var arr = x.splice(0,1); arr.length === 1. Actual: ' + (arr.length));
|
||||
if (arr.length !== 1) {
|
||||
$ERROR('#6: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.splice = Array.prototype.splice; x = {}; var arr = x.splice(0,1); arr.length === 1. Actual: ' + (arr.length));
|
||||
}
|
||||
|
||||
//CHECK#7
|
||||
if (arr[0] !== -1) {
|
||||
$ERROR('#7: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.splice = Array.prototype.splice; x = {}; var arr = x.splice(0,1); arr[0] === -1. Actual: ' + (arr[0]));
|
||||
if (arr[0] !== -1) {
|
||||
$ERROR('#7: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.splice = Array.prototype.splice; x = {}; var arr = x.splice(0,1); arr[0] === -1. Actual: ' + (arr[0]));
|
||||
}
|
||||
|
||||
delete arr[0];
|
||||
|
||||
//CHECK#8
|
||||
if (arr[0] !== -1) {
|
||||
$ERROR('#8: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.splice = Array.prototype.splice; x = {}; var arr = x.splice(0,1); delete arr[0]; arr[0] === -1. Actual: ' + (arr[0]));
|
||||
if (arr[0] !== -1) {
|
||||
$ERROR('#8: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.splice = Array.prototype.splice; x = {}; var arr = x.splice(0,1); delete arr[0]; arr[0] === -1. Actual: ' + (arr[0]));
|
||||
}
|
||||
|
||||
//CHECK#9
|
||||
if (x.length !== 0) {
|
||||
$ERROR('#9: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.splice = Array.prototype.splice; x = {}; var arr = x.splice(0,1); x.length === 0. Actual: ' + (x.length));
|
||||
if (x.length !== 0) {
|
||||
$ERROR('#9: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.splice = Array.prototype.splice; x = {}; var arr = x.splice(0,1); x.length === 0. Actual: ' + (x.length));
|
||||
}
|
||||
|
||||
//CHECK#10
|
||||
if (x[0] !== -1) {
|
||||
$ERROR('#10: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.splice = Array.prototype.splice; x = {}; var arr = x.splice(0,1); x[0] === -1. Actual: ' + (x[0]));
|
||||
if (x[0] !== -1) {
|
||||
$ERROR('#10: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.splice = Array.prototype.splice; x = {}; var arr = x.splice(0,1); x[0] === -1. Actual: ' + (x[0]));
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*---
|
||||
info: The splice property of Array can't be used as constructor
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A5.7
|
||||
description: >
|
||||
If property does not implement the internal [[Construct]] method,
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*---
|
||||
info: Array.prototype.splice sets `length` on `this`
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A6.1_T1
|
||||
description: Array.prototype.splice sets `length` on Array
|
||||
---*/
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*---
|
||||
info: Array.prototype.splice sets `length` on `this`
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A6.1_T2
|
||||
description: Array.prototype.splice throws if `length` is read-only
|
||||
---*/
|
||||
|
@ -3,13 +3,14 @@
|
||||
|
||||
/*---
|
||||
info: Array.prototype.splice sets `length` on `this`
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12_A6.1_T3
|
||||
description: Array.prototype.splice throws if `length` is read-only
|
||||
---*/
|
||||
|
||||
var a = {
|
||||
var a = {
|
||||
get length() { return 0; },
|
||||
splice: Array.prototype.splice
|
||||
splice: Array.prototype.splice
|
||||
};
|
||||
|
||||
try {
|
||||
|
@ -11,6 +11,7 @@ info: >
|
||||
a. Let insertCount be 0.
|
||||
b. Let actualDeleteCount be len – actualStart.
|
||||
es6id: 22.1.3.25
|
||||
esid: sec-array.prototype.splice
|
||||
---*/
|
||||
|
||||
var array = ["first", "second", "third"];
|
||||
|
@ -2,6 +2,7 @@
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-array.prototype.splice
|
||||
es6id: 22.1.3.25
|
||||
description: >
|
||||
Array.prototype.splice.name is "splice".
|
||||
|
@ -9,6 +9,7 @@ info: >
|
||||
...
|
||||
24. Let setStatus be Set(O, "length", len – actualDeleteCount + itemCount, true).
|
||||
25. ReturnIfAbrupt(setStatus).
|
||||
esid: sec-array.prototype.splice
|
||||
es5id: 15.4.4.12
|
||||
es6id: 22.1.3.25
|
||||
---*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user