diff --git a/test/built-ins/Array/S15.4.3_A2.1.js b/test/built-ins/Array/S15.4.3_A2.1.js deleted file mode 100644 index 2427df1f74885b60e654e8647f0c873b32b10edb..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/S15.4.3_A2.1.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of Array has the attribute DontEnum -es5id: 15.4.3_A2.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "length") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.slice) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/S15.4.3_A2.2.js b/test/built-ins/Array/S15.4.3_A2.2.js deleted file mode 100644 index 643b9e0a53d7806fc165d567ca05525930e97233..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/S15.4.3_A2.2.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of Array does not have the attribute DontDelete -es5id: 15.4.3_A2.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.hasOwnProperty(\'length\') === true. Actual: ' + (Array.hasOwnProperty('length'))); -} - -delete Array.length; - -//CHECK#2 -if (Array.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.length; Array.hasOwnProperty(\'length\') === false. Actual: ' + (Array.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.length === undefined) { - $ERROR('#3: delete Array.length; Array.length !== undefined'); -} diff --git a/test/built-ins/Array/S15.4.3_A2.3.js b/test/built-ins/Array/S15.4.3_A2.3.js deleted file mode 100644 index 5e00bf260330ed96c41a8035f0ef3b250074ad96..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/S15.4.3_A2.3.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of Array has the attribute ReadOnly -es5id: 15.4.3_A2.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.length; -verifyNotWritable(Array, "length", null, Infinity); -if (Array.length !== x) { - $ERROR('#1: x = Array.length; Array.length = Infinity; Array.length === x. Actual: ' + (Array.length)); -} diff --git a/test/built-ins/Array/S15.4.3_A2.4.js b/test/built-ins/Array/S15.4.3_A2.4.js deleted file mode 100644 index 7106f129907ca230ff0e7384895a871e27cffa79..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/S15.4.3_A2.4.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of Array is 1 -es5id: 15.4.3_A2.4 -description: Array.length === 1 ----*/ - -//CHECK#1 -if (Array.length !== 1) { - $ERROR('#1: Array.length === 1. Actual: ' + (Array.length)); -} diff --git a/test/built-ins/Array/length.js b/test/built-ins/Array/length.js new file mode 100644 index 0000000000000000000000000000000000000000..0d05fccf5487faedd774dbfbfc8acadbc60d4642 --- /dev/null +++ b/test/built-ins/Array/length.js @@ -0,0 +1,24 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array-constructor +description: > + Array has a "length" property whose value is 1. +info: | + 22.1.1 The Array Constructor + + The length property of the Array constructor function is 1. + ... + + ES7 section 17: Unless otherwise specified, the length property of a built-in + Function object has the attributes { [[Writable]]: false, [[Enumerable]]: + false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.length, 1); + +verifyNotEnumerable(Array, 'length'); +verifyNotWritable(Array, 'length'); +verifyConfigurable(Array, 'length');