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/constructor.js b/test/built-ins/Array/constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..5ee0bd02010a3f9d87658274d1f392a5bc0ea1e9 --- /dev/null +++ b/test/built-ins/Array/constructor.js @@ -0,0 +1,10 @@ +// 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-array +description: > + The Array constructor is a built-in function +---*/ + +assert.sameValue(typeof Array, 'function'); 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'); diff --git a/test/built-ins/Array/15.4.5.1-3.d-1.js b/test/built-ins/Array/length/15.4.5.1-3.d-1.js similarity index 100% rename from test/built-ins/Array/15.4.5.1-3.d-1.js rename to test/built-ins/Array/length/15.4.5.1-3.d-1.js diff --git a/test/built-ins/Array/15.4.5.1-3.d-2.js b/test/built-ins/Array/length/15.4.5.1-3.d-2.js similarity index 100% rename from test/built-ins/Array/15.4.5.1-3.d-2.js rename to test/built-ins/Array/length/15.4.5.1-3.d-2.js diff --git a/test/built-ins/Array/15.4.5.1-3.d-3.js b/test/built-ins/Array/length/15.4.5.1-3.d-3.js similarity index 100% rename from test/built-ins/Array/15.4.5.1-3.d-3.js rename to test/built-ins/Array/length/15.4.5.1-3.d-3.js diff --git a/test/built-ins/Array/prototype/S15.4.4_A1.3_T1.js b/test/built-ins/Array/length/S15.4.4_A1.3_T1.js similarity index 100% rename from test/built-ins/Array/prototype/S15.4.4_A1.3_T1.js rename to test/built-ins/Array/length/S15.4.4_A1.3_T1.js diff --git a/test/built-ins/Array/S15.4.5.1_A1.1_T1.js b/test/built-ins/Array/length/S15.4.5.1_A1.1_T1.js similarity index 100% rename from test/built-ins/Array/S15.4.5.1_A1.1_T1.js rename to test/built-ins/Array/length/S15.4.5.1_A1.1_T1.js diff --git a/test/built-ins/Array/S15.4.5.1_A1.1_T2.js b/test/built-ins/Array/length/S15.4.5.1_A1.1_T2.js similarity index 100% rename from test/built-ins/Array/S15.4.5.1_A1.1_T2.js rename to test/built-ins/Array/length/S15.4.5.1_A1.1_T2.js diff --git a/test/built-ins/Array/S15.4.5.1_A1.2_T1.js b/test/built-ins/Array/length/S15.4.5.1_A1.2_T1.js similarity index 100% rename from test/built-ins/Array/S15.4.5.1_A1.2_T1.js rename to test/built-ins/Array/length/S15.4.5.1_A1.2_T1.js diff --git a/test/built-ins/Array/S15.4.5.1_A1.2_T3.js b/test/built-ins/Array/length/S15.4.5.1_A1.2_T3.js similarity index 100% rename from test/built-ins/Array/S15.4.5.1_A1.2_T3.js rename to test/built-ins/Array/length/S15.4.5.1_A1.2_T3.js diff --git a/test/built-ins/Array/S15.4.5.1_A1.3_T1.js b/test/built-ins/Array/length/S15.4.5.1_A1.3_T1.js similarity index 100% rename from test/built-ins/Array/S15.4.5.1_A1.3_T1.js rename to test/built-ins/Array/length/S15.4.5.1_A1.3_T1.js diff --git a/test/built-ins/Array/S15.4.5.1_A1.3_T2.js b/test/built-ins/Array/length/S15.4.5.1_A1.3_T2.js similarity index 100% rename from test/built-ins/Array/S15.4.5.1_A1.3_T2.js rename to test/built-ins/Array/length/S15.4.5.1_A1.3_T2.js diff --git a/test/built-ins/Array/S15.4.5.2_A3_T4.js b/test/built-ins/Array/length/S15.4.5.2_A3_T4.js similarity index 100% rename from test/built-ins/Array/S15.4.5.2_A3_T4.js rename to test/built-ins/Array/length/S15.4.5.2_A3_T4.js diff --git a/test/built-ins/Array/define-own-prop-length-overflow-realm.js b/test/built-ins/Array/length/define-own-prop-length-overflow-realm.js similarity index 100% rename from test/built-ins/Array/define-own-prop-length-overflow-realm.js rename to test/built-ins/Array/length/define-own-prop-length-overflow-realm.js diff --git a/test/built-ins/Array/name.js b/test/built-ins/Array/name.js new file mode 100644 index 0000000000000000000000000000000000000000..9960493ff1f8193689109e144e66b8d0c518a1c5 --- /dev/null +++ b/test/built-ins/Array/name.js @@ -0,0 +1,28 @@ +// 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: > + The "name" property of Array +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value is a + String. Unless otherwise specified, this value is the name that is given to + the function in this specification. + + [...] + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.name, 'Array'); + +verifyNotEnumerable(Array, 'name'); +verifyNotWritable(Array, 'name'); +verifyConfigurable(Array, 'name'); diff --git a/test/built-ins/Array/proto.js b/test/built-ins/Array/proto.js new file mode 100644 index 0000000000000000000000000000000000000000..19ffcba3a8134d3758de73fe5bccbff689cdfd56 --- /dev/null +++ b/test/built-ins/Array/proto.js @@ -0,0 +1,15 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-properties-of-the-array-constructor +description: > + The prototype of the Array constructor is the intrinsic object %FunctionPrototype%. +info: | + 22.1.2 Properties of the Array Constructor + + The value of the [[Prototype]] internal slot of the Array constructor is the + intrinsic object %FunctionPrototype%. +---*/ + +assert.sameValue(Object.getPrototypeOf(Array), Function.prototype); diff --git a/test/built-ins/Array/prototype/S15.4.3.1_A1.js b/test/built-ins/Array/prototype/S15.4.3.1_A1.js deleted file mode 100644 index a870752a41c4125c4a2b096d7344a2251433e91e..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/S15.4.3.1_A1.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 Array has property prototype -es5id: 15.4.3.1_A1 -description: Checking use hasOwnProperty ----*/ - -//CHECK#1 -if (Array.hasOwnProperty('prototype') !== true) { - $ERROR('#1: Array.hasOwnProperty(\'prototype\') === true. Actual: ' + (Array.hasOwnProperty('prototype'))); -} diff --git a/test/built-ins/Array/prototype/S15.4.3.1_A2.js b/test/built-ins/Array/prototype/S15.4.3.1_A2.js deleted file mode 100644 index 96f894a1ff2bc2dc1b1427c0604225aa9f6a605e..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/S15.4.3.1_A2.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 Array.prototype property has the attribute DontEnum -es5id: 15.4.3.1_A2 -description: Checking if enumerating the Array.prototype property fails ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('prototype') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'prototype\') === false. Actual: ' + (Array.propertyIsEnumerable('prototype'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "prototype") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "prototype") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/S15.4.3.1_A3.js b/test/built-ins/Array/prototype/S15.4.3.1_A3.js deleted file mode 100644 index 5ae77516b0ec600c3a2f1d3b03a8266b140aedc5..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/S15.4.3.1_A3.js +++ /dev/null @@ -1,36 +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 Array.prototype property has the attribute DontDelete -es5id: 15.4.3.1_A3 -description: Checking if deleting the Array.prototype property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -if (Array.hasOwnProperty('prototype') !== true) { - $ERROR('#1: Array.hasOwnProperty(\'prototype\') === true. Actual: ' + (Array.hasOwnProperty('prototype'))); -} - -verifyNotConfigurable(Array, "prototype"); - -//CHECK#2 -try { - if((delete Array.prototype) !== false){ - $ERROR('#2: Array.prototype has the attribute DontDelete'); - } -} catch (e) { - if (e instanceof Test262Error) throw e; - assert(e instanceof TypeError); -} - -//CHECK#3 -if (Array.hasOwnProperty('prototype') !== true) { - $ERROR('#3: delete Array.prototype; Array.hasOwnProperty(\'prototype\') === true. Actual: ' + (Array.hasOwnProperty('prototype'))); -} - -//CHECK#4 -if (Array.prototype === undefined) { - $ERROR('#4: delete Array.prototype; Array.prototype !== undefined'); -} diff --git a/test/built-ins/Array/prototype/S15.4.3.1_A4.js b/test/built-ins/Array/prototype/S15.4.3.1_A4.js deleted file mode 100644 index fd62eaff40449668e3fa83bf8570e7f90ba3544a..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/S15.4.3.1_A4.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 Array.prototype property has the attribute ReadOnly -es5id: 15.4.3.1_A4 -description: Checking if varying the Array.prototype property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype; -verifyNotWritable(Array, "prototype", null, 1); -if (Array.prototype !== x) { - $ERROR('#1: x = Array.prototype; Array.prototype = 1; Array.prototype === x. Actual: ' + (Array.prototype)); -} diff --git a/test/built-ins/Array/prototype/S15.4.3.1_A5.js b/test/built-ins/Array/prototype/S15.4.3.1_A5.js deleted file mode 100644 index 6c6f5bef4a7cd9d7fa6d24e8af703025dd98e144..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/S15.4.3.1_A5.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.prototype is 0 -es5id: 15.4.3.1_A5 -description: Array.prototype.length === 0 ----*/ - -//CHECK#1 -if (Array.prototype.length !== 0) { - $ERROR('#1.1: Array.prototype.length === 0. Actual: ' + (Array.prototype.length)); -} diff --git a/test/built-ins/Array/prototype/S15.4.4_A1.1_T1.js b/test/built-ins/Array/prototype/S15.4.4_A1.1_T1.js deleted file mode 100644 index aeff0988d003bfebba152240b52ac221373acfd0..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/S15.4.4_A1.1_T1.js +++ /dev/null @@ -1,24 +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 value of the internal [[Prototype]] property of - the Array prototype object is the Object prototype object -es5id: 15.4.4_A1.1_T1 -description: > - Create new property of Function.prototype. When Array.prototype - object has this property ----*/ - -Object.prototype.myproperty = 1; - -//CHECK#1 -if (Array.prototype.myproperty !== 1) { - $ERROR('#1: Object.prototype.myproperty = 1; Array.prototype.myproperty === 1. Actual: ' + (Array.prototype.myproperty)); -} - -//CHECK#2 -if (Array.prototype.hasOwnProperty('myproperty') !== false) { - $ERROR('#2: Object.prototype.myproperty = 1; Array.prototype.hasOwnProperty(\'myproperty\') === false. Actual: ' + (Array.prototype.hasOwnProperty('myproperty'))); -} diff --git a/test/built-ins/Array/prototype/S15.4.4_A1.1_T2.js b/test/built-ins/Array/prototype/S15.4.4_A1.1_T2.js deleted file mode 100644 index 5438110067841b5d28a70c212a589c7d9f4a8e17..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/S15.4.4_A1.1_T2.js +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4_A1.1_T2 -description: > - The Array prototype object is itself an array; its [[Class]] - is "Array", ----*/ - -//CHECK#1 -if (Object.prototype.toString.call(Array.prototype) !== "[object Array]") { - $ERROR('The Array prototype object is itself an array; its' + - '[[Class]] is "Array".'); -} diff --git a/test/built-ins/Array/prototype/S15.4.4_A1.1_T3.js b/test/built-ins/Array/prototype/S15.4.4_A1.1_T3.js deleted file mode 100644 index 86f9edf07ec0888e2707fbbfda4b3ef56ec2fc5e..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/S15.4.4_A1.1_T3.js +++ /dev/null @@ -1,15 +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 value of the internal [[Prototype]] property of - the Array prototype object is the Object prototype object -es5id: 15.4.4_A1.1_T3 -description: Checking use isPrototypeOf ----*/ - -//CHECK#1 -if (Object.prototype.isPrototypeOf(Array.prototype) !== true) { - $ERROR('#1: Object.prototype.isPrototypeOf(Array.prototype) === true. Actual: ' + (Object.prototype.isPrototypeOf(Array.prototype))); -} diff --git a/test/built-ins/Array/prototype/S15.4.4_A1.2_T1.js b/test/built-ins/Array/prototype/S15.4.4_A1.2_T1.js deleted file mode 100644 index 0c9cccb55967b542a05f486909bec8bfdb953a17..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/S15.4.4_A1.2_T1.js +++ /dev/null @@ -1,14 +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 [[Class]] property of the Array prototype object is set to "Array" -es5id: 15.4.4_A1.2_T1 -description: Checking use Object.prototype.toString ----*/ - -//CHECK#1 -Array.prototype.getClass = Object.prototype.toString; -if (Array.prototype.getClass() !== "[object " + "Array" + "]") { - $ERROR('#1: Array.prototype.getClass = Object.prototype.toString; Array.prototype is Array object. Actual: ' + (Array.prototype.getClass())); -} diff --git a/test/built-ins/Array/prototype/S15.4.4_A2.1_T1.js b/test/built-ins/Array/prototype/S15.4.4_A2.1_T1.js deleted file mode 100644 index 424ed2b6d6d14926ea918c69d0be929fe41875d6..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/S15.4.4_A2.1_T1.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 Array prototype object does not have a valueOf property of - its own; however, it inherits the valueOf property from the valueOf - property from the Object prototype Object -es5id: 15.4.4_A2.1_T1 -description: Checking use hasOwnProperty ----*/ - -//CHECK#1 -if (Array.prototype.hasOwnProperty('valueOf') !== false) { - $ERROR('#1: Array.prototype.hasOwnProperty(\'valueOf\') === false. Actual: ' + (Array.prototype.hasOwnProperty('valueOf'))); -} diff --git a/test/built-ins/Array/prototype/S15.4.4_A2.1_T2.js b/test/built-ins/Array/prototype/S15.4.4_A2.1_T2.js deleted file mode 100644 index 54d9e48474898dd1a9ab0652145246cee1ffd4f3..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/S15.4.4_A2.1_T2.js +++ /dev/null @@ -1,26 +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 Array prototype object does not have a valueOf property of - its own; however, it inherits the valueOf property from the valueOf - property from the Object prototype Object -es5id: 15.4.4_A2.1_T2 -description: > - Change valueOf property of Object.prototype. When - Array.prototype.valueOf also change ----*/ - -Object.prototype.valueOf = 1; - -//CHECK#1 -if (Array.prototype.valueOf !== 1) { - $ERROR('#1: Object.prototype.valueOf = 1; Array.prototype.valueOf === 1. Actual: ' + (Array.prototype.valueOf)); -} - -//CHECK#2 -var x = new Array(); -if (x.valueOf !== 1) { - $ERROR('#1: Object.prototype.valueOf = 1; x = new Array(); x.valueOf === 1. Actual: ' + (x.valueOf)); -} diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_arity.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_arity.js deleted file mode 100644 index 11de52decb864ad4c6416d77d0e507d7ddfa1f83..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_arity.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2014 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/*--- -es6id: 22.1.3.1_3 -description: Array.prototype.concat arity ----*/ -assert.sameValue(Array.prototype.concat.length, 1); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_descriptor.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_descriptor.js deleted file mode 100644 index b2c0a167f41eeb77d48862a7e940be0a49280a01..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_descriptor.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2014 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - - -/*--- -es6id: 22.1.3.1_3 -description: Array.prototype.concat descriptor ----*/ -var desc = Object.getOwnPropertyDescriptor(Array.prototype, "concat"); -assert.sameValue(desc.enumerable, false); diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.1.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.1.js deleted file mode 100644 index a0ab2f07d7264a7d2e9a2147cf21872e5b239c26..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.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 concat has the attribute DontEnum -es5id: 15.4.4.4_A4.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.concat.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.concat.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.concat.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array.prototype.concat){ - if (p === "length") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.concat) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.2.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.2.js deleted file mode 100644 index 6ddfcd66d0387f9406763672e8159921cb0365c5..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.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 concat does not have the attribute DontDelete -es5id: 15.4.4.4_A4.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.concat.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.concat.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.concat.hasOwnProperty('length'))); -} - -delete Array.prototype.concat.length; - -//CHECK#2 -if (Array.prototype.concat.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.concat.length; Array.prototype.concat.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.concat.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.concat.length === undefined) { - $ERROR('#3: delete Array.prototype.concat.length; Array.prototype.concat.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.3.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.3.js deleted file mode 100644 index 206c47194e8ed39541e9ecb28de37c1e1c2b8dff..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.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 concat has the attribute ReadOnly -es5id: 15.4.4.4_A4.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.concat.length; -verifyNotWritable(Array.prototype.concat, "length", null, Infinity); -if (Array.prototype.concat.length !== x) { - $ERROR('#1: x = Array.prototype.concat.length; Array.prototype.concat.length = Infinity; Array.prototype.concat.length === x. Actual: ' + (Array.prototype.concat.length)); -} diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.4.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.4.js deleted file mode 100644 index ccdfadf2bf3e5c11ea2c071f39cf74c63ff749e4..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.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 concat is 1 -es5id: 15.4.4.4_A4.4 -description: concat.length === 1 ----*/ - -//CHECK#1 -if (Array.prototype.concat.length !== 1) { - $ERROR('#1: Array.prototype.concat.length === 1. Actual: ' + (Array.prototype.concat.length)); -} diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.5.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.5.js deleted file mode 100644 index b7aeed702250c44446f57371ca0b9fe101fcd606..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.5.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 concat property of Array has the attribute DontEnum -es5id: 15.4.4.4_A4.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('concat') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'concat\') === false. Actual: ' + (Array.propertyIsEnumerable('concat'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "concat") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "concat") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.6.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.6.js deleted file mode 100644 index 195a49a9d11a33731d6749093228e2bedcde487f..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.6.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 concat property of Array has not prototype property -es5id: 15.4.4.4_A4.6 -description: Checking Array.prototype.concat.prototype ----*/ - -//CHECK#1 -if (Array.prototype.concat.prototype !== undefined) { - $ERROR('#1: Array.prototype.concat.prototype === undefined. Actual: ' + (Array.prototype.concat.prototype)); -} diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.7.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.7.js deleted file mode 100644 index 5a7e92dfceadb172ffb8de195c08dea44f2f2ff6..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.7.js +++ /dev/null @@ -1,21 +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 concat property of Array can't be used as constructor -es5id: 15.4.4.4_A4.7 -description: > - If property does not implement the internal [[Construct]] method, - throw a TypeError exception ----*/ - -//CHECK#1 - -try { - new Array.prototype.concat(); - $ERROR('#1.1: new Array.prototype.concat() throw TypeError. Actual: ' + (new Array.prototype.concat())); -} catch (e) { - if ((e instanceof TypeError) !== true) { - $ERROR('#1.2: new Array.prototype.concat() throw TypeError. Actual: ' + (e)); - } -} diff --git a/test/built-ins/Array/prototype/concat/length.js b/test/built-ins/Array/prototype/concat/length.js new file mode 100644 index 0000000000000000000000000000000000000000..657441f3897084567e6cb4a2c65cc99c2aea9bca --- /dev/null +++ b/test/built-ins/Array/prototype/concat/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.concat +description: > + The "length" property of Array.prototype.concat +info: | + 22.1.3.1 Array.prototype.concat ( ...arguments ) + + The length property of the concat method is 1. + + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + 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.prototype.concat.length, 1); + +verifyNotEnumerable(Array.prototype.concat, 'length'); +verifyNotWritable(Array.prototype.concat, 'length'); +verifyConfigurable(Array.prototype.concat, 'length'); diff --git a/test/built-ins/Array/prototype/concat/not-a-constructor.js b/test/built-ins/Array/prototype/concat/not-a-constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..c69c22c7b56b0b9aa9adfdb49f9b215a8aa88616 --- /dev/null +++ b/test/built-ins/Array/prototype/concat/not-a-constructor.js @@ -0,0 +1,22 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.concat +description: > + Array.prototype.concat is not a constructor. +info: | + 17 ECMAScript Standard Built-in Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +---*/ + +assert.throws(TypeError, function() { + new Array.prototype.concat(); +}); + +assert.throws(TypeError, function() { + new [].concat(); +}); diff --git a/test/built-ins/Array/prototype/concat/prop-desc.js b/test/built-ins/Array/prototype/concat/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..897899142e0339b89c951573e3aaea1da1dd5875 --- /dev/null +++ b/test/built-ins/Array/prototype/concat/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.concat +description: > + "concat" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.concat, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "concat"); +verifyWritable(Array.prototype, "concat"); +verifyConfigurable(Array.prototype, "concat"); diff --git a/test/built-ins/Array/prototype/constructor.js b/test/built-ins/Array/prototype/constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..4530635b590debf9a768ebf012bb606e7a22321f --- /dev/null +++ b/test/built-ins/Array/prototype/constructor.js @@ -0,0 +1,25 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.constructor +description: > + Array.prototype.constructor +info: | + 22.1.3.2 Array.prototype.constructor + + The initial value of Array.prototype.constructor is the intrinsic object %Array%. + + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.constructor, Array); + +verifyNotEnumerable(Array.prototype, 'constructor'); +verifyWritable(Array.prototype, 'constructor'); +verifyConfigurable(Array.prototype, 'constructor'); diff --git a/test/built-ins/Array/prototype/constructor/S15.4.4.1_A1_T1.js b/test/built-ins/Array/prototype/constructor/S15.4.4.1_A1_T1.js deleted file mode 100644 index eaf8d65a5991d6c7909a742f484a0f1d10df8fe6..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/constructor/S15.4.4.1_A1_T1.js +++ /dev/null @@ -1,15 +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 initial value of Array.prototype.constructor is - the built-in Array constructor -es5id: 15.4.4.1_A1_T1 -description: Array.prototype.constructor === Array ----*/ - -//CHECK#1 -if (Array.prototype.constructor !== Array) { - $ERROR('#1: Array.prototype.constructor === Array. Actual: ' + (Array.prototype.constructor)); -} diff --git a/test/built-ins/Array/prototype/constructor/S15.4.4.1_A2.js b/test/built-ins/Array/prototype/constructor/S15.4.4.1_A2.js deleted file mode 100644 index b8709520461977487bd3e5a9799467b5a3fb7fa9..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/constructor/S15.4.4.1_A2.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 constructor property of Array has the attribute DontEnum -es5id: 15.4.4.1_A2 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('constructor') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'constructor\') === false. Actual: ' + (Array.propertyIsEnumerable('constructor'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "constructor") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "constructor") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/copyWithin/copyWithin.js b/test/built-ins/Array/prototype/copyWithin/prop-desc.js similarity index 100% rename from test/built-ins/Array/prototype/copyWithin/copyWithin.js rename to test/built-ins/Array/prototype/copyWithin/prop-desc.js diff --git a/test/built-ins/Array/prototype/entries/entries.js b/test/built-ins/Array/prototype/entries/prop-desc.js similarity index 100% rename from test/built-ins/Array/prototype/entries/entries.js rename to test/built-ins/Array/prototype/entries/prop-desc.js diff --git a/test/built-ins/Array/prototype/every/prop-desc.js b/test/built-ins/Array/prototype/every/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..0d1b869ca2ccb4188e2eba5d15de63d03d675bc4 --- /dev/null +++ b/test/built-ins/Array/prototype/every/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.every +description: > + "every" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.every, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "every"); +verifyWritable(Array.prototype, "every"); +verifyConfigurable(Array.prototype, "every"); diff --git a/test/built-ins/Array/prototype/exotic-array.js b/test/built-ins/Array/prototype/exotic-array.js new file mode 100644 index 0000000000000000000000000000000000000000..e5ecdffccd0771ead71a2c0b1c08eeb122068833 --- /dev/null +++ b/test/built-ins/Array/prototype/exotic-array.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-properties-of-the-array-prototype-object +description: > + Array.prototype is an exoctic array object +info: | + 22.1.3 Properties of the Array Prototype Object + + (...) + The Array prototype object is an Array exotic object and has the internal + methods specified for such objects. +---*/ + +Array.prototype[2] = 42; + +assert.sameValue(Array.prototype.length, 3); +assert.sameValue(Array.prototype[0], undefined, 'Array.prototype[0]'); +assert.sameValue(Array.prototype[1], undefined, 'Array.prototype[1]'); +assert.sameValue(Array.prototype[2], 42, 'Array.prototype[2]'); + +assert.sameValue({}.toString.call(Array.prototype), '[object Array]'); diff --git a/test/built-ins/Array/prototype/fill/fill.js b/test/built-ins/Array/prototype/fill/prop-desc.js similarity index 100% rename from test/built-ins/Array/prototype/fill/fill.js rename to test/built-ins/Array/prototype/fill/prop-desc.js diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-0-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-0-1.js deleted file mode 100644 index c507b89db206709cb4a05e2d1659ee50f803cfff..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-0-1.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.20-0-1 -description: Array.prototype.filter must exist as a function ----*/ - - var f = Array.prototype.filter; - -assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-0-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-0-2.js deleted file mode 100644 index e5d615e58f571651c47f722cb8aae256b26c3d8a..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-0-2.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.20-0-2 -description: Array.prototype.filter.length must be 1 ----*/ - -assert.sameValue(Array.prototype.filter.length, 1, 'Array.prototype.filter.length'); diff --git a/test/built-ins/Array/prototype/filter/length.js b/test/built-ins/Array/prototype/filter/length.js new file mode 100644 index 0000000000000000000000000000000000000000..49c132c33ceb49f1285ae07babcd6c20d5465fc2 --- /dev/null +++ b/test/built-ins/Array/prototype/filter/length.js @@ -0,0 +1,30 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.filter +description: > + The "length" property of Array.prototype.filter +info: | + 22.1.3.7 Array.prototype.filter ( callbackfn [ , thisArg ] ) + + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + 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.prototype.filter.length, 1); + +verifyNotEnumerable(Array.prototype.filter, 'length'); +verifyNotWritable(Array.prototype.filter, 'length'); +verifyConfigurable(Array.prototype.filter, 'length'); diff --git a/test/built-ins/Array/prototype/filter/prop-desc.js b/test/built-ins/Array/prototype/filter/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..62a11c5e59fa8b35edd26521ca93cd369749932d --- /dev/null +++ b/test/built-ins/Array/prototype/filter/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.filter +description: > + "filter" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.filter, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "filter"); +verifyWritable(Array.prototype, "filter"); +verifyConfigurable(Array.prototype, "filter"); diff --git a/test/built-ins/Array/prototype/find/find.js b/test/built-ins/Array/prototype/find/prop-desc.js similarity index 100% rename from test/built-ins/Array/prototype/find/find.js rename to test/built-ins/Array/prototype/find/prop-desc.js diff --git a/test/built-ins/Array/prototype/findIndex/findIndex.js b/test/built-ins/Array/prototype/findIndex/prop-desc.js similarity index 100% rename from test/built-ins/Array/prototype/findIndex/findIndex.js rename to test/built-ins/Array/prototype/findIndex/prop-desc.js diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-0-1.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-0-1.js deleted file mode 100644 index 4bee8a861bd368d41440b273f99d62ce46dcc11f..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-0-1.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.18-0-1 -description: Array.prototype.forEach must exist as a function ----*/ - - var f = Array.prototype.forEach; - -assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-0-2.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-0-2.js deleted file mode 100644 index 149383e81d5a279a627e08814dce8346eff7a085..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-0-2.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.18-0-2 -description: Array.prototype.forEach.length must be 1 ----*/ - -assert.sameValue(Array.prototype.forEach.length, 1, 'Array.prototype.forEach.length'); diff --git a/test/built-ins/Array/prototype/forEach/length.js b/test/built-ins/Array/prototype/forEach/length.js new file mode 100644 index 0000000000000000000000000000000000000000..a58372f27ca64ffde2a1bd102ee09cd4f9fe93a8 --- /dev/null +++ b/test/built-ins/Array/prototype/forEach/length.js @@ -0,0 +1,30 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.forEach +description: > + The "length" property of Array.prototype.forEach +info: | + 22.1.3.10 Array.prototype.forEach ( callbackfn [ , thisArg ] ) + + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + 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.prototype.forEach.length, 1); + +verifyNotEnumerable(Array.prototype.forEach, 'length'); +verifyNotWritable(Array.prototype.forEach, 'length'); +verifyConfigurable(Array.prototype.forEach, 'length'); diff --git a/test/built-ins/Array/prototype/forEach/prop-desc.js b/test/built-ins/Array/prototype/forEach/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..bdbfe250545cb3f9cceecaeb0a85de30a1902986 --- /dev/null +++ b/test/built-ins/Array/prototype/forEach/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.forEach +description: > + "forEach" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.forEach, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "forEach"); +verifyWritable(Array.prototype, "forEach"); +verifyConfigurable(Array.prototype, "forEach"); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-0-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-0-1.js deleted file mode 100644 index 68068f4525e25a8ad186a7f9c1d5e0f111cb6065..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-0-1.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.14-0-1 -description: Array.prototype.indexOf must exist as a function ----*/ - - var f = Array.prototype.indexOf; - -assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-0-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-0-2.js deleted file mode 100644 index 3294781683e057ad5a3b54d50a2dd0484a095eba..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-0-2.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.14-0-2 -description: Array.prototype.indexOf has a length property whose value is 1. ----*/ - -assert.sameValue(Array.prototype.indexOf.length, 1, 'Array.prototype.indexOf.length'); diff --git a/test/built-ins/Array/prototype/indexOf/length.js b/test/built-ins/Array/prototype/indexOf/length.js new file mode 100644 index 0000000000000000000000000000000000000000..c0bc818491ea2c4fbaec92020965d24f743fe089 --- /dev/null +++ b/test/built-ins/Array/prototype/indexOf/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.indexof +description: > + The "length" property of Array.prototype.indexOf +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + 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.prototype.indexOf.length, 1); + +verifyNotEnumerable(Array.prototype.indexOf, 'length'); +verifyNotWritable(Array.prototype.indexOf, 'length'); +verifyConfigurable(Array.prototype.indexOf, 'length'); diff --git a/test/built-ins/Array/prototype/indexOf/prop-desc.js b/test/built-ins/Array/prototype/indexOf/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..26fd3a8c65f1269af257a73e461f79242ad694a5 --- /dev/null +++ b/test/built-ins/Array/prototype/indexOf/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.indexof +description: > + "indexOf" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.indexOf, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "indexOf"); +verifyWritable(Array.prototype, "indexOf"); +verifyConfigurable(Array.prototype, "indexOf"); diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.1.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A6.1.js deleted file mode 100644 index 0980d2090f37e6dcaf8fb858d0edb7e175d444b5..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.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 join has the attribute DontEnum -es5id: 15.4.4.5_A6.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.join.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.join.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.join.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array.prototype.join){ - if (p === "length") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.join) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.2.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A6.2.js deleted file mode 100644 index 3c5cc0b9a810775a0b784b35417a6d145ddef985..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.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 join does not have the attribute DontDelete -es5id: 15.4.4.5_A6.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.join.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.join.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.join.hasOwnProperty('length'))); -} - -delete Array.prototype.join.length; - -//CHECK#2 -if (Array.prototype.join.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.join.length; Array.prototype.join.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.join.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.join.length === undefined) { - $ERROR('#3: delete Array.prototype.join.length; Array.prototype.join.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.3.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A6.3.js deleted file mode 100644 index 0a0391e6a46800c03635b3ec21eaa5653a8374c3..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.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 join has the attribute ReadOnly -es5id: 15.4.4.5_A6.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.join.length; -verifyNotWritable(Array.prototype.join, "length", null, Infinity); -if (Array.prototype.join.length !== x) { - $ERROR('#1: x = Array.prototype.join.length; Array.prototype.join.length = Infinity; Array.prototype.join.length === x. Actual: ' + (Array.prototype.join.length)); -} diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.4.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A6.4.js deleted file mode 100644 index 272672ecbe08a9bb85fe15423948f1be592244f5..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.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 join is 1 -es5id: 15.4.4.5_A6.4 -description: join.length === 1 ----*/ - -//CHECK#1 -if (Array.prototype.join.length !== 1) { - $ERROR('#1: Array.prototype.join.length === 1. Actual: ' + (Array.prototype.join.length)); -} diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.5.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A6.5.js deleted file mode 100644 index dd5dd6b9cfd9fd8a39e7adda9224b5fe6a933f39..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.5.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 join property of Array has the attribute DontEnum -es5id: 15.4.4.5_A6.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('join') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'join\') === false. Actual: ' + (Array.propertyIsEnumerable('join'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "join") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "join") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/join/length.js b/test/built-ins/Array/prototype/join/length.js new file mode 100644 index 0000000000000000000000000000000000000000..a8fa14f253bc7add6c5d49421f414274309ddb60 --- /dev/null +++ b/test/built-ins/Array/prototype/join/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.join +description: > + The "length" property of Array.prototype.join +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + 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.prototype.join.length, 1); + +verifyNotEnumerable(Array.prototype.join, 'length'); +verifyNotWritable(Array.prototype.join, 'length'); +verifyConfigurable(Array.prototype.join, 'length'); diff --git a/test/built-ins/Array/prototype/join/prop-desc.js b/test/built-ins/Array/prototype/join/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..9d9b806f5fa2dcc3fc3bf2d8b16061b720f3c184 --- /dev/null +++ b/test/built-ins/Array/prototype/join/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.join +description: > + "join" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.join, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "join"); +verifyWritable(Array.prototype, "join"); +verifyConfigurable(Array.prototype, "join"); diff --git a/test/built-ins/Array/prototype/keys/keys.js b/test/built-ins/Array/prototype/keys/prop-desc.js similarity index 100% rename from test/built-ins/Array/prototype/keys/keys.js rename to test/built-ins/Array/prototype/keys/prop-desc.js diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-1.js deleted file mode 100644 index 2ab710995f7d5dfec9bf3dc38699322e5633ca8c..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-1.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.15-0-1 -description: Array.prototype.lastIndexOf must exist as a function ----*/ - - var f = Array.prototype.lastIndexOf; - -assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-2.js deleted file mode 100644 index 3cda6dac6ab9aed597285aed28eaad0eda3c5555..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-2.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.15-0-2 -description: Array.prototype.lastIndexOf has a length property whose value is 1. ----*/ - -assert.sameValue(Array.prototype.lastIndexOf.length, 1, 'Array.prototype.lastIndexOf.length'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/length.js b/test/built-ins/Array/prototype/lastIndexOf/length.js new file mode 100644 index 0000000000000000000000000000000000000000..6084d8482c4f1a075bc1056a2b6b75a3c3a66d68 --- /dev/null +++ b/test/built-ins/Array/prototype/lastIndexOf/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.lastindexof +description: > + The "length" property of Array.prototype.lastIndexOf +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + 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.prototype.lastIndexOf.length, 1); + +verifyNotEnumerable(Array.prototype.lastIndexOf, 'length'); +verifyNotWritable(Array.prototype.lastIndexOf, 'length'); +verifyConfigurable(Array.prototype.lastIndexOf, 'length'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/prop-desc.js b/test/built-ins/Array/prototype/lastIndexOf/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..b882aeebceee84bf8ce3107771c58b53197213fd --- /dev/null +++ b/test/built-ins/Array/prototype/lastIndexOf/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.lastindexof +description: > + "lastIndexOf" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.lastIndexOf, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "lastIndexOf"); +verifyWritable(Array.prototype, "lastIndexOf"); +verifyConfigurable(Array.prototype, "lastIndexOf"); diff --git a/test/built-ins/Array/prototype/length.js b/test/built-ins/Array/prototype/length.js new file mode 100644 index 0000000000000000000000000000000000000000..35a38c4f5548da02952e18906719f8d327f29091 --- /dev/null +++ b/test/built-ins/Array/prototype/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-properties-of-the-array-prototype-object +description: > + Array.prototype has a length property +info: | + 22.1.3 Properties of the Array Prototype Object + + The Array prototype object is the intrinsic object %ArrayPrototype%. The Array + prototype object is an Array exotic object and has the internal methods specified + for such objects. It has a length property whose initial value is 0 and whose + attributes are { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: + false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.length, 0); + +verifyNotEnumerable(Array.prototype, 'length'); +// specify the value so it avoids a RangeError while setting the length +verifyWritable(Array.prototype, 'length', false, 42); +verifyNotConfigurable(Array.prototype, 'length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-0-1.js b/test/built-ins/Array/prototype/map/15.4.4.19-0-1.js deleted file mode 100644 index 8d05c641ec8f4e20f40e26c528139eefe42074ec..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/map/15.4.4.19-0-1.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.19-0-1 -description: Array.prototype.map must exist as a function ----*/ - - var f = Array.prototype.map; - -assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-0-2.js b/test/built-ins/Array/prototype/map/15.4.4.19-0-2.js deleted file mode 100644 index 6d2d6f65bd8fc5c57129f6e1fe17165afbef2475..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/map/15.4.4.19-0-2.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.19-0-2 -description: Array.prototype.map.length must be 1 ----*/ - -assert.sameValue(Array.prototype.map.length, 1, 'Array.prototype.map.length'); diff --git a/test/built-ins/Array/prototype/map/length.js b/test/built-ins/Array/prototype/map/length.js new file mode 100644 index 0000000000000000000000000000000000000000..af037e98b56e0fa0835f878ffb8b1bddef2c8d1f --- /dev/null +++ b/test/built-ins/Array/prototype/map/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.map +description: > + The "length" property of Array.prototype.map +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + 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.prototype.map.length, 1); + +verifyNotEnumerable(Array.prototype.map, 'length'); +verifyNotWritable(Array.prototype.map, 'length'); +verifyConfigurable(Array.prototype.map, 'length'); diff --git a/test/built-ins/Array/prototype/map/prop-desc.js b/test/built-ins/Array/prototype/map/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..7533034e15328cb9c45b866b122d0dd1bfda2da3 --- /dev/null +++ b/test/built-ins/Array/prototype/map/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.map +description: > + "map" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.map, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "map"); +verifyWritable(Array.prototype, "map"); +verifyConfigurable(Array.prototype, "map"); diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.1.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.1.js deleted file mode 100644 index 9460c82c0a50b51586d230b1b1540d9d66daf3ff..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.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 pop has the attribute DontEnum -es5id: 15.4.4.6_A5.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.pop.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.pop.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.pop.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array.prototype.pop){ - if (p === "length") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.pop) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.2.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.2.js deleted file mode 100644 index b84b2a96afea0d415a5ee7b2ed81b4f3b186f5dd..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.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 pop does not have the attribute DontDelete -es5id: 15.4.4.6_A5.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.pop.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.pop.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.pop.hasOwnProperty('length'))); -} - -delete Array.prototype.pop.length; - -//CHECK#2 -if (Array.prototype.pop.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.pop.length; Array.prototype.pop.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.pop.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.pop.length === undefined) { - $ERROR('#3: delete Array.prototype.pop.length; Array.prototype.pop.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.3.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.3.js deleted file mode 100644 index bec89ff4140aa92df454bcb118d2a816cb95f5ed..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.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 pop has the attribute ReadOnly -es5id: 15.4.4.6_A5.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.pop.length; -verifyNotWritable(Array.prototype.pop, "length", null, Infinity); -if (Array.prototype.pop.length !== x) { - $ERROR('#1: x = Array.prototype.pop.length; Array.prototype.pop.length = Infinity; Array.prototype.pop.length === x. Actual: ' + (Array.prototype.pop.length)); -} diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.4.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.4.js deleted file mode 100644 index 41e2bc9fd986d1e963dec41b91279b9fdb81438d..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.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 pop is 0 -es5id: 15.4.4.6_A5.4 -description: pop.length === 1 ----*/ - -//CHECK#1 -if (Array.prototype.pop.length !== 0) { - $ERROR('#1: Array.prototype.pop.length === 0. Actual: ' + (Array.prototype.pop.length)); -} diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.5.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.5.js deleted file mode 100644 index 2546e4f964cec7a1f2d37bf9ff562ba9b9943560..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.5.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 pop property of Array has the attribute DontEnum -es5id: 15.4.4.6_A5.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('pop') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'pop\') === false. Actual: ' + (Array.propertyIsEnumerable('pop'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "pop") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "pop") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.6.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.6.js deleted file mode 100644 index 7e6b9090e39314019e9ed315901d0aead1ff3d27..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.6.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 pop property of Array has not prototype property -es5id: 15.4.4.6_A5.6 -description: Checking Array.prototype.pop.prototype ----*/ - -//CHECK#1 -if (Array.prototype.pop.prototype !== undefined) { - $ERROR('#1: Array.prototype.pop.prototype === undefined. Actual: ' + (Array.prototype.pop.prototype)); -} diff --git a/test/built-ins/Array/prototype/pop/length.js b/test/built-ins/Array/prototype/pop/length.js new file mode 100644 index 0000000000000000000000000000000000000000..d406ade4977756fd8fdd6f86d016b523f71c4d31 --- /dev/null +++ b/test/built-ins/Array/prototype/pop/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.pop +description: > + The "length" property of Array.prototype.pop +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + 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.prototype.pop.length, 0); + +verifyNotEnumerable(Array.prototype.pop, 'length'); +verifyNotWritable(Array.prototype.pop, 'length'); +verifyConfigurable(Array.prototype.pop, 'length'); diff --git a/test/built-ins/Array/prototype/pop/prop-desc.js b/test/built-ins/Array/prototype/pop/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..5c8a9f5a47538832de45536881b8bb303146db2c --- /dev/null +++ b/test/built-ins/Array/prototype/pop/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.pop +description: > + "pop" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.pop, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "pop"); +verifyWritable(Array.prototype, "pop"); +verifyConfigurable(Array.prototype, "pop"); diff --git a/test/built-ins/Array/prototype/prop-desc.js b/test/built-ins/Array/prototype/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..7f246469bda51182b4a6939509ac1c214d43cc27 --- /dev/null +++ b/test/built-ins/Array/prototype/prop-desc.js @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype +description: > + The property descriptor of Array.prototype +info: | + 22.1.2.4 Array.prototype + + The value of Array.prototype is %ArrayPrototype%, the intrinsic Array prototype object. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +verifyNotEnumerable(Array, 'prototype'); +verifyNotWritable(Array, 'prototype'); +verifyNotConfigurable(Array, 'prototype'); diff --git a/test/built-ins/Array/prototype/proto.js b/test/built-ins/Array/prototype/proto.js new file mode 100644 index 0000000000000000000000000000000000000000..c75dc27b51da0ddd34325c4f023cdfeff0240ced --- /dev/null +++ b/test/built-ins/Array/prototype/proto.js @@ -0,0 +1,15 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-properties-of-the-array-prototype-object +description: > + The [[Prototype]] of Array.prototype is Object.Prototype. +info: | + 22.1.3 Properties of the Array Prototype Object + + The value of the [[Prototype]] internal slot of the Array prototype object is + the intrinsic object %ObjectPrototype%. +---*/ + +assert.sameValue(Object.getPrototypeOf(Array.prototype), Object.prototype); diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.1.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A6.1.js deleted file mode 100644 index 90a12e90e103071dcee649044fe2c43f7690c627..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.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 push has the attribute DontEnum -es5id: 15.4.4.7_A6.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.push.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.push.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.push.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array.prototype.push){ - if (p === "length") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.push) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.2.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A6.2.js deleted file mode 100644 index b7e5c85e36d6e861edad3c45ba1c1ff812d03fe1..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.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 push does not have the attribute DontDelete -es5id: 15.4.4.7_A6.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.push.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.push.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.push.hasOwnProperty('length'))); -} - -delete Array.prototype.push.length; - -//CHECK#2 -if (Array.prototype.push.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.push.length; Array.prototype.push.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.push.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.push.length === undefined) { - $ERROR('#3: delete Array.prototype.push.length; Array.prototype.push.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.3.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A6.3.js deleted file mode 100644 index 6b1dcf8e04ef521ea423851bc0d084877bc6a3d1..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.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 push has the attribute ReadOnly -es5id: 15.4.4.7_A6.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.push.length; -verifyNotWritable(Array.prototype.push, "length", null, Infinity); -if (Array.prototype.push.length !== x) { - $ERROR('#1: x = Array.prototype.push.length; Array.prototype.push.length = Infinity; Array.prototype.push.length === x. Actual: ' + (Array.prototype.push.length)); -} diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.4.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A6.4.js deleted file mode 100644 index 67b319181deef4c549c9f852af5bbb0a3b934ddf..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.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 push is 1 -es5id: 15.4.4.7_A6.4 -description: push.length === 1 ----*/ - -//CHECK#1 -if (Array.prototype.push.length !== 1) { - $ERROR('#1: Array.prototype.push.length === 1. Actual: ' + (Array.prototype.push.length)); -} diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.5.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A6.5.js deleted file mode 100644 index 60b48d5cf2e70624ad5de0654727046921a90038..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.5.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 push property of Array has the attribute DontEnum -es5id: 15.4.4.7_A6.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('push') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'push\') === false. Actual: ' + (Array.propertyIsEnumerable('push'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "push") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "push") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.6.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A6.6.js deleted file mode 100644 index cb8ec123c38de6556558588efdb98f9da44724bd..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.6.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 push property of Array has not prototype property -es5id: 15.4.4.7_A6.6 -description: Checking Array.prototype.push.prototype ----*/ - -//CHECK#1 -if (Array.prototype.push.prototype !== undefined) { - $ERROR('#1: Array.prototype.push.prototype === undefined. Actual: ' + (Array.prototype.push.prototype)); -} diff --git a/test/built-ins/Array/prototype/push/length.js b/test/built-ins/Array/prototype/push/length.js new file mode 100644 index 0000000000000000000000000000000000000000..33d43ba2686c7154ef31b36e2330670f395975b4 --- /dev/null +++ b/test/built-ins/Array/prototype/push/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.push +description: > + The "length" property of Array.prototype.push +info: | + 22.1.3.18 Array.prototype.push ( ...items ) + + The length property of the push method is 1. + + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + 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.prototype.push.length, 1); + +verifyNotEnumerable(Array.prototype.push, 'length'); +verifyNotWritable(Array.prototype.push, 'length'); +verifyConfigurable(Array.prototype.push, 'length'); diff --git a/test/built-ins/Array/prototype/push/prop-desc.js b/test/built-ins/Array/prototype/push/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..157275c1e6ac1eb0776f5657d9e04ae2efe005d5 --- /dev/null +++ b/test/built-ins/Array/prototype/push/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.push +description: > + "push" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.push, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "push"); +verifyWritable(Array.prototype, "push"); +verifyConfigurable(Array.prototype, "push"); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-0-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-0-1.js deleted file mode 100644 index b6a168723e291b0047a036509a48a9f8a67cd78d..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-0-1.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.21-0-1 -description: Array.prototype.reduce must exist as a function ----*/ - - var f = Array.prototype.reduce; - -assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-0-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-0-2.js deleted file mode 100644 index 06afb159ddb290db7717b0c2da14d801b26305fe..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-0-2.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.21-0-2 -description: Array.prototype.reduce.length must be 1 ----*/ - -assert.sameValue(Array.prototype.reduce.length, 1, 'Array.prototype.reduce.length'); diff --git a/test/built-ins/Array/prototype/reduce/length.js b/test/built-ins/Array/prototype/reduce/length.js new file mode 100644 index 0000000000000000000000000000000000000000..afc2b80eeb34a559c1e5f83daa79210e30e01e0a --- /dev/null +++ b/test/built-ins/Array/prototype/reduce/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.reduce +description: > + The "length" property of Array.prototype.reduce +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + 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.prototype.reduce.length, 1); + +verifyNotEnumerable(Array.prototype.reduce, 'length'); +verifyNotWritable(Array.prototype.reduce, 'length'); +verifyConfigurable(Array.prototype.reduce, 'length'); diff --git a/test/built-ins/Array/prototype/reduce/prop-desc.js b/test/built-ins/Array/prototype/reduce/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..9e8b41170b2a38ed963c53ce16dd44c28f9d00de --- /dev/null +++ b/test/built-ins/Array/prototype/reduce/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.reduce +description: > + "reduce" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.reduce, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "reduce"); +verifyWritable(Array.prototype, "reduce"); +verifyConfigurable(Array.prototype, "reduce"); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-0-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-0-1.js deleted file mode 100644 index 1613735e8596ee2d7c6b5affa478e30869d49488..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-0-1.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.22-0-1 -description: Array.prototype.reduceRight must exist as a function ----*/ - - var f = Array.prototype.reduceRight; - -assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-0-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-0-2.js deleted file mode 100644 index 21322d512d0bb93a26052c986120ce3869c84a83..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-0-2.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.22-0-2 -description: Array.prototype.reduceRight.length must be 1 ----*/ - -assert.sameValue(Array.prototype.reduceRight.length, 1, 'Array.prototype.reduceRight.length'); diff --git a/test/built-ins/Array/prototype/reduceRight/length.js b/test/built-ins/Array/prototype/reduceRight/length.js new file mode 100644 index 0000000000000000000000000000000000000000..a74578c096f7f20bb731279df6b6600bed5ef52e --- /dev/null +++ b/test/built-ins/Array/prototype/reduceRight/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.reduceright +description: > + The "length" property of Array.prototype.reduceRight +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + 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.prototype.reduceRight.length, 1); + +verifyNotEnumerable(Array.prototype.reduceRight, 'length'); +verifyNotWritable(Array.prototype.reduceRight, 'length'); +verifyConfigurable(Array.prototype.reduceRight, 'length'); diff --git a/test/built-ins/Array/prototype/reduceRight/prop-desc.js b/test/built-ins/Array/prototype/reduceRight/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..502b5164da4ca40009a63325accd4382479e9390 --- /dev/null +++ b/test/built-ins/Array/prototype/reduceRight/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.reduceright +description: > + "reduceRight" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.reduceRight, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "reduceRight"); +verifyWritable(Array.prototype, "reduceRight"); +verifyConfigurable(Array.prototype, "reduceRight"); diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.1.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.1.js deleted file mode 100644 index 267ddba834963292c7d3c3b1501a54b5c591d781..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.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 reverse has the attribute DontEnum -es5id: 15.4.4.8_A5.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.reverse.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.reverse.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.reverse.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (p in Array.prototype.reverse){ - if (p === "length") { - var result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.reverse) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.2.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.2.js deleted file mode 100644 index 13cde2c9ce6f4532346ed7b5b3f31407c30ecce2..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.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 reverse does not have the attribute DontDelete -es5id: 15.4.4.8_A5.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.reverse.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.reverse.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.reverse.hasOwnProperty('length'))); -} - -delete Array.prototype.reverse.length; - -//CHECK#2 -if (Array.prototype.reverse.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.reverse.length; Array.prototype.reverse.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.reverse.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.reverse.length === undefined) { - $ERROR('#3: delete Array.prototype.reverse.length; Array.prototype.reverse.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.3.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.3.js deleted file mode 100644 index d18c4bad86f7fa6c3008c64962cd304868d0f721..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.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 reverse has the attribute ReadOnly -es5id: 15.4.4.8_A5.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.reverse.length; -verifyNotWritable(Array.prototype.reverse, "length", null, Infinity); -if (Array.prototype.reverse.length !== x) { - $ERROR('#1: x = Array.prototype.reverse.length; Array.prototype.reverse.length = Infinity; Array.prototype.reverse.length === x. Actual: ' + (Array.prototype.reverse.length)); -} diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.4.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.4.js deleted file mode 100644 index 231f9045ee6368485e450f12ba1d28949a2bc146..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.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 reverse is 0 -es5id: 15.4.4.8_A5.4 -description: reverse.length === 1 ----*/ - -//CHECK#1 -if (Array.prototype.reverse.length !== 0) { - $ERROR('#1: Array.prototype.reverse.length === 0. Actual: ' + (Array.prototype.reverse.length)); -} diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.5.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.5.js deleted file mode 100644 index 9dd52c52fb59490f577660fde95d56c37c38620b..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.5.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 reverse property of Array has the attribute DontEnum -es5id: 15.4.4.8_A5.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('reverse') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'reverse\') === false. Actual: ' + (Array.propertyIsEnumerable('reverse'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "reverse") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "reverse") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.6.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.6.js deleted file mode 100644 index 288babcf014c8ff4e5dd208308047f1331588f3c..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.6.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 reverse property of Array has not prototype property -es5id: 15.4.4.8_A5.6 -description: Checking Array.prototype.reverse.prototype ----*/ - -//CHECK#1 -if (Array.prototype.reverse.prototype !== undefined) { - $ERROR('#1: Array.prototype.reverse.prototype === undefined. Actual: ' + (Array.prototype.reverse.prototype)); -} diff --git a/test/built-ins/Array/prototype/reverse/length.js b/test/built-ins/Array/prototype/reverse/length.js new file mode 100644 index 0000000000000000000000000000000000000000..d969a5ff723a7f380c0da6abd8eab719e3585bea --- /dev/null +++ b/test/built-ins/Array/prototype/reverse/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.reverse +description: > + The "length" property of Array.prototype.reverse +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + 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.prototype.reverse.length, 0); + +verifyNotEnumerable(Array.prototype.reverse, 'length'); +verifyNotWritable(Array.prototype.reverse, 'length'); +verifyConfigurable(Array.prototype.reverse, 'length'); diff --git a/test/built-ins/Array/prototype/reverse/prop-desc.js b/test/built-ins/Array/prototype/reverse/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..c5f0a8348099a8297e2e930b2c30949f43f95d36 --- /dev/null +++ b/test/built-ins/Array/prototype/reverse/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.reverse +description: > + "reverse" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.reverse, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "reverse"); +verifyWritable(Array.prototype, "reverse"); +verifyConfigurable(Array.prototype, "reverse"); diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.1.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.1.js deleted file mode 100644 index 38652362ab54765002ad9c6451808bbe63420ef7..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.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 shift has the attribute DontEnum -es5id: 15.4.4.9_A5.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.shift.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.shift.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.shift.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array.prototype.shift){ - if (p === "length") { - result = false; -} -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.shift) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.2.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.2.js deleted file mode 100644 index a9e197ce3e73dde1bd3c8c23b805b6da4b3d4867..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.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 shift does not have the attribute DontDelete -es5id: 15.4.4.9_A5.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.shift.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.shift.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.shift.hasOwnProperty('length'))); -} - -delete Array.prototype.shift.length; - -//CHECK#2 -if (Array.prototype.shift.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.shift.length; Array.prototype.shift.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.shift.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.shift.length === undefined) { - $ERROR('#3: delete Array.prototype.shift.length; Array.prototype.shift.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.3.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.3.js deleted file mode 100644 index a3c2ea971df96c5f04e6184450715b161cda2bd3..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.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 shift has the attribute ReadOnly -es5id: 15.4.4.9_A5.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.shift.length; -verifyNotWritable(Array.prototype.shift, "length", null, Infinity); -if (Array.prototype.shift.length !== x) { - $ERROR('#1: x = Array.prototype.shift.length; Array.prototype.shift.length = Infinity; Array.prototype.shift.length === x. Actual: ' + (Array.prototype.shift.length)); -} diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.4.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.4.js deleted file mode 100644 index fcc6ab4ef3eee148a4a951cf649f2ef6bb34fd95..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.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 shift is 0 -es5id: 15.4.4.9_A5.4 -description: shift.length === 1 ----*/ - -//CHECK#1 -if (Array.prototype.shift.length !== 0) { - $ERROR('#1: Array.prototype.shift.length === 0. Actual: ' + (Array.prototype.shift.length)); -} diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.5.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.5.js deleted file mode 100644 index b78bd52baab339fcbb82d1254e6aa78599930aae..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.5.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 shift property of Array has the attribute DontEnum -es5id: 15.4.4.9_A5.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('shift') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'shift\') === false. Actual: ' + (Array.propertyIsEnumerable('shift'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "shift") { - result = false; -} -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "shift") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.6.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.6.js deleted file mode 100644 index 4c4043f92c933d594b58bd0a270b2762a928b829..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.6.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 shift property of Array has not prototype property -es5id: 15.4.4.9_A5.6 -description: Checking Array.prototype.shift.prototype ----*/ - -//CHECK#1 -if (Array.prototype.shift.prototype !== undefined) { - $ERROR('#1: Array.prototype.shift.prototype === undefined. Actual: ' + (Array.prototype.shift.prototype)); -} diff --git a/test/built-ins/Array/prototype/shift/length.js b/test/built-ins/Array/prototype/shift/length.js new file mode 100644 index 0000000000000000000000000000000000000000..7f8a08a3dfdb0baebea27e93a416540f3f9fecfe --- /dev/null +++ b/test/built-ins/Array/prototype/shift/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.shift +description: > + The "length" property of Array.prototype.shift +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + 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.prototype.shift.length, 0); + +verifyNotEnumerable(Array.prototype.shift, 'length'); +verifyNotWritable(Array.prototype.shift, 'length'); +verifyConfigurable(Array.prototype.shift, 'length'); diff --git a/test/built-ins/Array/prototype/shift/prop-desc.js b/test/built-ins/Array/prototype/shift/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..5dfe34447da01f88aa969af2edff123e399f5615 --- /dev/null +++ b/test/built-ins/Array/prototype/shift/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.shift +description: > + "shift" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.shift, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "shift"); +verifyWritable(Array.prototype, "shift"); +verifyConfigurable(Array.prototype, "shift"); diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.1.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.1.js deleted file mode 100644 index a9679ef2bf39f53eeed24169ed48a307fbd80c45..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.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 slice has the attribute DontEnum -es5id: 15.4.4.10_A5.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.slice.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.slice.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.slice.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array.prototype.slice){ - if (p === "length") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.slice) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.2.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.2.js deleted file mode 100644 index 24f1bafef27564eca8dbe246cb2a0b3c50bf5ca4..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.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 slice does not have the attribute DontDelete -es5id: 15.4.4.10_A5.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.slice.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.slice.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.slice.hasOwnProperty('length'))); -} - -delete Array.prototype.slice.length; - -//CHECK#2 -if (Array.prototype.slice.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.slice.length; Array.prototype.slice.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.slice.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.slice.length === undefined) { - $ERROR('#3: delete Array.prototype.slice.length; Array.prototype.slice.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.3.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.3.js deleted file mode 100644 index f50e5af1eb45da96dd4a7fcdb4d34911c3c518bc..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.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 slice has the attribute ReadOnly -es5id: 15.4.4.10_A5.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.slice.length; -verifyNotWritable(Array.prototype.slice, "length", null, Infinity); -if (Array.prototype.slice.length !== x) { - $ERROR('#1: x = Array.prototype.slice.length; Array.prototype.slice.length = Infinity; Array.prototypeslice.length === x. Actual: ' + (Array.prototypeslice.length)); -} diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.4.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.4.js deleted file mode 100644 index b166d1f5b84342d3b31a3ee0ee93967398a0d531..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.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 slice is 2 -es5id: 15.4.4.10_A5.4 -description: slice.length === 2 ----*/ - -//CHECK#1 -if (Array.prototype.slice.length !== 2) { - $ERROR('#1: Array.prototype.slice.length === 2. Actual: ' + (Array.prototype.slice.length)); -} diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.5.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.5.js deleted file mode 100644 index 631d05cfae561ef264e6b49058ab71bcab9f1ea8..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.5.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 slice property of Array has the attribute DontEnum -es5id: 15.4.4.10_A5.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('slice') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'slice\') === false. Actual: ' + (Array.propertyIsEnumerable('slice'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "slice") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "slice") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.6.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.6.js deleted file mode 100644 index 529cb789fb283ce98f46741991fcc75d3a563743..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.6.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 slice property of Array has not prototype property -es5id: 15.4.4.10_A5.6 -description: Checking Array.prototype.slice.prototype ----*/ - -//CHECK#1 -if (Array.prototype.slice.prototype !== undefined) { - $ERROR('#1: Array.prototype.slice.prototype === undefined. Actual: ' + (Array.prototype.slice.prototype)); -} diff --git a/test/built-ins/Array/prototype/slice/length.js b/test/built-ins/Array/prototype/slice/length.js new file mode 100644 index 0000000000000000000000000000000000000000..314fc6964e8c1ef975b7cbe4872b2064f5d5af78 --- /dev/null +++ b/test/built-ins/Array/prototype/slice/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.slice +description: > + The "length" property of Array.prototype.slice +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + 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.prototype.slice.length, 2); + +verifyNotEnumerable(Array.prototype.slice, 'length'); +verifyNotWritable(Array.prototype.slice, 'length'); +verifyConfigurable(Array.prototype.slice, 'length'); diff --git a/test/built-ins/Array/prototype/slice/prop-desc.js b/test/built-ins/Array/prototype/slice/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..e587959c3ea1d9650f655005aa30c7e9f24acaea --- /dev/null +++ b/test/built-ins/Array/prototype/slice/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.slice +description: > + "slice" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.slice, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "slice"); +verifyWritable(Array.prototype, "slice"); +verifyConfigurable(Array.prototype, "slice"); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-0-1.js b/test/built-ins/Array/prototype/some/15.4.4.17-0-1.js deleted file mode 100644 index 5631376e0fb055b3f639cb66a58dc4b83d4f4761..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/some/15.4.4.17-0-1.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.17-0-1 -description: Array.prototype.some must exist as a function ----*/ - - var f = Array.prototype.some; - -assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-0-2.js b/test/built-ins/Array/prototype/some/15.4.4.17-0-2.js deleted file mode 100644 index 6d60a2dc4fa628f9983307adeb1d863682e573c1..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/some/15.4.4.17-0-2.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.17-0-2 -description: Array.prototype.some.length must be 1 ----*/ - -assert.sameValue(Array.prototype.some.length, 1, 'Array.prototype.some.length'); diff --git a/test/built-ins/Array/prototype/some/length.js b/test/built-ins/Array/prototype/some/length.js new file mode 100644 index 0000000000000000000000000000000000000000..e52105a07a1fed55ea588e6169e2a10c124516b3 --- /dev/null +++ b/test/built-ins/Array/prototype/some/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.some +description: > + The "length" property of Array.prototype.some +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + 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.prototype.some.length, 1); + +verifyNotEnumerable(Array.prototype.some, 'length'); +verifyNotWritable(Array.prototype.some, 'length'); +verifyConfigurable(Array.prototype.some, 'length'); diff --git a/test/built-ins/Array/prototype/some/prop-desc.js b/test/built-ins/Array/prototype/some/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..421fea30abfcfd5d4b65f4d8124aa00abc1e6864 --- /dev/null +++ b/test/built-ins/Array/prototype/some/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.some +description: > + "some" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.some, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "some"); +verifyWritable(Array.prototype, "some"); +verifyConfigurable(Array.prototype, "some"); diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.1.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.1.js deleted file mode 100644 index eff900aedfdb7b1c7188ae34cee03d273fcab89a..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.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 sort has the attribute DontEnum -es5id: 15.4.4.11_A7.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.sort.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.sort.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.sort.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array.prototype.sort){ - if (p === "length") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.sort) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.2.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.2.js deleted file mode 100644 index daa228ead3aa604f0fe2f933fcf2db143f1882e8..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.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 sort does not have the attribute DontDelete -es5id: 15.4.4.11_A7.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.sort.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.sort.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.sort.hasOwnProperty('length'))); -} - -delete Array.prototype.sort.length; - -//CHECK#2 -if (Array.prototype.sort.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.sort.length; Array.prototype.sort.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.sort.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.sort.length === undefined) { - $ERROR('#3: delete Array.prototype.sort.length; Array.prototype.sort.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.3.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.3.js deleted file mode 100644 index a8497cb9a90c380849f008082b9ac76ec679e3fd..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.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 sort has the attribute ReadOnly -es5id: 15.4.4.11_A7.3 -description: Checking if varying the length fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.sort.length; -verifyNotWritable(Array.prototype.sort, "length", null, Infinity); -if (Array.prototype.sort.length !== x) { - $ERROR('#1: x = Array.prototype.sort.length; Array.prototype.sort.length = Infinity; Array.prototype.sort.length === x. Actual: ' + (Array.prototype.sort.length)); -} diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.4.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.4.js deleted file mode 100644 index fb6fb92fd0a38678e2675e3288965c464f9fdffe..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.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 sort is 1 -es5id: 15.4.4.11_A7.4 -description: sort.length === 1 ----*/ - -//CHECK#1 -if (Array.prototype.sort.length !== 1) { - $ERROR('#1: Array.prototype.sort.length === 1. Actual: ' + (Array.prototype.sort.length)); -} diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.5.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.5.js deleted file mode 100644 index dbe7289ddaed842769eacdeb7f262b080df939f0..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.5.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 sort property of Array has the attribute DontEnum -es5id: 15.4.4.11_A7.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('sort') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'sort\') === false. Actual: ' + (Array.propertyIsEnumerable('sort'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "sort") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "sort") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.6.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.6.js deleted file mode 100644 index 9d37b15b7a62f2ffc95ad65133e01e48d29679ba..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.6.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 sort property of Array has not prototype property -es5id: 15.4.4.11_A7.6 -description: Checking Array.prototype.sort.prototype ----*/ - -//CHECK#1 -if (Array.prototype.sort.prototype !== undefined) { - $ERROR('#1: Array.prototype.sort.prototype === undefined. Actual: ' + (Array.prototype.sort.prototype)); -} diff --git a/test/built-ins/Array/prototype/sort/length.js b/test/built-ins/Array/prototype/sort/length.js new file mode 100644 index 0000000000000000000000000000000000000000..6fe160963a84059e2e7944dd921b59c795d9b6db --- /dev/null +++ b/test/built-ins/Array/prototype/sort/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.sort +description: > + The "length" property of Array.prototype.sort +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + 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.prototype.sort.length, 1); + +verifyNotEnumerable(Array.prototype.sort, 'length'); +verifyNotWritable(Array.prototype.sort, 'length'); +verifyConfigurable(Array.prototype.sort, 'length'); diff --git a/test/built-ins/Array/prototype/sort/prop-desc.js b/test/built-ins/Array/prototype/sort/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..1e2e6d1f1f4059bc378cbb82d5d619d167ae1139 --- /dev/null +++ b/test/built-ins/Array/prototype/sort/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.sort +description: > + "sort" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.sort, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "sort"); +verifyWritable(Array.prototype, "sort"); +verifyConfigurable(Array.prototype, "sort"); diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.1.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.1.js deleted file mode 100644 index 5a1b9297cc94b6a715ff26d3a2dc6c417c9b9fe4..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.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 splice has the attribute DontEnum -es5id: 15.4.4.12_A5.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.splice.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.splice.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.splice.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array.prototype.splice){ - if (p === "length") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.splice) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.2.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.2.js deleted file mode 100644 index 741608e43284a4b2d73797376cc1d11dc4dfd451..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.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 splice does not have the attribute DontDelete -es5id: 15.4.4.12_A5.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.splice.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.splice.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.splice.hasOwnProperty('length'))); -} - -delete Array.prototype.splice.length; - -//CHECK#2 -if (Array.prototype.splice.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.splice.length; Array.prototype.splice.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.splice.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.splice.length === undefined) { - $ERROR('#3: delete Array.prototype.splice.length; Array.prototype.splice.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.3.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.3.js deleted file mode 100644 index 8d250f34114663f83e8d2b6fd19b38a88ee306fa..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.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 splice has the attribute ReadOnly -es5id: 15.4.4.12_A5.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.splice.length; -verifyNotWritable(Array.prototype.splice, "length", null, Infinity); -if (Array.prototype.splice.length !== x) { - $ERROR('#1: x = Array.prototype.splice.length; Array.prototype.splice.length = Infinity; Array.prototype.splice.length === x. Actual: ' + (Array.prototype.splice.length)); -} diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.4.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.4.js deleted file mode 100644 index 43cccec64b58ac7e72740f1f2f867ada1237e739..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.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 splice is 2 -es5id: 15.4.4.12_A5.4 -description: splice.length === 1 ----*/ - -//CHECK#1 -if (Array.prototype.splice.length !== 2) { - $ERROR('#1: Array.prototype.splice.length === 2. Actual: ' + (Array.prototype.splice.length)); -} diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.5.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.5.js deleted file mode 100644 index 824939640040028ba77245fdc8726904c04926c7..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.5.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 splice property of Array has the attribute DontEnum -es5id: 15.4.4.12_A5.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('splice') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'splice\') === false. Actual: ' + (Array.propertyIsEnumerable('splice'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "splice") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "splice") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.6.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.6.js deleted file mode 100644 index ba2034ba631e574476fefe6d7e276540035821ac..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.6.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 splice property of Array has not prototype property -es5id: 15.4.4.12_A5.6 -description: Checking Array.prototype.splice.prototype ----*/ - -//CHECK#1 -if (Array.prototype.splice.prototype !== undefined) { - $ERROR('#1: Array.prototype.splice.prototype === undefined. Actual: ' + (Array.prototype.splice.prototype)); -} diff --git a/test/built-ins/Array/prototype/splice/length.js b/test/built-ins/Array/prototype/splice/length.js new file mode 100644 index 0000000000000000000000000000000000000000..c77eb7eca419ca383ba91b8c5b59918323e7decd --- /dev/null +++ b/test/built-ins/Array/prototype/splice/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.splice +description: > + The "length" property of Array.prototype.splice +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + 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.prototype.splice.length, 2); + +verifyNotEnumerable(Array.prototype.splice, 'length'); +verifyNotWritable(Array.prototype.splice, 'length'); +verifyConfigurable(Array.prototype.splice, 'length'); diff --git a/test/built-ins/Array/prototype/splice/prop-desc.js b/test/built-ins/Array/prototype/splice/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..ca24692efd60bd2e4bf00135d7a573f636ecd7fd --- /dev/null +++ b/test/built-ins/Array/prototype/splice/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.splice +description: > + "splice" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.splice, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "splice"); +verifyWritable(Array.prototype, "splice"); +verifyConfigurable(Array.prototype, "splice"); diff --git a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.1.js b/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.1.js deleted file mode 100644 index 7683cce5f9a4241cb12a4a817c6d3b794f4fe9ed..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.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 toLocaleString has the attribute DontEnum -es5id: 15.4.4.3_A4.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.toLocaleString.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.toLocaleString.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.toLocaleString.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array.prototype.toLocaleString){ - if (p === "length") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.toLocaleString) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.2.js b/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.2.js deleted file mode 100644 index 2bee11f30973973f9fb246874a45b4bf2ea95200..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.2.js +++ /dev/null @@ -1,27 +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 toLocaleString does not have the attribute - DontDelete -es5id: 15.4.4.3_A4.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.toLocaleString.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.toLocaleString.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.toLocaleString.hasOwnProperty('length'))); -} - -delete Array.prototype.toLocaleString.length; - -//CHECK#2 -if (Array.prototype.toLocaleString.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.toLocaleString.length; Array.prototype.toLocaleString.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.toLocaleString.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.toLocaleString.length === undefined) { - $ERROR('#3: delete Array.prototype.toLocaleString.length; Array.prototype.toLocaleString.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.3.js b/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.3.js deleted file mode 100644 index e96f635af4ca171d4cce05d81d9966b4a41436c2..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.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 toLocaleString has the attribute ReadOnly -es5id: 15.4.4.3_A4.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.toLocaleString.length; -verifyNotWritable(Array.prototype.toLocaleString, "length", null, Infinity); -if (Array.prototype.toLocaleString.length !== x) { - $ERROR('#1: x = Array.prototype.toLocaleString.length; Array.prototype.toLocaleString.length = Infinity; Array.prototype.toLocaleString.length === x. Actual: ' + (Array.prototype.toLocaleString.length)); -} diff --git a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.4.js b/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.4.js deleted file mode 100644 index 18d41ff8fbffd1dec56a91072f71df79f524ec06..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.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 toLocaleString is 0 -es5id: 15.4.4.3_A4.4 -description: toLocaleString.length === 1 ----*/ - -//CHECK#1 -if (Array.prototype.toLocaleString.length !== 0) { - $ERROR('#1: Array.prototype.toLocaleString.length === 0. Actual: ' + (Array.prototype.toLocaleString.length)); -} diff --git a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.5.js b/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.5.js deleted file mode 100644 index 83a66f8d325ddd6a6bc0c6a79da5afe3fdd0892a..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.5.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 toLocaleString property of Array has the attribute DontEnum -es5id: 15.4.4.3_A4.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('toLocaleString') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'toLocaleString\') === false. Actual: ' + (Array.propertyIsEnumerable('toLocaleString'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "toLocaleString") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "toLocaleString") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.6.js b/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.6.js deleted file mode 100644 index 7e53a3bee6727dcfb81f6d62cf2681f9e35f9dc8..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.6.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 toLocaleString property of Array has not prototype property -es5id: 15.4.4.3_A4.6 -description: Checking Array.prototype.toLocaleString.prototype ----*/ - -//CHECK#1 -if (Array.prototype.toLocaleString.prototype !== undefined) { - $ERROR('#1: Array.prototype.toLocaleString.prototype === undefined. Actual: ' + (Array.prototype.toLocaleString.prototype)); -} diff --git a/test/built-ins/Array/prototype/toLocaleString/length.js b/test/built-ins/Array/prototype/toLocaleString/length.js new file mode 100644 index 0000000000000000000000000000000000000000..c96a608209e665ca98f89b6a36cbcbc4a5a2e8e3 --- /dev/null +++ b/test/built-ins/Array/prototype/toLocaleString/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.tolocalestring +description: > + The "length" property of Array.prototype.toLocaleString +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + 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.prototype.toLocaleString.length, 0); + +verifyNotEnumerable(Array.prototype.toLocaleString, 'length'); +verifyNotWritable(Array.prototype.toLocaleString, 'length'); +verifyConfigurable(Array.prototype.toLocaleString, 'length'); diff --git a/test/built-ins/Array/prototype/toLocaleString/prop-desc.js b/test/built-ins/Array/prototype/toLocaleString/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..3f33ffda0a1a67f58e90aa73580a0864933eb5f4 --- /dev/null +++ b/test/built-ins/Array/prototype/toLocaleString/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.tolocalestring +description: > + "toLocaleString" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.toLocaleString, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "toLocaleString"); +verifyWritable(Array.prototype, "toLocaleString"); +verifyConfigurable(Array.prototype, "toLocaleString"); diff --git a/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.5.js b/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.5.js deleted file mode 100644 index 678e213f67f0933544d3464306f8086fe5aa3f92..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.5.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 toString property of Array has the attribute DontEnum -es5id: 15.4.4.2_A4.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('toString') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'toString\') === false. Actual: ' + (Array.propertyIsEnumerable('toString'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "toString") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "toString") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.6.js b/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.6.js deleted file mode 100644 index 8a97c2ca75622cb3d663ed968d09aaa0d4a5aefd..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.6.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 toString property of Array has not prototype property -es5id: 15.4.4.2_A4.6 -description: Checking Array.prototype.toString.prototype ----*/ - -//CHECK#1 -if (Array.prototype.toString.prototype !== undefined) { - $ERROR('#1: Array.prototype.toString.prototype === undefined. Actual: ' + (Array.prototype.toString.prototype)); -} diff --git a/test/built-ins/Array/prototype/toString/prop-desc.js b/test/built-ins/Array/prototype/toString/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..c501356656de0cbf0b99b76303215a6a476dfec1 --- /dev/null +++ b/test/built-ins/Array/prototype/toString/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.tostring +description: > + "toString" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.toString, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "toString"); +verifyWritable(Array.prototype, "toString"); +verifyConfigurable(Array.prototype, "toString"); diff --git a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.1.js b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.1.js deleted file mode 100644 index c29476b80060fcc8521e53592f1c5f7fb53cf926..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.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 unshift has the attribute DontEnum -es5id: 15.4.4.13_A5.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.unshift.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.unshift.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.unshift.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array.prototype.unshift){ - if (p === "length") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.unshift) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.2.js b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.2.js deleted file mode 100644 index 4d0dc180752adaf713a006db8c77347604fd6a95..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.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 unshift does not have the attribute DontDelete -es5id: 15.4.4.13_A5.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.unshift.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.unshift.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.unshift.hasOwnProperty('length'))); -} - -delete Array.prototype.unshift.length; - -//CHECK#2 -if (Array.prototype.unshift.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.unshift.length; Array.prototype.unshift.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.unshift.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.unshift.length === undefined) { - $ERROR('#3: delete Array.prototype.unshift.length; Array.prototype.unshift.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.3.js b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.3.js deleted file mode 100644 index cc94d11e9e089591befaf8ce655da9c8831a0e09..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.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 unshift has the attribute ReadOnly -es5id: 15.4.4.13_A5.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.unshift.length; -verifyNotWritable(Array.prototype.unshift, "length", null, Infinity); -if (Array.prototype.unshift.length !== x) { - $ERROR('#1: x = Array.prototype.unshift.length; Array.prototype.unshift.length = Infinity; Array.prototype.unshift.length === x. Actual: ' + (Array.prototype.unshift.length)); -} diff --git a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.4.js b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.4.js deleted file mode 100644 index 6fd20772b7d0d5f6706d0833e72611fbbb1007b3..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.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 unshift is 1 -es5id: 15.4.4.13_A5.4 -description: unshift.length === 1 ----*/ - -//CHECK#1 -if (Array.prototype.unshift.length !== 1) { - $ERROR('#1: Array.prototype.unshift.length === 1. Actual: ' + (Array.prototype.unshift.length)); -} diff --git a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.5.js b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.5.js deleted file mode 100644 index f1897540a5a42dc9df4f9e359568954e99effe1d..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.5.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 unshift property of Array has the attribute DontEnum -es5id: 15.4.4.13_A5.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('unshift') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'unshift\') === false. Actual: ' + (Array.propertyIsEnumerable('unshift'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "unshift") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "unshift") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.6.js b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.6.js deleted file mode 100644 index 086b283df10e1a40d120494aa1b4ed0ec03f9cb7..0000000000000000000000000000000000000000 --- a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.6.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 unshift property of Array has not prototype property -es5id: 15.4.4.13_A5.6 -description: Checking Array.prototype.unshift.prototype ----*/ - -//CHECK#1 -if (Array.prototype.unshift.prototype !== undefined) { - $ERROR('#1: Array.prototype.unshift.prototype === undefined. Actual: ' + (Array.prototype.unshift.prototype)); -} diff --git a/test/built-ins/Array/prototype/unshift/length.js b/test/built-ins/Array/prototype/unshift/length.js new file mode 100644 index 0000000000000000000000000000000000000000..05305348ec8d70b63f9b64eb83863e3a86d5ecf9 --- /dev/null +++ b/test/built-ins/Array/prototype/unshift/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.unshift +description: > + The "length" property of Array.prototype.unshift +info: | + 22.1.3.29 Array.prototype.unshift ( ...items ) + + The length property of the unshift method is 1. + + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + 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.prototype.unshift.length, 1); + +verifyNotEnumerable(Array.prototype.unshift, 'length'); +verifyNotWritable(Array.prototype.unshift, 'length'); +verifyConfigurable(Array.prototype.unshift, 'length'); diff --git a/test/built-ins/Array/prototype/unshift/prop-desc.js b/test/built-ins/Array/prototype/unshift/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..3d6728eed6a0377d3c30cd0960ca0332e9ad698d --- /dev/null +++ b/test/built-ins/Array/prototype/unshift/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.unshift +description: > + "unshift" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.unshift, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "unshift"); +verifyWritable(Array.prototype, "unshift"); +verifyConfigurable(Array.prototype, "unshift");