add esid to array/prototype/slice tests

This commit is contained in:
deathbearbrown 2017-06-30 10:31:00 -07:00 committed by Rick Waldron
parent 518df03a59
commit 1122913fd9
44 changed files with 122 additions and 78 deletions

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-array.prototype.slice
es5id: 15.4.4.10-10-c-ii-1 es5id: 15.4.4.10-10-c-ii-1
description: > description: >
Array.prototype.slice will slice a string from start to end when Array.prototype.slice will slice a string from start to end when

View File

@ -5,6 +5,7 @@
info: > info: >
If start is positive, use min(start, length). If start is positive, use min(start, length).
If end is positive, use min(end, length) If end is positive, use min(end, length)
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.1_T1 es5id: 15.4.4.10_A1.1_T1
description: length > end > start = 0 description: length > end > start = 0
---*/ ---*/
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 3) { if (arr.length !== 3) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,3); arr.length === 3. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,3); arr.length === 3. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 0) { if (arr[0] !== 0) {
@ -31,12 +32,12 @@ if (arr[0] !== 0) {
//CHECK#4 //CHECK#4
if (arr[1] !== 1) { if (arr[1] !== 1) {
$ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(0,3); arr[1] === 1. Actual: ' + (arr[1])); $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(0,3); arr[1] === 1. Actual: ' + (arr[1]));
} }
//CHECK#5 //CHECK#5
if (arr[2] !== 2) { if (arr[2] !== 2) {
$ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(0,3); arr[2] === 2. Actual: ' + (arr[2])); $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(0,3); arr[2] === 2. Actual: ' + (arr[2]));
} }
//CHECK#6 //CHECK#6
if (arr[3] !== undefined) { if (arr[3] !== undefined) {

View File

@ -5,6 +5,7 @@
info: > info: >
If start is positive, use min(start, length). If start is positive, use min(start, length).
If end is positive, use min(end, length) If end is positive, use min(end, length)
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.1_T2 es5id: 15.4.4.10_A1.1_T2
description: length > end = start > 0 description: length > end = start > 0
---*/ ---*/
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 0) { if (arr.length !== 0) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(3,3); arr.length === 0. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(3,3); arr.length === 0. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== undefined) { if (arr[0] !== undefined) {

View File

@ -5,6 +5,7 @@
info: > info: >
If start is positive, use min(start, length). If start is positive, use min(start, length).
If end is positive, use min(end, length) If end is positive, use min(end, length)
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.1_T3 es5id: 15.4.4.10_A1.1_T3
description: length > start > end > 0 description: length > start > end > 0
---*/ ---*/
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 0) { if (arr.length !== 0) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(4,3); arr.length === 0. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(4,3); arr.length === 0. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== undefined) { if (arr[0] !== undefined) {

View File

@ -5,6 +5,7 @@
info: > info: >
If start is positive, use min(start, length). If start is positive, use min(start, length).
If end is positive, use min(end, length) If end is positive, use min(end, length)
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.1_T4 es5id: 15.4.4.10_A1.1_T4
description: length = end = start > 0 description: length = end = start > 0
---*/ ---*/
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 0) { if (arr.length !== 0) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(5,5); arr.length === 0. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(5,5); arr.length === 0. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== undefined) { if (arr[0] !== undefined) {

View File

@ -5,6 +5,7 @@
info: > info: >
If start is positive, use min(start, length). If start is positive, use min(start, length).
If end is positive, use min(end, length) If end is positive, use min(end, length)
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.1_T5 es5id: 15.4.4.10_A1.1_T5
description: length = end > start > 0 description: length = end > start > 0
---*/ ---*/
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 2) { if (arr.length !== 2) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(3,5); arr.length === 2. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(3,5); arr.length === 2. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 3) { if (arr[0] !== 3) {
@ -31,7 +32,7 @@ if (arr[0] !== 3) {
//CHECK#4 //CHECK#4
if (arr[1] !== 4) { if (arr[1] !== 4) {
$ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(3,5); arr[1] === 4. Actual: ' + (arr[1])); $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(3,5); arr[1] === 4. Actual: ' + (arr[1]));
} }
//CHECK#5 //CHECK#5
if (arr[3] !== undefined) { if (arr[3] !== undefined) {

View File

@ -5,6 +5,7 @@
info: > info: >
If start is positive, use min(start, length). If start is positive, use min(start, length).
If end is positive, use min(end, length) If end is positive, use min(end, length)
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.1_T6 es5id: 15.4.4.10_A1.1_T6
description: length > end > start > 0; description: length > end > start > 0;
---*/ ---*/
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 2) { if (arr.length !== 2) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(2,4); arr.length === 2. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(2,4); arr.length === 2. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 2) { if (arr[0] !== 2) {
@ -31,7 +32,7 @@ if (arr[0] !== 2) {
//CHECK#4 //CHECK#4
if (arr[1] !== 3) { if (arr[1] !== 3) {
$ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(2,4); arr[1] === 3. Actual: ' + (arr[1])); $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(2,4); arr[1] === 3. Actual: ' + (arr[1]));
} }
//CHECK#5 //CHECK#5
if (arr[3] !== undefined) { if (arr[3] !== undefined) {

View File

@ -5,6 +5,7 @@
info: > info: >
If start is positive, use min(start, length). If start is positive, use min(start, length).
If end is positive, use min(end, length) If end is positive, use min(end, length)
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.1_T7 es5id: 15.4.4.10_A1.1_T7
description: end > length > start > 0 description: end > length > start > 0
---*/ ---*/
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 2) { if (arr.length !== 2) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(3,6); arr.length === 2. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(3,6); arr.length === 2. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 3) { if (arr[0] !== 3) {
@ -31,7 +32,7 @@ if (arr[0] !== 3) {
//CHECK#4 //CHECK#4
if (arr[1] !== 4) { if (arr[1] !== 4) {
$ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(3,6); arr[1] === 4. Actual: ' + (arr[1])); $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(3,6); arr[1] === 4. Actual: ' + (arr[1]));
} }
//CHECK#5 //CHECK#5
if (arr[3] !== undefined) { if (arr[3] !== undefined) {

View File

@ -5,6 +5,7 @@
info: > info: >
If start is negative, use max(start + length, 0). If start is negative, use max(start + length, 0).
If end is positive, use min(end, length) If end is positive, use min(end, length)
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.2_T1 es5id: 15.4.4.10_A1.2_T1
description: length > end = abs(start), start < 0 description: length > end = abs(start), start < 0
---*/ ---*/
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 1) { if (arr.length !== 1) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-3,3); arr.length === 1. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-3,3); arr.length === 1. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 2) { if (arr[0] !== 2) {

View File

@ -5,6 +5,7 @@
info: > info: >
If start is negative, use max(start + length, 0). If start is negative, use max(start + length, 0).
If end is positive, use min(end, length) If end is positive, use min(end, length)
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.2_T2 es5id: 15.4.4.10_A1.2_T2
description: length = end > abs(start), start < 0 description: length = end > abs(start), start < 0
---*/ ---*/
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 1) { if (arr.length !== 1) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-1,5); arr.length === 1. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-1,5); arr.length === 1. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 4) { if (arr[0] !== 4) {

View File

@ -5,6 +5,7 @@
info: > info: >
If start is negative, use max(start + length, 0). If start is negative, use max(start + length, 0).
If end is positive, use min(end, length) If end is positive, use min(end, length)
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.2_T3 es5id: 15.4.4.10_A1.2_T3
description: abs(start) = length > end > 0, start < 0 description: abs(start) = length > end > 0, start < 0
---*/ ---*/
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 1) { if (arr.length !== 1) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-5,1); arr.length === 1. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-5,1); arr.length === 1. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 0) { if (arr[0] !== 0) {

View File

@ -5,6 +5,7 @@
info: > info: >
If start is negative, use max(start + length, 0). If start is negative, use max(start + length, 0).
If end is positive, use min(end, length) If end is positive, use min(end, length)
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.2_T4 es5id: 15.4.4.10_A1.2_T4
description: abs(start) > length = end > 0, start < 0 description: abs(start) > length = end > 0, start < 0
---*/ ---*/
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 5) { if (arr.length !== 5) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-9,5); arr.length === 5. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-9,5); arr.length === 5. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 0) { if (arr[0] !== 0) {

View File

@ -5,6 +5,7 @@
info: > info: >
If start is positive, use min(start, length). If start is positive, use min(start, length).
If end is negative, use max(end + length, 0) If end is negative, use max(end + length, 0)
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.3_T1 es5id: 15.4.4.10_A1.3_T1
description: length > abs(end) > start = 0, end < 0 description: length > abs(end) > start = 0, end < 0
---*/ ---*/
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 3) { if (arr.length !== 3) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,-2); arr.length === 3. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,-2); arr.length === 3. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 0) { if (arr[0] !== 0) {
@ -31,12 +32,12 @@ if (arr[0] !== 0) {
//CHECK#4 //CHECK#4
if (arr[1] !== 1) { if (arr[1] !== 1) {
$ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(0,-2); arr[1] === 1. Actual: ' + (arr[1])); $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(0,-2); arr[1] === 1. Actual: ' + (arr[1]));
} }
//CHECK#5 //CHECK#5
if (arr[2] !== 2) { if (arr[2] !== 2) {
$ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(0,-2); arr[2] === 2. Actual: ' + (arr[2])); $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(0,-2); arr[2] === 2. Actual: ' + (arr[2]));
} }
//CHECK#6 //CHECK#6
if (arr[3] !== undefined) { if (arr[3] !== undefined) {

View File

@ -5,6 +5,7 @@
info: > info: >
If start is positive, use min(start, length). If start is positive, use min(start, length).
If end is negative, use max(end + length, 0) If end is negative, use max(end + length, 0)
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.3_T2 es5id: 15.4.4.10_A1.3_T2
description: length > abs(end) > start > 0, end < 0 description: length > abs(end) > start > 0, end < 0
---*/ ---*/
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 0) { if (arr.length !== 0) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(1,-4); arr.length === 0. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(1,-4); arr.length === 0. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== undefined) { if (arr[0] !== undefined) {

View File

@ -5,6 +5,7 @@
info: > info: >
If start is positive, use min(start, length). If start is positive, use min(start, length).
If end is negative, use max(end + length, 0) If end is negative, use max(end + length, 0)
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.3_T3 es5id: 15.4.4.10_A1.3_T3
description: length = abs(end) > start = 0, end < 0 description: length = abs(end) > start = 0, end < 0
---*/ ---*/
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 0) { if (arr.length !== 0) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,-5); arr.length === 0. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,-5); arr.length === 0. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== undefined) { if (arr[0] !== undefined) {

View File

@ -5,6 +5,7 @@
info: > info: >
If start is positive, use min(start, length). If start is positive, use min(start, length).
If end is negative, use max(end + length, 0) If end is negative, use max(end + length, 0)
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.3_T4 es5id: 15.4.4.10_A1.3_T4
description: abs(end) > length > start > 0, end < 0 description: abs(end) > length > start > 0, end < 0
---*/ ---*/
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 0) { if (arr.length !== 0) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(4,-9); arr.length === 0. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(4,-9); arr.length === 0. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== undefined) { if (arr[0] !== undefined) {

View File

@ -5,6 +5,7 @@
info: > info: >
If start is negative, use max(start + length, 0). If start is negative, use max(start + length, 0).
If end is negative, use max(end + length, 0) If end is negative, use max(end + length, 0)
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.4_T1 es5id: 15.4.4.10_A1.4_T1
description: -length = start < end < 0 description: -length = start < end < 0
---*/ ---*/
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 3) { if (arr.length !== 3) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-5,-2); arr.length === 3. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-5,-2); arr.length === 3. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 0) { if (arr[0] !== 0) {
@ -31,12 +32,12 @@ if (arr[0] !== 0) {
//CHECK#4 //CHECK#4
if (arr[1] !== 1) { if (arr[1] !== 1) {
$ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(-5,-2); arr[1] === 1. Actual: ' + (arr[1])); $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(-5,-2); arr[1] === 1. Actual: ' + (arr[1]));
} }
//CHECK#5 //CHECK#5
if (arr[2] !== 2) { if (arr[2] !== 2) {
$ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(-5,-2); arr[2] === 2. Actual: ' + (arr[2])); $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(-5,-2); arr[2] === 2. Actual: ' + (arr[2]));
} }
//CHECK#6 //CHECK#6
if (arr[3] !== undefined) { if (arr[3] !== undefined) {

View File

@ -5,6 +5,7 @@
info: > info: >
If start is negative, use max(start + length, 0). If start is negative, use max(start + length, 0).
If end is negative, use max(end + length, 0) If end is negative, use max(end + length, 0)
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.4_T2 es5id: 15.4.4.10_A1.4_T2
description: -length < start < end < 0 description: -length < start < end < 0
---*/ ---*/
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 2) { if (arr.length !== 2) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-3,-1); arr.length === 2. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-3,-1); arr.length === 2. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 2) { if (arr[0] !== 2) {
@ -31,7 +32,7 @@ if (arr[0] !== 2) {
//CHECK#4 //CHECK#4
if (arr[1] !== 3) { if (arr[1] !== 3) {
$ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(-3,-1); arr[1] === 3. Actual: ' + (arr[1])); $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(-3,-1); arr[1] === 3. Actual: ' + (arr[1]));
} }
//CHECK#5 //CHECK#5
if (arr[2] !== undefined) { if (arr[2] !== undefined) {

View File

@ -5,6 +5,7 @@
info: > info: >
If start is negative, use max(start + length, 0). If start is negative, use max(start + length, 0).
If end is negative, use max(end + length, 0) If end is negative, use max(end + length, 0)
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.4_T3 es5id: 15.4.4.10_A1.4_T3
description: start < -length < end < 0 description: start < -length < end < 0
---*/ ---*/
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 4) { if (arr.length !== 4) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-9,-1); arr.length === 4. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-9,-1); arr.length === 4. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 0) { if (arr[0] !== 0) {
@ -36,13 +37,13 @@ if (arr[1] !== 1) {
//CHECK#5 //CHECK#5
if (arr[2] !== 2) { if (arr[2] !== 2) {
$ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(-9,-1); arr[2] === 2. Actual: ' + (arr[2])); $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(-9,-1); arr[2] === 2. Actual: ' + (arr[2]));
} }
//CHECK#6 //CHECK#6
if (arr[3] !== 3) { if (arr[3] !== 3) {
$ERROR('#6: var x = [0,1,2,3,4]; var arr = x.slice(-9,-1); arr[3] === 3. Actual: ' + (arr[3])); $ERROR('#6: var x = [0,1,2,3,4]; var arr = x.slice(-9,-1); arr[3] === 3. Actual: ' + (arr[3]));
} }
//CHECK#7 //CHECK#7
if (arr[4] !== undefined) { if (arr[4] !== undefined) {
$ERROR('#7: var x = [0,1,2,3,4]; var arr = x.slice(-9,-1); arr[4] === undefined. Actual: ' + (arr[4])); $ERROR('#7: var x = [0,1,2,3,4]; var arr = x.slice(-9,-1); arr[4] === undefined. Actual: ' + (arr[4]));

View File

@ -5,6 +5,7 @@
info: > info: >
If start is negative, use max(start + length, 0). If start is negative, use max(start + length, 0).
If end is negative, use max(end + length, 0) If end is negative, use max(end + length, 0)
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.4_T4 es5id: 15.4.4.10_A1.4_T4
description: start = end < -length description: start = end < -length
---*/ ---*/
@ -21,7 +22,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 0) { if (arr.length !== 0) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-6,-6); arr.length === 0. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-6,-6); arr.length === 0. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== undefined) { if (arr[0] !== undefined) {

View File

@ -3,6 +3,7 @@
/*--- /*---
info: If end is undefined use length info: If end is undefined use length
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.5_T1 es5id: 15.4.4.10_A1.5_T1
description: end === undefined description: end === undefined
---*/ ---*/
@ -19,7 +20,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 2) { if (arr.length !== 2) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(3, undefined); arr.length === 2. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(3, undefined); arr.length === 2. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 3) { if (arr[0] !== 3) {

View File

@ -3,6 +3,7 @@
/*--- /*---
info: If end is undefined use length info: If end is undefined use length
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A1.5_T2 es5id: 15.4.4.10_A1.5_T2
description: end is absent description: end is absent
---*/ ---*/
@ -19,7 +20,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 2) { if (arr.length !== 2) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-2); arr.length === 2. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-2); arr.length === 2. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 3) { if (arr[0] !== 3) {

View File

@ -3,6 +3,7 @@
/*--- /*---
info: Operator use ToInteger from start info: Operator use ToInteger from start
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A2.1_T1 es5id: 15.4.4.10_A2.1_T1
description: start is not integer description: start is not integer
---*/ ---*/
@ -19,7 +20,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 2) { if (arr.length !== 2) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(2.5,4); arr.length === 2. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(2.5,4); arr.length === 2. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 2) { if (arr[0] !== 2) {
@ -29,7 +30,7 @@ if (arr[0] !== 2) {
//CHECK#4 //CHECK#4
if (arr[1] !== 3) { if (arr[1] !== 3) {
$ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(2.5,4); arr[1] === 3. Actual: ' + (arr[1])); $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(2.5,4); arr[1] === 3. Actual: ' + (arr[1]));
} }
//CHECK#5 //CHECK#5
if (arr[3] !== undefined) { if (arr[3] !== undefined) {

View File

@ -3,6 +3,7 @@
/*--- /*---
info: Operator use ToInteger from start info: Operator use ToInteger from start
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A2.1_T2 es5id: 15.4.4.10_A2.1_T2
description: start = NaN description: start = NaN
---*/ ---*/
@ -19,7 +20,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 3) { if (arr.length !== 3) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(NaN,3); arr.length === 3. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(NaN,3); arr.length === 3. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 0) { if (arr[0] !== 0) {
@ -29,12 +30,12 @@ if (arr[0] !== 0) {
//CHECK#4 //CHECK#4
if (arr[1] !== 1) { if (arr[1] !== 1) {
$ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(NaN,3); arr[1] === 1. Actual: ' + (arr[1])); $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(NaN,3); arr[1] === 1. Actual: ' + (arr[1]));
} }
//CHECK#5 //CHECK#5
if (arr[2] !== 2) { if (arr[2] !== 2) {
$ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(NaN,3); arr[2] === 2. Actual: ' + (arr[2])); $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(NaN,3); arr[2] === 2. Actual: ' + (arr[2]));
} }
//CHECK#6 //CHECK#6
if (arr[3] !== undefined) { if (arr[3] !== undefined) {

View File

@ -3,6 +3,7 @@
/*--- /*---
info: Operator use ToInteger from start info: Operator use ToInteger from start
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A2.1_T3 es5id: 15.4.4.10_A2.1_T3
description: start = Infinity description: start = Infinity
---*/ ---*/
@ -19,7 +20,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 0) { if (arr.length !== 0) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(Number.POSITIVE_INFINITY,3); arr.length === 0. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(Number.POSITIVE_INFINITY,3); arr.length === 0. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== undefined) { if (arr[0] !== undefined) {

View File

@ -3,6 +3,7 @@
/*--- /*---
info: Operator use ToInteger from start info: Operator use ToInteger from start
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A2.1_T4 es5id: 15.4.4.10_A2.1_T4
description: start = -Infinity description: start = -Infinity
---*/ ---*/
@ -19,7 +20,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 3) { if (arr.length !== 3) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(Number.NEGATIVE_INFINITY,3); arr.length === 3. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(Number.NEGATIVE_INFINITY,3); arr.length === 3. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 0) { if (arr[0] !== 0) {
@ -29,12 +30,12 @@ if (arr[0] !== 0) {
//CHECK#4 //CHECK#4
if (arr[1] !== 1) { if (arr[1] !== 1) {
$ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(Number.NEGATIVE_INFINITY,3); arr[1] === 1. Actual: ' + (arr[1])); $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(Number.NEGATIVE_INFINITY,3); arr[1] === 1. Actual: ' + (arr[1]));
} }
//CHECK#5 //CHECK#5
if (arr[2] !== 2) { if (arr[2] !== 2) {
$ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(Number.NEGATIVE_INFINITY,3); arr[2] === 2. Actual: ' + (arr[2])); $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(Number.NEGATIVE_INFINITY,3); arr[2] === 2. Actual: ' + (arr[2]));
} }
//CHECK#6 //CHECK#6
if (arr[3] !== undefined) { if (arr[3] !== undefined) {

View File

@ -3,6 +3,7 @@
/*--- /*---
info: Operator use ToInteger from start info: Operator use ToInteger from start
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A2.1_T5 es5id: 15.4.4.10_A2.1_T5
description: ToInteger use ToNumber description: ToInteger use ToNumber
---*/ ---*/
@ -19,7 +20,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 3) { if (arr.length !== 3) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice({valueOf: function() {return 0}, toString: function() {return 3}},3); arr.length === 3. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice({valueOf: function() {return 0}, toString: function() {return 3}},3); arr.length === 3. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 0) { if (arr[0] !== 0) {
@ -29,12 +30,12 @@ if (arr[0] !== 0) {
//CHECK#4 //CHECK#4
if (arr[1] !== 1) { if (arr[1] !== 1) {
$ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice({valueOf: function() {return 0}, toString: function() {return 3}},3); arr[1] === 1. Actual: ' + (arr[1])); $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice({valueOf: function() {return 0}, toString: function() {return 3}},3); arr[1] === 1. Actual: ' + (arr[1]));
} }
//CHECK#5 //CHECK#5
if (arr[2] !== 2) { if (arr[2] !== 2) {
$ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice({valueOf: function() {return 0}, toString: function() {return 3}},3); arr[2] === 2. Actual: ' + (arr[2])); $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice({valueOf: function() {return 0}, toString: function() {return 3}},3); arr[2] === 2. Actual: ' + (arr[2]));
} }
//CHECK#6 //CHECK#6
if (arr[3] !== undefined) { if (arr[3] !== undefined) {

View File

@ -3,6 +3,7 @@
/*--- /*---
info: Operator use ToInteger from end info: Operator use ToInteger from end
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A2.2_T1 es5id: 15.4.4.10_A2.2_T1
description: end is not integer description: end is not integer
---*/ ---*/
@ -19,7 +20,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 2) { if (arr.length !== 2) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(2,4.5); arr.length === 2. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(2,4.5); arr.length === 2. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 2) { if (arr[0] !== 2) {
@ -29,7 +30,7 @@ if (arr[0] !== 2) {
//CHECK#4 //CHECK#4
if (arr[1] !== 3) { if (arr[1] !== 3) {
$ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(2,4.5); arr[1] === 3. Actual: ' + (arr[1])); $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(2,4.5); arr[1] === 3. Actual: ' + (arr[1]));
} }
//CHECK#5 //CHECK#5
if (arr[3] !== undefined) { if (arr[3] !== undefined) {

View File

@ -3,6 +3,7 @@
/*--- /*---
info: Operator use ToInteger from end info: Operator use ToInteger from end
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A2.2_T2 es5id: 15.4.4.10_A2.2_T2
description: end = NaN description: end = NaN
---*/ ---*/
@ -19,7 +20,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 0) { if (arr.length !== 0) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,NaN); arr.length === 0. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,NaN); arr.length === 0. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== undefined) { if (arr[0] !== undefined) {

View File

@ -3,6 +3,7 @@
/*--- /*---
info: Operator use ToInteger from end info: Operator use ToInteger from end
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A2.2_T3 es5id: 15.4.4.10_A2.2_T3
description: end = Infinity description: end = Infinity
---*/ ---*/
@ -19,7 +20,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 5) { if (arr.length !== 5) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,Number.POSITIVE_INFINITY); arr.length === 5. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,Number.POSITIVE_INFINITY); arr.length === 5. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 0) { if (arr[0] !== 0) {

View File

@ -3,6 +3,7 @@
/*--- /*---
info: Operator use ToInteger from end info: Operator use ToInteger from end
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A2.2_T4 es5id: 15.4.4.10_A2.2_T4
description: end = -Infinity description: end = -Infinity
---*/ ---*/
@ -19,7 +20,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 0) { if (arr.length !== 0) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,Number.NEGATIVE_INFINITY); arr.length === 0. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,Number.NEGATIVE_INFINITY); arr.length === 0. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== undefined) { if (arr[0] !== undefined) {

View File

@ -3,6 +3,7 @@
/*--- /*---
info: Operator use ToInteger from end info: Operator use ToInteger from end
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A2.2_T5 es5id: 15.4.4.10_A2.2_T5
description: ToInteger use ToNumber description: ToInteger use ToNumber
---*/ ---*/
@ -19,7 +20,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 3) { if (arr.length !== 3) {
$ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); arr.length === 3. Actual: ' + (arr.length)); $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); arr.length === 3. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 0) { if (arr[0] !== 0) {
@ -29,12 +30,12 @@ if (arr[0] !== 0) {
//CHECK#4 //CHECK#4
if (arr[1] !== 1) { if (arr[1] !== 1) {
$ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); arr[1] === 1. Actual: ' + (arr[1])); $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); arr[1] === 1. Actual: ' + (arr[1]));
} }
//CHECK#5 //CHECK#5
if (arr[2] !== 2) { if (arr[2] !== 2) {
$ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); arr[2] === 2. Actual: ' + (arr[2])); $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); arr[2] === 2. Actual: ' + (arr[2]));
} }
//CHECK#6 //CHECK#6
if (arr[3] !== undefined) { if (arr[3] !== undefined) {

View File

@ -5,6 +5,7 @@
info: > info: >
The slice function is intentionally generic. The slice function is intentionally generic.
It does not require that its this value be an Array object It does not require that its this value be an Array object
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A2_T1 es5id: 15.4.4.10_A2_T1
description: > description: >
If start is positive, use min(start, length). If end is positive, If start is positive, use min(start, length). If end is positive,
@ -30,7 +31,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 3) { if (arr.length !== 3) {
$ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,3); arr.length === 3. Actual: ' + (arr.length)); $ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,3); arr.length === 3. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 0) { if (arr[0] !== 0) {
@ -40,12 +41,12 @@ if (arr[0] !== 0) {
//CHECK#4 //CHECK#4
if (arr[1] !== 1) { if (arr[1] !== 1) {
$ERROR('#4: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,3); arr[1] === 1. Actual: ' + (arr[1])); $ERROR('#4: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,3); arr[1] === 1. Actual: ' + (arr[1]));
} }
//CHECK#5 //CHECK#5
if (arr[2] !== 2) { if (arr[2] !== 2) {
$ERROR('#5: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,3); arr[2] === 2. Actual: ' + (arr[2])); $ERROR('#5: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,3); arr[2] === 2. Actual: ' + (arr[2]));
} }
//CHECK#6 //CHECK#6
if (arr[3] !== undefined) { if (arr[3] !== undefined) {

View File

@ -5,6 +5,7 @@
info: > info: >
The slice function is intentionally generic. The slice function is intentionally generic.
It does not require that its this value be an Array object It does not require that its this value be an Array object
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A2_T2 es5id: 15.4.4.10_A2_T2
description: > description: >
If start is negative, use max(start + length, 0). If end is If start is negative, use max(start + length, 0). If end is
@ -30,7 +31,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 3) { if (arr.length !== 3) {
$ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,3); arr.length === 3. Actual: ' + (arr.length)); $ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,3); arr.length === 3. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 0) { if (arr[0] !== 0) {
@ -40,12 +41,12 @@ if (arr[0] !== 0) {
//CHECK#4 //CHECK#4
if (arr[1] !== 1) { if (arr[1] !== 1) {
$ERROR('#4: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,3); arr[1] === 1. Actual: ' + (arr[1])); $ERROR('#4: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,3); arr[1] === 1. Actual: ' + (arr[1]));
} }
//CHECK#5 //CHECK#5
if (arr[2] !== 2) { if (arr[2] !== 2) {
$ERROR('#5: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,3); arr[2] === 2. Actual: ' + (arr[2])); $ERROR('#5: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,3); arr[2] === 2. Actual: ' + (arr[2]));
} }
//CHECK#6 //CHECK#6
if (arr[3] !== undefined) { if (arr[3] !== undefined) {

View File

@ -5,6 +5,7 @@
info: > info: >
The slice function is intentionally generic. The slice function is intentionally generic.
It does not require that its this value be an Array object It does not require that its this value be an Array object
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A2_T3 es5id: 15.4.4.10_A2_T3
description: > description: >
If start is positive, use min(start, length). If end is negative, If start is positive, use min(start, length). If end is negative,
@ -30,7 +31,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 3) { if (arr.length !== 3) {
$ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,-2); arr.length === 3. Actual: ' + (arr.length)); $ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,-2); arr.length === 3. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 0) { if (arr[0] !== 0) {
@ -40,12 +41,12 @@ if (arr[0] !== 0) {
//CHECK#4 //CHECK#4
if (arr[1] !== 1) { if (arr[1] !== 1) {
$ERROR('#4: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,-2); arr[1] === 1. Actual: ' + (arr[1])); $ERROR('#4: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,-2); arr[1] === 1. Actual: ' + (arr[1]));
} }
//CHECK#5 //CHECK#5
if (arr[2] !== 2) { if (arr[2] !== 2) {
$ERROR('#5: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,-2); arr[2] === 2. Actual: ' + (arr[2])); $ERROR('#5: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,-2); arr[2] === 2. Actual: ' + (arr[2]));
} }
//CHECK#6 //CHECK#6
if (arr[3] !== undefined) { if (arr[3] !== undefined) {

View File

@ -5,6 +5,7 @@
info: > info: >
The slice function is intentionally generic. The slice function is intentionally generic.
It does not require that its this value be an Array object It does not require that its this value be an Array object
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A2_T4 es5id: 15.4.4.10_A2_T4
description: > description: >
If start is negative, use max(start + length, 0). If end is If start is negative, use max(start + length, 0). If end is
@ -30,7 +31,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 3) { if (arr.length !== 3) {
$ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,-2); arr.length === 3. Actual: ' + (arr.length)); $ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,-2); arr.length === 3. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 0) { if (arr[0] !== 0) {
@ -40,12 +41,12 @@ if (arr[0] !== 0) {
//CHECK#4 //CHECK#4
if (arr[1] !== 1) { if (arr[1] !== 1) {
$ERROR('#4: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,-2); arr[1] === 1. Actual: ' + (arr[1])); $ERROR('#4: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,-2); arr[1] === 1. Actual: ' + (arr[1]));
} }
//CHECK#5 //CHECK#5
if (arr[2] !== 2) { if (arr[2] !== 2) {
$ERROR('#5: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,-2); arr[2] === 2. Actual: ' + (arr[2])); $ERROR('#5: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,-2); arr[2] === 2. Actual: ' + (arr[2]));
} }
//CHECK#6 //CHECK#6
if (arr[3] !== undefined) { if (arr[3] !== undefined) {

View File

@ -5,6 +5,7 @@
info: > info: >
The slice function is intentionally generic. The slice function is intentionally generic.
It does not require that its this value be an Array object It does not require that its this value be an Array object
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A2_T5 es5id: 15.4.4.10_A2_T5
description: If end is undefined use length description: If end is undefined use length
---*/ ---*/
@ -28,7 +29,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 3) { if (arr.length !== 3) {
$ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2); arr.length === 3. Actual: ' + (arr.length)); $ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2); arr.length === 3. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 2) { if (arr[0] !== 2) {
@ -38,12 +39,12 @@ if (arr[0] !== 2) {
//CHECK#4 //CHECK#4
if (arr[1] !== 3) { if (arr[1] !== 3) {
$ERROR('#4: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2); arr[1] === 3. Actual: ' + (arr[1])); $ERROR('#4: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2); arr[1] === 3. Actual: ' + (arr[1]));
} }
//CHECK#5 //CHECK#5
if (arr[2] !== 4) { if (arr[2] !== 4) {
$ERROR('#5: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2); arr[2] === 4. Actual: ' + (arr[2])); $ERROR('#5: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2); arr[2] === 4. Actual: ' + (arr[2]));
} }
//CHECK#6 //CHECK#6
if (arr[3] !== undefined) { if (arr[3] !== undefined) {

View File

@ -5,6 +5,7 @@
info: > info: >
The slice function is intentionally generic. The slice function is intentionally generic.
It does not require that its this value be an Array object It does not require that its this value be an Array object
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A2_T6 es5id: 15.4.4.10_A2_T6
description: If end is undefined use length description: If end is undefined use length
---*/ ---*/
@ -28,7 +29,7 @@ if (arr.getClass() !== "[object " + "Array" + "]") {
//CHECK#2 //CHECK#2
if (arr.length !== 3) { if (arr.length !== 3) {
$ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2, undefined); arr.length === 3. Actual: ' + (arr.length)); $ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2, undefined); arr.length === 3. Actual: ' + (arr.length));
} }
//CHECK#3 //CHECK#3
if (arr[0] !== 2) { if (arr[0] !== 2) {
@ -38,12 +39,12 @@ if (arr[0] !== 2) {
//CHECK#4 //CHECK#4
if (arr[1] !== 3) { if (arr[1] !== 3) {
$ERROR('#4: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2, undefined); arr[1] === 3. Actual: ' + (arr[1])); $ERROR('#4: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2, undefined); arr[1] === 3. Actual: ' + (arr[1]));
} }
//CHECK#5 //CHECK#5
if (arr[2] !== 4) { if (arr[2] !== 4) {
$ERROR('#5: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2, undefined); arr[2] === 4. Actual: ' + (arr[2])); $ERROR('#5: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2, undefined); arr[2] === 4. Actual: ' + (arr[2]));
} }
//CHECK#6 //CHECK#6
if (arr[3] !== undefined) { if (arr[3] !== undefined) {

View File

@ -3,6 +3,7 @@
/*--- /*---
info: Check ToLength(length) for non Array objects info: Check ToLength(length) for non Array objects
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A3_T1 es5id: 15.4.4.10_A3_T1
description: length = 4294967296 description: length = 4294967296
---*/ ---*/

View File

@ -3,6 +3,7 @@
/*--- /*---
info: Check ToLength(length) for non Array objects info: Check ToLength(length) for non Array objects
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A3_T2 es5id: 15.4.4.10_A3_T2
description: length = 4294967297 description: length = 4294967297
---*/ ---*/

View File

@ -3,6 +3,7 @@
/*--- /*---
info: Check ToUint32(length) for non Array objects info: Check ToUint32(length) for non Array objects
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A3_T3 es5id: 15.4.4.10_A3_T3
description: length = -1 description: length = -1
---*/ ---*/

View File

@ -3,6 +3,7 @@
/*--- /*---
info: "[[Get]] from not an inherited property" info: "[[Get]] from not an inherited property"
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A4_T1 es5id: 15.4.4.10_A4_T1
description: "[[Prototype]] of Array instance is Array.prototype" description: "[[Prototype]] of Array instance is Array.prototype"
---*/ ---*/
@ -13,16 +14,16 @@ x.length = 2;
var arr = x.slice(); var arr = x.slice();
//CHECK#1 //CHECK#1
if (arr[0] !== 0) { if (arr[0] !== 0) {
$ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.slice(); arr[0] === 0. Actual: ' + (arr[0])); $ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.slice(); arr[0] === 0. Actual: ' + (arr[0]));
} }
//CHECK#2 //CHECK#2
if (arr[1] !== 1) { if (arr[1] !== 1) {
$ERROR('#2: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.slice(); arr[1] === 1. Actual: ' + (arr[1])); $ERROR('#2: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.slice(); arr[1] === 1. Actual: ' + (arr[1]));
} }
//CHECK#3 //CHECK#3
if (arr.hasOwnProperty('1') !== true) { if (arr.hasOwnProperty('1') !== true) {
$ERROR('#3: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.slice(); arr.hasOwnProperty(\'1\') === true. Actual: ' + (arr.hasOwnProperty('1'))); $ERROR('#3: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.slice(); arr.hasOwnProperty(\'1\') === true. Actual: ' + (arr.hasOwnProperty('1')));
} }

View File

@ -3,6 +3,7 @@
/*--- /*---
info: The slice property of Array can't be used as constructor info: The slice property of Array can't be used as constructor
esid: sec-array.prototype.slice
es5id: 15.4.4.10_A5.7 es5id: 15.4.4.10_A5.7
description: > description: >
If property does not implement the internal [[Construct]] method, If property does not implement the internal [[Construct]] method,

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-array.prototype.slice
es6id: 22.1.3.22 es6id: 22.1.3.22
description: > description: >
Array.prototype.slice.name is "slice". Array.prototype.slice.name is "slice".