add esid to frontmatter for Array/length

This commit is contained in:
deathbearbrown 2017-06-28 15:16:06 -07:00 committed by Rick Waldron
parent 2f4d0be4b8
commit 1341088b36
24 changed files with 115 additions and 91 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-properties-of-array-instances-length
es5id: 15.4.5.1-3.d-1 es5id: 15.4.5.1-3.d-1
description: > description: >
Throw RangeError if attempt to set array length property to Throw RangeError if attempt to set array length property to

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-properties-of-array-instances-length
es5id: 15.4.5.1-3.d-2 es5id: 15.4.5.1-3.d-2
description: > description: >
Throw RangeError if attempt to set array length property to Throw RangeError if attempt to set array length property to

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-properties-of-array-instances-length
es5id: 15.4.5.1-3.d-3 es5id: 15.4.5.1-3.d-3
description: Set array length property to max value 4294967295 (2**32-1,) description: Set array length property to max value 4294967295 (2**32-1,)
---*/ ---*/

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-len
info: > info: >
The [[Prototype]] property of the newly constructed object The [[Prototype]] property of the newly constructed object
is set to the original Array prototype object, the one that is set to the original Array prototype object, the one that
@ -14,7 +15,7 @@ description: >
//CHECK#1 //CHECK#1
Array.prototype.myproperty = 1; Array.prototype.myproperty = 1;
var x = new Array(0); var x = new Array(0);
if (x.myproperty !== 1) { if (x.myproperty !== 1) {
$ERROR('#1: Array.prototype.myproperty = 1; var x = new Array(0); x.myproperty === 1. Actual: ' + (x.myproperty)); $ERROR('#1: Array.prototype.myproperty = 1; var x = new Array(0); x.myproperty === 1. Actual: ' + (x.myproperty));
} }

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-len
info: > info: >
The [[Prototype]] property of the newly constructed object The [[Prototype]] property of the newly constructed object
is set to the original Array prototype object, the one that is set to the original Array prototype object, the one that
@ -12,7 +13,7 @@ description: Array.prototype.toString = Object.prototype.toString
//CHECK#1 //CHECK#1
Array.prototype.toString = Object.prototype.toString; Array.prototype.toString = Object.prototype.toString;
var x = new Array(0); var x = new Array(0);
if (x.toString() !== "[object " + "Array" + "]") { if (x.toString() !== "[object " + "Array" + "]") {
$ERROR('#1: Array.prototype.toString = Object.prototype.toString; var x = new Array(0); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString())); $ERROR('#1: Array.prototype.toString = Object.prototype.toString; var x = new Array(0); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString()));
} }

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-len
info: > info: >
The [[Prototype]] property of the newly constructed object The [[Prototype]] property of the newly constructed object
is set to the original Array prototype object, the one that is set to the original Array prototype object, the one that

View File

@ -2,13 +2,14 @@
// 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-len
info: The [[Class]] property of the newly constructed object is set to "Array" info: The [[Class]] property of the newly constructed object is set to "Array"
es5id: 15.4.2.2_A1.2_T1 es5id: 15.4.2.2_A1.2_T1
description: Checking use Object.prototype.toString description: Checking use Object.prototype.toString
---*/ ---*/
//CHECK#1 //CHECK#1
var x = new Array(0); var x = new Array(0);
x.getClass = Object.prototype.toString; x.getClass = Object.prototype.toString;
if (x.getClass() !== "[object " + "Array" + "]") { if (x.getClass() !== "[object " + "Array" + "]") {
$ERROR('#1: var x = new Array(0); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass())); $ERROR('#1: var x = new Array(0); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass()));

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-len
info: > info: >
If the argument len is a Number and ToUint32(len) is equal to len, If the argument len is a Number and ToUint32(len) is equal to len,
then the length property of the newly constructed object is set to ToUint32(len) then the length property of the newly constructed object is set to ToUint32(len)
@ -10,19 +11,19 @@ description: Array constructor is given one argument
---*/ ---*/
//CHECK#1 //CHECK#1
var x = new Array(0); var x = new Array(0);
if (x.length !== 0) { if (x.length !== 0) {
$ERROR('#1: var x = new Array(0); x.length === 0. Actual: ' + (x.length)); $ERROR('#1: var x = new Array(0); x.length === 0. Actual: ' + (x.length));
} }
//CHECK#2 //CHECK#2
var x = new Array(1); var x = new Array(1);
if (x.length !== 1) { if (x.length !== 1) {
$ERROR('#2: var x = new Array(1); x.length === 1. Actual: ' + (x.length)); $ERROR('#2: var x = new Array(1); x.length === 1. Actual: ' + (x.length));
} }
//CHECK#3 //CHECK#3
var x = new Array(4294967295); var x = new Array(4294967295);
if (x.length !== 4294967295) { if (x.length !== 4294967295) {
$ERROR('#3: var x = new Array(4294967295); x.length === 4294967295. Actual: ' + (x.length)); $ERROR('#3: var x = new Array(4294967295); x.length === 4294967295. Actual: ' + (x.length));
} }

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-len
info: > info: >
If the argument len is a Number and ToUint32(len) is not equal to len, If the argument len is a Number and ToUint32(len) is not equal to len,
a RangeError exception is thrown a RangeError exception is thrown
@ -10,8 +11,8 @@ description: Use try statement. len = -1, 4294967296, 4294967297
---*/ ---*/
//CHECK#1 //CHECK#1
try { try {
new Array(-1); new Array(-1);
$ERROR('#1.1: new Array(-1) throw RangeError. Actual: ' + (new Array(-1))); $ERROR('#1.1: new Array(-1) throw RangeError. Actual: ' + (new Array(-1)));
} catch(e) { } catch(e) {
if ((e instanceof RangeError) !== true) { if ((e instanceof RangeError) !== true) {
@ -20,8 +21,8 @@ try {
} }
//CHECK#2 //CHECK#2
try { try {
new Array(4294967296); new Array(4294967296);
$ERROR('#2.1: new Array(4294967296) throw RangeError. Actual: ' + (new Array(4294967296))); $ERROR('#2.1: new Array(4294967296) throw RangeError. Actual: ' + (new Array(4294967296)));
} catch(e) { } catch(e) {
if ((e instanceof RangeError) !== true) { if ((e instanceof RangeError) !== true) {
@ -30,8 +31,8 @@ try {
} }
//CHECK#3 //CHECK#3
try { try {
new Array(4294967297); new Array(4294967297);
$ERROR('#3.1: new Array(4294967297) throw RangeError. Actual: ' + (new Array(4294967297))); $ERROR('#3.1: new Array(4294967297) throw RangeError. Actual: ' + (new Array(4294967297)));
} catch(e) { } catch(e) {
if ((e instanceof RangeError) !== true) { if ((e instanceof RangeError) !== true) {

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-len
info: > info: >
If the argument len is a Number and ToUint32(len) is not equal to len, If the argument len is a Number and ToUint32(len) is not equal to len,
a RangeError exception is thrown a RangeError exception is thrown
@ -10,8 +11,8 @@ description: Use try statement. len = NaN, +/-Infinity
---*/ ---*/
//CHECK#1 //CHECK#1
try { try {
new Array(NaN); new Array(NaN);
$ERROR('#1.1: new Array(NaN) throw RangeError. Actual: ' + (new Array(NaN))); $ERROR('#1.1: new Array(NaN) throw RangeError. Actual: ' + (new Array(NaN)));
} catch(e) { } catch(e) {
if ((e instanceof RangeError) !== true) { if ((e instanceof RangeError) !== true) {
@ -20,8 +21,8 @@ try {
} }
//CHECK#2 //CHECK#2
try { try {
new Array(Number.POSITIVE_INFINITY); new Array(Number.POSITIVE_INFINITY);
$ERROR('#2.1: new Array(Number.POSITIVE_INFINITY) throw RangeError. Actual: ' + (new Array(Number.POSITIVE_INFINITY))); $ERROR('#2.1: new Array(Number.POSITIVE_INFINITY) throw RangeError. Actual: ' + (new Array(Number.POSITIVE_INFINITY)));
} catch(e) { } catch(e) {
if ((e instanceof RangeError) !== true) { if ((e instanceof RangeError) !== true) {
@ -30,8 +31,8 @@ try {
} }
//CHECK#3 //CHECK#3
try { try {
new Array(Number.NEGATIVE_INFINITY); new Array(Number.NEGATIVE_INFINITY);
$ERROR('#3.1: new Array(Number.NEGATIVE_INFINITY) throw RangeError. Actual: ' + (new Array(Number.NEGATIVE_INFINITY))); $ERROR('#3.1: new Array(Number.NEGATIVE_INFINITY) throw RangeError. Actual: ' + (new Array(Number.NEGATIVE_INFINITY)));
} catch(e) { } catch(e) {
if ((e instanceof RangeError) !== true) { if ((e instanceof RangeError) !== true) {

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-len
info: > info: >
If the argument len is a Number and ToUint32(len) is not equal to len, If the argument len is a Number and ToUint32(len) is not equal to len,
a RangeError exception is thrown a RangeError exception is thrown
@ -10,8 +11,8 @@ description: Use try statement. len = 1.5, Number.MAX_VALUE, Number.MIN_VALUE
---*/ ---*/
//CHECK#1 //CHECK#1
try { try {
new Array(1.5); new Array(1.5);
$ERROR('#1.1: new Array(1.5) throw RangeError. Actual: ' + (new Array(1.5))); $ERROR('#1.1: new Array(1.5) throw RangeError. Actual: ' + (new Array(1.5)));
} catch(e) { } catch(e) {
if ((e instanceof RangeError) !== true) { if ((e instanceof RangeError) !== true) {
@ -20,8 +21,8 @@ try {
} }
//CHECK#2 //CHECK#2
try { try {
new Array(Number.MAX_VALUE); new Array(Number.MAX_VALUE);
$ERROR('#2.1: new Array(Number.MAX_VALUE) throw RangeError. Actual: ' + (new Array(Number.MAX_VALUE))); $ERROR('#2.1: new Array(Number.MAX_VALUE) throw RangeError. Actual: ' + (new Array(Number.MAX_VALUE)));
} catch(e) { } catch(e) {
if ((e instanceof RangeError) !== true) { if ((e instanceof RangeError) !== true) {
@ -30,8 +31,8 @@ try {
} }
//CHECK#3 //CHECK#3
try { try {
new Array(Number.MIN_VALUE); new Array(Number.MIN_VALUE);
$ERROR('#3.1: new Array(Number.MIN_VALUE) throw RangeError. Actual: ' + (new Array(Number.MIN_VALUE))); $ERROR('#3.1: new Array(Number.MIN_VALUE) throw RangeError. Actual: ' + (new Array(Number.MIN_VALUE)));
} catch(e) { } catch(e) {
if ((e instanceof RangeError) !== true) { if ((e instanceof RangeError) !== true) {

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-len
info: > info: >
If the argument len is not a Number, then the length property of If the argument len is not a Number, then the length property of
the newly constructed object is set to 1 and the 0 property of the newly constructed object is set to 1 and the 0 property of
@ -12,7 +13,7 @@ description: Checking for null and undefined
var x = new Array(null); var x = new Array(null);
//CHECK#1 //CHECK#1
if (x.length !== 1) { if (x.length !== 1) {
$ERROR('#1: var x = new Array(null); x.length === 1. Actual: ' + (x.length)); $ERROR('#1: var x = new Array(null); x.length === 1. Actual: ' + (x.length));
} }
@ -24,7 +25,7 @@ if (x[0] !== null) {
var x = new Array(undefined); var x = new Array(undefined);
//CHECK#3 //CHECK#3
if (x.length !== 1) { if (x.length !== 1) {
$ERROR('#3: var x = new Array(undefined); x.length === 1. Actual: ' + (x.length)); $ERROR('#3: var x = new Array(undefined); x.length === 1. Actual: ' + (x.length));
} }

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-len
info: > info: >
If the argument len is not a Number, then the length property of If the argument len is not a Number, then the length property of
the newly constructed object is set to 1 and the 0 property of the newly constructed object is set to 1 and the 0 property of
@ -12,7 +13,7 @@ description: Checking for boolean primitive and Boolean object
var x = new Array(true); var x = new Array(true);
//CHECK#1 //CHECK#1
if (x.length !== 1) { if (x.length !== 1) {
$ERROR('#1: var x = new Array(true); x.length === 1. Actual: ' + (x.length)); $ERROR('#1: var x = new Array(true); x.length === 1. Actual: ' + (x.length));
} }
@ -25,7 +26,7 @@ if (x[0] !== true) {
var obj = new Boolean(false); var obj = new Boolean(false);
var x = new Array(obj); var x = new Array(obj);
//CHECK#3 //CHECK#3
if (x.length !== 1) { if (x.length !== 1) {
$ERROR('#3: var obj = new Boolean(false); var x = new Array(obj); x.length === 1. Actual: ' + (x.length)); $ERROR('#3: var obj = new Boolean(false); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
} }

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-len
info: > info: >
If the argument len is not a Number, then the length property of If the argument len is not a Number, then the length property of
the newly constructed object is set to 1 and the 0 property of the newly constructed object is set to 1 and the 0 property of
@ -12,7 +13,7 @@ description: Checking for boolean primitive and Boolean object
var x = new Array("1"); var x = new Array("1");
//CHECK#1 //CHECK#1
if (x.length !== 1) { if (x.length !== 1) {
$ERROR('#1: var x = new Array("1"); x.length === 1. Actual: ' + (x.length)); $ERROR('#1: var x = new Array("1"); x.length === 1. Actual: ' + (x.length));
} }
@ -25,7 +26,7 @@ if (x[0] !== "1") {
var obj = new String("0"); var obj = new String("0");
var x = new Array(obj); var x = new Array(obj);
//CHECK#3 //CHECK#3
if (x.length !== 1) { if (x.length !== 1) {
$ERROR('#3: var obj = new String("0"); var x = new Array(obj); x.length === 1. Actual: ' + (x.length)); $ERROR('#3: var obj = new String("0"); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
} }

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-len
info: > info: >
If the argument len is not a Number, then the length property of If the argument len is not a Number, then the length property of
the newly constructed object is set to 1 and the 0 property of the newly constructed object is set to 1 and the 0 property of
@ -13,7 +14,7 @@ description: Checking for Number object
var obj = new Number(0); var obj = new Number(0);
var x = new Array(obj); var x = new Array(obj);
//CHECK#1 //CHECK#1
if (x.length !== 1) { if (x.length !== 1) {
$ERROR('#1: var obj = new Number(0); var x = new Array(obj); x.length === 1. Actual: ' + (x.length)); $ERROR('#1: var obj = new Number(0); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
} }
@ -26,7 +27,7 @@ if (x[0] !== obj) {
var obj = new Number(1); var obj = new Number(1);
var x = new Array(obj); var x = new Array(obj);
//CHECK#3 //CHECK#3
if (x.length !== 1) { if (x.length !== 1) {
$ERROR('#3: var obj = new Number(1); var x = new Array(obj); x.length === 1. Actual: ' + (x.length)); $ERROR('#3: var obj = new Number(1); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
} }
@ -39,7 +40,7 @@ if (x[0] !== obj) {
var obj = new Number(4294967295); var obj = new Number(4294967295);
var x = new Array(obj); var x = new Array(obj);
//CHECK#5 //CHECK#5
if (x.length !== 1) { if (x.length !== 1) {
$ERROR('#5: var obj = new Number(4294967295); var x = new Array(obj); x.length === 1. Actual: ' + (x.length)); $ERROR('#5: var obj = new Number(4294967295); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
} }

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-len
info: > info: >
If the argument len is not a Number, then the length property of If the argument len is not a Number, then the length property of
the newly constructed object is set to 1 and the 0 property of the newly constructed object is set to 1 and the 0 property of
@ -13,7 +14,7 @@ description: Checking for Number object
var obj = new Number(-1); var obj = new Number(-1);
var x = new Array(obj); var x = new Array(obj);
//CHECK#1 //CHECK#1
if (x.length !== 1) { if (x.length !== 1) {
$ERROR('#1: var obj = new Number(-1); var x = new Array(obj); x.length === 1. Actual: ' + (x.length)); $ERROR('#1: var obj = new Number(-1); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
} }
@ -26,7 +27,7 @@ if (x[0] !== obj) {
var obj = new Number(4294967296); var obj = new Number(4294967296);
var x = new Array(obj); var x = new Array(obj);
//CHECK#3 //CHECK#3
if (x.length !== 1) { if (x.length !== 1) {
$ERROR('#3: var obj = new Number(4294967296); var x = new Array(obj); x.length === 1. Actual: ' + (x.length)); $ERROR('#3: var obj = new Number(4294967296); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
} }
@ -39,7 +40,7 @@ if (x[0] !== obj) {
var obj = new Number(4294967297); var obj = new Number(4294967297);
var x = new Array(obj); var x = new Array(obj);
//CHECK#5 //CHECK#5
if (x.length !== 1) { if (x.length !== 1) {
$ERROR('#5: var obj = new Number(4294967297); var x = new Array(obj); x.length === 1. Actual: ' + (x.length)); $ERROR('#5: var obj = new Number(4294967297); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
} }

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-properties-of-the-array-prototype-object
info: Array prototype object has a length property info: Array prototype object has a length property
es5id: 15.4.4_A1.3_T1 es5id: 15.4.4_A1.3_T1
description: Array.prototype.length === 0 description: Array.prototype.length === 0

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-exotic-objects-defineownproperty-p-desc
info: If ToUint32(length) !== ToNumber(length), throw RangeError info: If ToUint32(length) !== ToNumber(length), throw RangeError
es5id: 15.4.5.1_A1.1_T1 es5id: 15.4.5.1_A1.1_T1
description: length in [4294967296, -1, 1.5] description: length in [4294967296, -1, 1.5]
@ -12,10 +13,10 @@ try {
var x = []; var x = [];
x.length = 4294967296; x.length = 4294967296;
$ERROR('#1.1: x = []; x.length = 4294967296 throw RangeError. Actual: x.length === ' + (x.length)); $ERROR('#1.1: x = []; x.length = 4294967296 throw RangeError. Actual: x.length === ' + (x.length));
} catch(e) { } catch(e) {
if ((e instanceof RangeError) !== true) { if ((e instanceof RangeError) !== true) {
$ERROR('#1.2: x = []; x.length = 4294967296 throw RangeError. Actual: ' + (e)); $ERROR('#1.2: x = []; x.length = 4294967296 throw RangeError. Actual: ' + (e));
} }
} }
//CHECK#2 //CHECK#2
@ -23,10 +24,10 @@ try {
x = []; x = [];
x.length = -1; x.length = -1;
$ERROR('#2.1: x = []; x.length = -1 throw RangeError. Actual: x.length === ' + (x.length)); $ERROR('#2.1: x = []; x.length = -1 throw RangeError. Actual: x.length === ' + (x.length));
} catch(e) { } catch(e) {
if ((e instanceof RangeError) !== true) { if ((e instanceof RangeError) !== true) {
$ERROR('#2.2: x = []; x.length = -1 throw RangeError. Actual: ' + (e)); $ERROR('#2.2: x = []; x.length = -1 throw RangeError. Actual: ' + (e));
} }
} }
//CHECK#3 //CHECK#3
@ -34,8 +35,8 @@ try {
x = []; x = [];
x.length = 1.5; x.length = 1.5;
$ERROR('#3.1: x = []; x.length = 1.5 throw RangeError. Actual: x.length === ' + (x.length)); $ERROR('#3.1: x = []; x.length = 1.5 throw RangeError. Actual: x.length === ' + (x.length));
} catch(e) { } catch(e) {
if ((e instanceof RangeError) !== true) { if ((e instanceof RangeError) !== true) {
$ERROR('#3.2: x = []; x.length = 1.5 throw RangeError. Actual: ' + (e)); $ERROR('#3.2: x = []; x.length = 1.5 throw RangeError. Actual: ' + (e));
} }
} }

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-exotic-objects-defineownproperty-p-desc
info: If ToUint32(length) !== ToNumber(length), throw RangeError info: If ToUint32(length) !== ToNumber(length), throw RangeError
es5id: 15.4.5.1_A1.1_T2 es5id: 15.4.5.1_A1.1_T2
description: length in [NaN, Infinity, -Infinity, undefined] description: length in [NaN, Infinity, -Infinity, undefined]
@ -12,10 +13,10 @@ try {
var x = []; var x = [];
x.length = NaN; x.length = NaN;
$ERROR('#1.1: x = []; x.length = NaN throw RangeError. Actual: x.length === ' + (x.length)); $ERROR('#1.1: x = []; x.length = NaN throw RangeError. Actual: x.length === ' + (x.length));
} catch(e) { } catch(e) {
if ((e instanceof RangeError) !== true) { if ((e instanceof RangeError) !== true) {
$ERROR('#1.2: x = []; x.length = NaN throw RangeError. Actual: ' + (e)); $ERROR('#1.2: x = []; x.length = NaN throw RangeError. Actual: ' + (e));
} }
} }
//CHECK#2 //CHECK#2
@ -23,10 +24,10 @@ try {
x = []; x = [];
x.length = Number.POSITIVE_INFINITY; x.length = Number.POSITIVE_INFINITY;
$ERROR('#2.1: x = []; x.length = Number.POSITIVE_INFINITY throw RangeError. Actual: x.length === ' + (x.length)); $ERROR('#2.1: x = []; x.length = Number.POSITIVE_INFINITY throw RangeError. Actual: x.length === ' + (x.length));
} catch(e) { } catch(e) {
if ((e instanceof RangeError) !== true) { if ((e instanceof RangeError) !== true) {
$ERROR('#2.2: x = []; x.length = Number.POSITIVE_INFINITY throw RangeError. Actual: ' + (e)); $ERROR('#2.2: x = []; x.length = Number.POSITIVE_INFINITY throw RangeError. Actual: ' + (e));
} }
} }
//CHECK#3 //CHECK#3
@ -34,10 +35,10 @@ try {
x = []; x = [];
x.length = Number.NEGATIVE_INFINITY; x.length = Number.NEGATIVE_INFINITY;
$ERROR('#3.1: x = []; x.length = Number.NEGATIVE_INFINITY throw RangeError. Actual: x.length === ' + (x.length)); $ERROR('#3.1: x = []; x.length = Number.NEGATIVE_INFINITY throw RangeError. Actual: x.length === ' + (x.length));
} catch(e) { } catch(e) {
if ((e instanceof RangeError) !== true) { if ((e instanceof RangeError) !== true) {
$ERROR('#3.2: x = []; x.length = Number.NEGATIVE_INFINITY throw RangeError. Actual: ' + (e)); $ERROR('#3.2: x = []; x.length = Number.NEGATIVE_INFINITY throw RangeError. Actual: ' + (e));
} }
} }
//CHECK#4 //CHECK#4
@ -45,8 +46,8 @@ try {
x = []; x = [];
x.length = undefined; x.length = undefined;
$ERROR('#4.1: x = []; x.length = undefined throw RangeError. Actual: x.length === ' + (x.length)); $ERROR('#4.1: x = []; x.length = undefined throw RangeError. Actual: x.length === ' + (x.length));
} catch(e) { } catch(e) {
if ((e instanceof RangeError) !== true) { if ((e instanceof RangeError) !== true) {
$ERROR('#4.2: x = []; x.length = undefined throw RangeError. Actual: ' + (e)); $ERROR('#4.2: x = []; x.length = undefined throw RangeError. Actual: ' + (e));
} }
} }

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-exotic-objects-defineownproperty-p-desc
info: > info: >
For every integer k that is less than the value of For every integer k that is less than the value of
the length property of A but not less than ToUint32(length), the length property of A but not less than ToUint32(length),
@ -14,17 +15,17 @@ description: Change length of array
//CHECK#1 //CHECK#1
var x = [0,,2,,4]; var x = [0,,2,,4];
x.length = 4; x.length = 4;
if (x[4] !== undefined) { if (x[4] !== undefined) {
$ERROR('#1: x = [0,,2,,4]; x.length = 4; x[4] === undefined. Actual: ' + (x[4])); $ERROR('#1: x = [0,,2,,4]; x.length = 4; x[4] === undefined. Actual: ' + (x[4]));
} }
//CHECK#2 //CHECK#2
x.length = 3; x.length = 3;
if (x[3] !== undefined) { if (x[3] !== undefined) {
$ERROR('#2: x = [0,,2,,4]; x.length = 4; x.length = 3; x[3] === undefined. Actual: ' + (x[3])); $ERROR('#2: x = [0,,2,,4]; x.length = 4; x.length = 3; x[3] === undefined. Actual: ' + (x[3]));
} }
//CHECK#3 //CHECK#3
if (x[2] !== 2) { if (x[2] !== 2) {
$ERROR('#3: x = [0,,2,,4]; x.length = 4; x.length = 3; x[2] === 2. Actual: ' + (x[2])); $ERROR('#3: x = [0,,2,,4]; x.length = 4; x.length = 3; x[2] === 2. Actual: ' + (x[2]));
} }

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-exotic-objects-defineownproperty-p-desc
info: > info: >
For every integer k that is less than the value of For every integer k that is less than the value of
the length property of A but not less than ToUint32(length), the length property of A but not less than ToUint32(length),
@ -15,12 +16,12 @@ description: Checking an inherited property
Array.prototype[2] = 2; Array.prototype[2] = 2;
var x = [0,1]; var x = [0,1];
x.length = 3; x.length = 3;
if (x.hasOwnProperty('2') !== false) { if (x.hasOwnProperty('2') !== false) {
$ERROR('#1: Array.prototype[2] = 2; x = [0,1]; x.length = 3; x.hasOwnProperty(\'2\') === false. Actual: ' + (x.hasOwnProperty('2'))); $ERROR('#1: Array.prototype[2] = 2; x = [0,1]; x.length = 3; x.hasOwnProperty(\'2\') === false. Actual: ' + (x.hasOwnProperty('2')));
} }
//CHECK#2 //CHECK#2
x.length = 2; x.length = 2;
if (x[2] !== 2) { if (x[2] !== 2) {
$ERROR('#2: Array.prototype[2] = 2; x = [0,1]; x.length = 3; x.length = 2; x[2] === 2. Actual: ' + (x[2])); $ERROR('#2: Array.prototype[2] = 2; x = [0,1]; x.length = 3; x.length = 2; x[2] === 2. Actual: ' + (x[2]));
} }

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-exotic-objects-defineownproperty-p-desc
info: Set the value of property length of A to Uint32(length) info: Set the value of property length of A to Uint32(length)
es5id: 15.4.5.1_A1.3_T1 es5id: 15.4.5.1_A1.3_T1
description: length is object or primitve description: length is object or primitve
@ -10,41 +11,41 @@ description: length is object or primitve
//CHECK#1 //CHECK#1
var x = []; var x = [];
x.length = true; x.length = true;
if (x.length !== 1) { if (x.length !== 1) {
$ERROR('#1: x = []; x.length = true; x.length === 1. Actual: ' + (x.length)); $ERROR('#1: x = []; x.length = true; x.length === 1. Actual: ' + (x.length));
} }
//CHECK#2 //CHECK#2
x = [0]; x = [0];
x.length = null; x.length = null;
if (x.length !== 0) { if (x.length !== 0) {
$ERROR('#2: x = [0]; x.length = null; x.length === 0. Actual: ' + (x.length)); $ERROR('#2: x = [0]; x.length = null; x.length === 0. Actual: ' + (x.length));
} }
//CHECK#3 //CHECK#3
x = [0]; x = [0];
x.length = new Boolean(false); x.length = new Boolean(false);
if (x.length !== 0) { if (x.length !== 0) {
$ERROR('#3: x = [0]; x.length = new Boolean(false); x.length === 0. Actual: ' + (x.length)); $ERROR('#3: x = [0]; x.length = new Boolean(false); x.length === 0. Actual: ' + (x.length));
} }
//CHECK#4 //CHECK#4
x = []; x = [];
x.length = new Number(1); x.length = new Number(1);
if (x.length !== 1) { if (x.length !== 1) {
$ERROR('#4: x = []; x.length = new Number(1); x.length === 1. Actual: ' + (x.length)); $ERROR('#4: x = []; x.length = new Number(1); x.length === 1. Actual: ' + (x.length));
} }
//CHECK#5 //CHECK#5
x = []; x = [];
x.length = "1"; x.length = "1";
if (x.length !== 1) { if (x.length !== 1) {
$ERROR('#5: x = []; x.length = "1"; x.length === 1. Actual: ' + (x.length)); $ERROR('#5: x = []; x.length = "1"; x.length === 1. Actual: ' + (x.length));
} }
//CHECK#6 //CHECK#6
x = []; x = [];
x.length = new String("1"); x.length = new String("1");
if (x.length !== 1) { if (x.length !== 1) {
$ERROR('#6: x = []; x.length = new String("1"); x.length === 1. Actual: ' + (x.length)); $ERROR('#6: x = []; x.length = new String("1"); x.length === 1. Actual: ' + (x.length));
} }

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-exotic-objects-defineownproperty-p-desc
info: Set the value of property length of A to Uint32(length) info: Set the value of property length of A to Uint32(length)
es5id: 15.4.5.1_A1.3_T2 es5id: 15.4.5.1_A1.3_T2
description: Uint32 use ToNumber and ToPrimitve description: Uint32 use ToNumber and ToPrimitve
@ -19,7 +20,7 @@ x = [];
x.length = {valueOf: function() {return 2}, toString: function() {return 1}}; x.length = {valueOf: function() {return 2}, toString: function() {return 1}};
if (x.length !== 2) { if (x.length !== 2) {
$ERROR('#0: x = []; x.length = {valueOf: function() {return 2}, toString: function() {return 1}}; x.length === 2. Actual: ' + (x.length)); $ERROR('#0: x = []; x.length = {valueOf: function() {return 2}, toString: function() {return 1}}; x.length === 2. Actual: ' + (x.length));
} }
//CHECK#3 //CHECK#3
x = []; x = [];
@ -29,9 +30,9 @@ if (x.length !== 2) {
} }
//CHECK#4 //CHECK#4
try { try {
x = []; x = [];
x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}}; x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}};
if (x.length !== 2) { if (x.length !== 2) {
$ERROR('#4.1: x = []; x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}}; x.length === ",". Actual: ' + (x.length)); $ERROR('#4.1: x = []; x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}}; x.length === ",". Actual: ' + (x.length));
} }
@ -61,14 +62,14 @@ if (x.length !== 1) {
//CHECK#7 //CHECK#7
try { try {
x = []; x = [];
x.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x.length = {valueOf: function() {throw "error"}, toString: function() {return 1}};
x.length; x.length;
$ERROR('#7.1: x = []; x.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x.length throw "error". Actual: ' + (x.length)); $ERROR('#7.1: x = []; x.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x.length throw "error". Actual: ' + (x.length));
} }
catch (e) { catch (e) {
if (e !== "error") { if (e !== "error") {
$ERROR('#7.2: x = []; x.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x.length throw "error". Actual: ' + (e)); $ERROR('#7.2: x = []; x.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x.length throw "error". Actual: ' + (e));
} }
} }
//CHECK#8 //CHECK#8
@ -77,9 +78,9 @@ try {
x.length = {valueOf: function() {return {}}, toString: function() {return {}}}; x.length = {valueOf: function() {return {}}, toString: function() {return {}}};
x.length; x.length;
$ERROR('#8.1: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return {}}} x.length throw TypeError. Actual: ' + (x.length)); $ERROR('#8.1: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return {}}} x.length throw TypeError. Actual: ' + (x.length));
} }
catch (e) { catch (e) {
if ((e instanceof TypeError) !== true) { if ((e instanceof TypeError) !== true) {
$ERROR('#8.2: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return {}}} x.length throw TypeError. Actual: ' + (e)); $ERROR('#8.2: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return {}}} x.length throw TypeError. Actual: ' + (e));
} }
} }

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-properties-of-array-instances-length
info: > info: >
If the length property is changed, every property whose name If the length property is changed, every property whose name
is an array index whose value is not smaller than the new length is automatically deleted is an array index whose value is not smaller than the new length is automatically deleted
@ -12,26 +13,26 @@ description: >
---*/ ---*/
//CHECK#1 //CHECK#1
var x = [0,1,2]; var x = [0,1,2];
x[4294967294] = 4294967294; x[4294967294] = 4294967294;
x.length = 2; x.length = 2;
//CHECK#1 //CHECK#1
if (x[0] !== 0) { if (x[0] !== 0) {
$ERROR('#1: x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; x[0] === 0. Actual: ' + (x[0])); $ERROR('#1: x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; x[0] === 0. Actual: ' + (x[0]));
} }
//CHECK#2 //CHECK#2
if (x[1] !== 1) { if (x[1] !== 1) {
$ERROR('#2: x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; x[1] === 1. Actual: ' + (x[1])); $ERROR('#2: x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; x[1] === 1. Actual: ' + (x[1]));
} }
//CHECK#3 //CHECK#3
if (x[2] !== undefined) { if (x[2] !== undefined) {
$ERROR('#3: x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; x[2] === undefined. Actual: ' + (x[2])); $ERROR('#3: x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; x[2] === undefined. Actual: ' + (x[2]));
} }
//CHECK#4 //CHECK#4
if (x[4294967294] !== undefined) { if (x[4294967294] !== undefined) {
$ERROR('#4: x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; x[4294967294] === undefined. Actual: ' + (x[4294967294])); $ERROR('#4: x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; x[4294967294] === undefined. Actual: ' + (x[4294967294]));
} }