add esid to array/prototype/unshift tests

This commit is contained in:
deathbearbrown 2017-06-30 14:25:58 -07:00 committed by Rick Waldron
parent 2d13a07cc1
commit b2737b2d82
10 changed files with 73 additions and 63 deletions

View File

@ -6,6 +6,7 @@ info: >
The arguments are prepended to the start of the array, such that The arguments are prepended to the start of the array, such that
their order within the array is the same as the order in which they appear in their order within the array is the same as the order in which they appear in
the argument list the argument list
esid: sec-array.prototype.unshift
es5id: 15.4.4.13_A1_T1 es5id: 15.4.4.13_A1_T1
description: Checking case when unsift is given no arguments or one argument description: Checking case when unsift is given no arguments or one argument
---*/ ---*/
@ -15,7 +16,7 @@ var x = new Array();
var unshift = x.unshift(1); var unshift = x.unshift(1);
if (unshift !== 1) { if (unshift !== 1) {
$ERROR('#1: x = new Array(); x.unshift(1) === 1. Actual: ' + (unshift)); $ERROR('#1: x = new Array(); x.unshift(1) === 1. Actual: ' + (unshift));
} }
//CHECK#2 //CHECK#2
if (x[0] !== 1) { if (x[0] !== 1) {

View File

@ -6,6 +6,7 @@ info: >
The arguments are prepended to the start of the array, such that The arguments are prepended to the start of the array, such that
their order within the array is the same as the order in which they appear in their order within the array is the same as the order in which they appear in
the argument list the argument list
esid: sec-array.prototype.unshift
es5id: 15.4.4.13_A1_T2 es5id: 15.4.4.13_A1_T2
description: Checking case when unsift is given many arguments description: Checking case when unsift is given many arguments
---*/ ---*/
@ -21,7 +22,7 @@ x[0] = 0;
var unshift = x.unshift(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); var unshift = x.unshift(true, Number.POSITIVE_INFINITY, "NaN", "1", -1);
if (unshift !== 6) { if (unshift !== 6) {
$ERROR('#2: x = []; x[0] = 0; x.unshift(true, Number.POSITIVE_INFINITY, "NaN", "1", -1) === 6. Actual: ' + (unshift)); $ERROR('#2: x = []; x[0] = 0; x.unshift(true, Number.POSITIVE_INFINITY, "NaN", "1", -1) === 6. Actual: ' + (unshift));
} }
//CHECK#3 //CHECK#3
if (x[5] !== 0) { if (x[5] !== 0) {
@ -36,12 +37,12 @@ if (x[0] !== true) {
//CHECK#5 //CHECK#5
if (x[1] !== Number.POSITIVE_INFINITY) { if (x[1] !== Number.POSITIVE_INFINITY) {
$ERROR('#5: x = []; x[0] = 0; x.unshift(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[1] === Number.POSITIVE_INFINITY. Actual: ' + (x[1])); $ERROR('#5: x = []; x[0] = 0; x.unshift(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[1] === Number.POSITIVE_INFINITY. Actual: ' + (x[1]));
} }
//CHECK#6 //CHECK#6
if (x[2] !== "NaN") { if (x[2] !== "NaN") {
$ERROR('#6: x = []; x[0] = 0; x.unshift(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[2] === "NaN". Actual: ' + (x[2])); $ERROR('#6: x = []; x[0] = 0; x.unshift(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[2] === "NaN". Actual: ' + (x[2]));
} }
//CHECK#7 //CHECK#7
if (x[3] !== "1") { if (x[3] !== "1") {

View File

@ -5,6 +5,7 @@
info: > info: >
The unshift function is intentionally generic. The unshift 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.unshift
es5id: 15.4.4.13_A2_T1 es5id: 15.4.4.13_A2_T1
description: > description: >
The arguments are prepended to the start of the array, such that The arguments are prepended to the start of the array, such that
@ -19,7 +20,7 @@ if (obj.length !== undefined) {
$ERROR('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length)); $ERROR('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length));
} else { } else {
//CHECK#1 //CHECK#1
var unshift = obj.unshift(-1); var unshift = obj.unshift(-1);
if (unshift !== 1) { if (unshift !== 1) {
$ERROR('#1: var obj = {}; obj.unshift = Array.prototype.unshift; obj.unshift(-1) === 1. Actual: ' + (unshift)); $ERROR('#1: var obj = {}; obj.unshift = Array.prototype.unshift; obj.unshift(-1) === 1. Actual: ' + (unshift));
} }
@ -31,14 +32,14 @@ if (obj.length !== undefined) {
if (obj["0"] !== -1) { if (obj["0"] !== -1) {
$ERROR('#3: var obj = {}; obj.unshift = Array.prototype.unshift; obj.unshift(-1); obj["0"] === -1. Actual: ' + (obj["0"])); $ERROR('#3: var obj = {}; obj.unshift = Array.prototype.unshift; obj.unshift(-1); obj["0"] === -1. Actual: ' + (obj["0"]));
} }
} }
//CHECK#4 //CHECK#4
obj.length = undefined; obj.length = undefined;
var unshift = obj.unshift(-4); var unshift = obj.unshift(-4);
if (unshift !== 1) { if (unshift !== 1) {
$ERROR('#4: var obj = {}; obj.length = undefined; obj.unshift = Array.prototype.unshift; obj.unshift(-4) === 1. Actual: ' + (unshift)); $ERROR('#4: var obj = {}; obj.length = undefined; obj.unshift = Array.prototype.unshift; obj.unshift(-4) === 1. Actual: ' + (unshift));
} }
//CHECK#5 //CHECK#5
if (obj.length !== 1) { if (obj.length !== 1) {
@ -55,7 +56,7 @@ obj.length = null
var unshift = obj.unshift(-7); var unshift = obj.unshift(-7);
if (unshift !== 1) { if (unshift !== 1) {
$ERROR('#7: var obj = {}; obj.length = null; obj.unshift = Array.prototype.unshift; obj.unshift(-7) === 1. Actual: ' + (unshift)); $ERROR('#7: var obj = {}; obj.length = null; obj.unshift = Array.prototype.unshift; obj.unshift(-7) === 1. Actual: ' + (unshift));
} }
//CHECK#8 //CHECK#8
if (obj.length !== 1) { if (obj.length !== 1) {

View File

@ -5,6 +5,7 @@
info: > info: >
The unshift function is intentionally generic. The unshift 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.unshift
es5id: 15.4.4.13_A2_T2 es5id: 15.4.4.13_A2_T2
description: > description: >
The arguments are prepended to the start of the array, such that The arguments are prepended to the start of the array, such that
@ -59,7 +60,7 @@ if (unshift !== 1) {
//CHECK#11 //CHECK#11
if (obj.length !== 1) { if (obj.length !== 1) {
$ERROR('#11: var obj = {}; obj.length = 0.5; obj.unshift = Array.prototype.unshift; obj.unshift(-10); obj.length === 1. Actual: ' + (obj.length)); $ERROR('#11: var obj = {}; obj.length = 0.5; obj.unshift = Array.prototype.unshift; obj.unshift(-10); obj.length === 1. Actual: ' + (obj.length));
} }
//CHECK#12 //CHECK#12
if (obj["0"] !== -10) { if (obj["0"] !== -10) {
@ -76,7 +77,7 @@ if (unshift !== 2) {
//CHECK#14 //CHECK#14
if (obj.length !== 2) { if (obj.length !== 2) {
$ERROR('#14: var obj = {}; obj.length = 1.5; obj.unshift = Array.prototype.unshift; obj.unshift(-13); obj.length === 2. Actual: ' + (obj.length)); $ERROR('#14: var obj = {}; obj.length = 1.5; obj.unshift = Array.prototype.unshift; obj.unshift(-13); obj.length === 2. Actual: ' + (obj.length));
} }
//CHECK#15 //CHECK#15
if (obj["0"] !== -13) { if (obj["0"] !== -13) {

View File

@ -5,6 +5,7 @@
info: > info: >
The unshift function is intentionally generic. The unshift 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.unshift
es5id: 15.4.4.13_A2_T3 es5id: 15.4.4.13_A2_T3
description: > description: >
Operator use ToNumber from length. If Type(value) is Object, Operator use ToNumber from length. If Type(value) is Object,
@ -26,7 +27,7 @@ obj.length = {valueOf: function() {return 3}, toString: function() {return 1}};
var unshift = obj.unshift(); var unshift = obj.unshift();
if (unshift !== 3) { if (unshift !== 3) {
$ERROR('#0: obj.length = {valueOf: function() {return 3}, toString: function() {return 1}} obj.unshift() === 3. Actual: ' + (unshift)); $ERROR('#0: obj.length = {valueOf: function() {return 3}, toString: function() {return 1}} obj.unshift() === 3. Actual: ' + (unshift));
} }
//CHECK#3 //CHECK#3
obj.length = {valueOf: function() {return 3}, toString: function() {return {}}}; obj.length = {valueOf: function() {return 3}, toString: function() {return {}}};
@ -36,9 +37,9 @@ if (unshift !== 3) {
} }
//CHECK#4 //CHECK#4
try { try {
obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}};
var unshift = obj.unshift(); var unshift = obj.unshift();
if (unshift !== 3) { if (unshift !== 3) {
$ERROR('#4.1: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.unshift() === ",". Actual: ' + (unshift)); $ERROR('#4.1: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.unshift() === ",". Actual: ' + (unshift));
} }
@ -53,40 +54,40 @@ catch (e) {
//CHECK#5 //CHECK#5
obj.length = {toString: function() {return 1}}; obj.length = {toString: function() {return 1}};
var unshift = obj.unshift(); var unshift = obj.unshift();
if (unshift !== 1) { if (unshift !== 1) {
$ERROR('#5: obj.length = {toString: function() {return 1}} obj.unshift() === 1. Actual: ' + (unshift)); $ERROR('#5: obj.length = {toString: function() {return 1}} obj.unshift() === 1. Actual: ' + (unshift));
} }
//CHECK#6 //CHECK#6
obj.length = {valueOf: function() {return {}}, toString: function() {return 1}} obj.length = {valueOf: function() {return {}}, toString: function() {return 1}}
var unshift = obj.unshift(); var unshift = obj.unshift();
if (unshift !== 1) { if (unshift !== 1) {
$ERROR('#6: obj.length = {valueOf: function() {return {}}, toString: function() {return 1}} obj.unshift() === 1. Actual: ' + (unshift)); $ERROR('#6: obj.length = {valueOf: function() {return {}}, toString: function() {return 1}} obj.unshift() === 1. Actual: ' + (unshift));
} }
//CHECK#7 //CHECK#7
try { try {
obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}};
var unshift = obj.unshift(); var unshift = obj.unshift();
$ERROR('#7.1: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; obj.unshift() throw "error". Actual: ' + (unshift)); $ERROR('#7.1: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; obj.unshift() throw "error". Actual: ' + (unshift));
} }
catch (e) { catch (e) {
if (e !== "error") { if (e !== "error") {
$ERROR('#7.2: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; obj.unshift() throw "error". Actual: ' + (e)); $ERROR('#7.2: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; obj.unshift() throw "error". Actual: ' + (e));
} }
} }
//CHECK#8 //CHECK#8
try { try {
obj.length = {valueOf: function() {return {}}, toString: function() {return {}}}; obj.length = {valueOf: function() {return {}}, toString: function() {return {}}};
var unshift = obj.unshift(); var unshift = obj.unshift();
$ERROR('#8.1: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.unshift() throw TypeError. Actual: ' + (unshift)); $ERROR('#8.1: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.unshift() throw TypeError. Actual: ' + (unshift));
} }
catch (e) { catch (e) {
if ((e instanceof TypeError) !== true) { if ((e instanceof TypeError) !== true) {
$ERROR('#8.2: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.unshift() throw TypeError. Actual: ' + (e)); $ERROR('#8.2: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.unshift() throw TypeError. Actual: ' + (e));
} }
} }

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.unshift
es5id: 15.4.4.13_A3_T2 es5id: 15.4.4.13_A3_T2
description: length = -4294967295 description: length = -4294967295
---*/ ---*/
@ -31,7 +32,7 @@ if (obj[0] !== "x") {
//CHECK#4 //CHECK#4
if (obj[1] !== "y") { if (obj[1] !== "y") {
$ERROR('#4: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z"); obj[1] === "y". Actual: ' + (obj[1])); $ERROR('#4: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z"); obj[1] === "y". Actual: ' + (obj[1]));
} }
//CHECK#5 //CHECK#5
if (obj[2] !== "z") { if (obj[2] !== "z") {

View File

@ -3,6 +3,7 @@
/*--- /*---
info: "[[Get]], [[Delete]] from not an inherited property" info: "[[Get]], [[Delete]] from not an inherited property"
esid: sec-array.prototype.unshift
es5id: 15.4.4.13_A4_T1 es5id: 15.4.4.13_A4_T1
description: > description: >
[[Prototype]] of Array instance is Array.prototype, [[Prototype] [[Prototype]] of Array instance is Array.prototype, [[Prototype]
@ -15,25 +16,25 @@ x.length = 1;
//CHECK#1 //CHECK#1
var unshift = x.unshift(0); var unshift = x.unshift(0);
if (unshift !== 2) { if (unshift !== 2) {
$ERROR('#1: Array.prototype[0] = -1; x = [1]; x.length = 1; x.unshift(0) === 2. Actual: ' + (unshift)); $ERROR('#1: Array.prototype[0] = -1; x = [1]; x.length = 1; x.unshift(0) === 2. Actual: ' + (unshift));
} }
//CHECK#2 //CHECK#2
if (x[0] !== 0) { if (x[0] !== 0) {
$ERROR('#2: Array.prototype[0] = -1; x = [1]; x.length = 1; x.unshift(0); x[0] === 0. Actual: ' + (x[0])); $ERROR('#2: Array.prototype[0] = -1; x = [1]; x.length = 1; x.unshift(0); x[0] === 0. Actual: ' + (x[0]));
} }
//CHECK#3 //CHECK#3
if (x[1] !== 1) { if (x[1] !== 1) {
$ERROR('#3: Array.prototype[0] = -1; x = [1]; x.length = 1; x.unshift(0); x[1] === 1. Actual: ' + (x[1])); $ERROR('#3: Array.prototype[0] = -1; x = [1]; x.length = 1; x.unshift(0); x[1] === 1. Actual: ' + (x[1]));
} }
delete x[0]; delete x[0];
//CHECK#4 //CHECK#4
if (x[0] !== -1) { if (x[0] !== -1) {
$ERROR('#4: Array.prototype[0] = -1; x = [1]; x.length = 1; x.unshift(0); delete x[0]; x[0] === -1. Actual: ' + (x[0])); $ERROR('#4: Array.prototype[0] = -1; x = [1]; x.length = 1; x.unshift(0); delete x[0]; x[0] === -1. Actual: ' + (x[0]));
} }
Object.prototype[0] = -1; Object.prototype[0] = -1;
@ -43,34 +44,34 @@ x = {0:1};
//CHECK#5 //CHECK#5
var unshift = x.unshift(0); var unshift = x.unshift(0);
if (unshift !== 2) { if (unshift !== 2) {
$ERROR('#5: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {0:0}; x.unshift(0) === 2. Actual: ' + (unshift)); $ERROR('#5: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {0:0}; x.unshift(0) === 2. Actual: ' + (unshift));
} }
//CHECK#6 //CHECK#6
if (x[0] !== 0) { if (x[0] !== 0) {
$ERROR('#6: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {0:0}; x.unshift(0); x[0] === 0. Actual: ' + (x[0])); $ERROR('#6: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {0:0}; x.unshift(0); x[0] === 0. Actual: ' + (x[0]));
} }
//CHECK#7 //CHECK#7
if (x[1] !== 1) { if (x[1] !== 1) {
$ERROR('#7: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {0:0}; x.unshift(0); x[1] === 1. Actual: ' + (x[1])); $ERROR('#7: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {0:0}; x.unshift(0); x[1] === 1. Actual: ' + (x[1]));
} }
delete x[0]; delete x[0];
//CHECK#8 //CHECK#8
if (x[0] !== -1) { if (x[0] !== -1) {
$ERROR('#8: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {0:0}; x.unshift(0); delete x[0]; x[0] === -1. Actual: ' + (x[0])); $ERROR('#8: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {0:0}; x.unshift(0); delete x[0]; x[0] === -1. Actual: ' + (x[0]));
} }
//CHECK#9 //CHECK#9
if (x.length !== 2) { if (x.length !== 2) {
$ERROR('#9: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {0:0}; x.unshift(0); x.length === 1. Actual: ' + (x.length)); $ERROR('#9: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {0:0}; x.unshift(0); x.length === 1. Actual: ' + (x.length));
} }
//CHECK#10 //CHECK#10
delete x.length; delete x.length;
if (x.length !== 1) { if (x.length !== 1) {
$ERROR('#10: Object.prototype[1] = -1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {0:0}; x.unshift(0); delete x; x.length === 1. Actual: ' + (x.length)); $ERROR('#10: Object.prototype[1] = -1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {0:0}; x.unshift(0); delete x; x.length === 1. Actual: ' + (x.length));
} }

View File

@ -3,6 +3,7 @@
/*--- /*---
info: "[[Get]], [[Delete]] from not an inherited property" info: "[[Get]], [[Delete]] from not an inherited property"
esid: sec-array.prototype.unshift
es5id: 15.4.4.13_A4_T2 es5id: 15.4.4.13_A4_T2
description: > description: >
[[Prototype]] of Array instance is Array.prototype, [[Prototype] [[Prototype]] of Array instance is Array.prototype, [[Prototype]
@ -15,25 +16,25 @@ x.length = 1;
//CHECK#1 //CHECK#1
var unshift = x.unshift(0); var unshift = x.unshift(0);
if (unshift !== 2) { if (unshift !== 2) {
$ERROR('#1: Array.prototype[0] = 1; x = []; x.length = 1; x.unshift(0) === 2. Actual: ' + (unshift)); $ERROR('#1: Array.prototype[0] = 1; x = []; x.length = 1; x.unshift(0) === 2. Actual: ' + (unshift));
} }
//CHECK#2 //CHECK#2
if (x[0] !== 0) { if (x[0] !== 0) {
$ERROR('#2: Array.prototype[0] = 1; x = []; x.length = 1; x.unshift(0); x[0] === 0. Actual: ' + (x[0])); $ERROR('#2: Array.prototype[0] = 1; x = []; x.length = 1; x.unshift(0); x[0] === 0. Actual: ' + (x[0]));
} }
//CHECK#3 //CHECK#3
if (x[1] !== 1) { if (x[1] !== 1) {
$ERROR('#3: Array.prototype[0] = 1; x = []; x.length = 1; x.unshift(0); x[1] === 1. Actual: ' + (x[1])); $ERROR('#3: Array.prototype[0] = 1; x = []; x.length = 1; x.unshift(0); x[1] === 1. Actual: ' + (x[1]));
} }
delete x[0]; delete x[0];
//CHECK#4 //CHECK#4
if (x[0] !== 1) { if (x[0] !== 1) {
$ERROR('#4: Array.prototype[0] = 1; x = [1]; x.length = 1; x.unshift(0); delete x[0]; x[0] === 1. Actual: ' + (x[0])); $ERROR('#4: Array.prototype[0] = 1; x = [1]; x.length = 1; x.unshift(0); delete x[0]; x[0] === 1. Actual: ' + (x[0]));
} }
Object.prototype[0] = 1; Object.prototype[0] = 1;
@ -43,34 +44,34 @@ x = {};
//CHECK#5 //CHECK#5
var unshift = x.unshift(0); var unshift = x.unshift(0);
if (unshift !== 2) { if (unshift !== 2) {
$ERROR('#5: Object.prototype[0] = 1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {}; x.unshift(0) === 2. Actual: ' + (unshift)); $ERROR('#5: Object.prototype[0] = 1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {}; x.unshift(0) === 2. Actual: ' + (unshift));
} }
//CHECK#6 //CHECK#6
if (x[0] !== 0) { if (x[0] !== 0) {
$ERROR('#6: Object.prototype[0] = 1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {}; x.unshift(0); x[0] === 0. Actual: ' + (x[0])); $ERROR('#6: Object.prototype[0] = 1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {}; x.unshift(0); x[0] === 0. Actual: ' + (x[0]));
} }
//CHECK#7 //CHECK#7
if (x[1] !== 1) { if (x[1] !== 1) {
$ERROR('#7: Object.prototype[0] = 1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {}; x.unshift(0); x[1] === 1. Actual: ' + (x[1])); $ERROR('#7: Object.prototype[0] = 1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {}; x.unshift(0); x[1] === 1. Actual: ' + (x[1]));
} }
delete x[0]; delete x[0];
//CHECK#8 //CHECK#8
if (x[0] !== 1) { if (x[0] !== 1) {
$ERROR('#8: Object.prototype[0] = 1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {}; x.unshift(0); delete x[0]; x[0] === 1. Actual: ' + (x[0])); $ERROR('#8: Object.prototype[0] = 1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {}; x.unshift(0); delete x[0]; x[0] === 1. Actual: ' + (x[0]));
} }
//CHECK#9 //CHECK#9
if (x.length !== 2) { if (x.length !== 2) {
$ERROR('#9: Object.prototype[0] = 1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {}; x.unshift(0); x.length === 1. Actual: ' + (x.length)); $ERROR('#9: Object.prototype[0] = 1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {}; x.unshift(0); x.length === 1. Actual: ' + (x.length));
} }
//CHECK#10 //CHECK#10
delete x.length; delete x.length;
if (x.length !== 1) { if (x.length !== 1) {
$ERROR('#10: Object.prototype[1] = 1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {}; x.unshift(0); delete x; x.length === 1. Actual: ' + (x.length)); $ERROR('#10: Object.prototype[1] = 1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {}; x.unshift(0); delete x; x.length === 1. Actual: ' + (x.length));
} }

View File

@ -3,6 +3,7 @@
/*--- /*---
info: The unshift property of Array can't be used as constructor info: The unshift property of Array can't be used as constructor
esid: sec-array.prototype.unshift
es5id: 15.4.4.13_A5.7 es5id: 15.4.4.13_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.unshift
es6id: 22.1.3.28 es6id: 22.1.3.28
description: > description: >
Array.prototype.unshift.name is "unshift". Array.prototype.unshift.name is "unshift".