diff --git a/test/built-ins/Array/prototype/values/length.js b/test/built-ins/Array/prototype/values/length.js new file mode 100644 index 0000000000..f09c1c080b --- /dev/null +++ b/test/built-ins/Array/prototype/values/length.js @@ -0,0 +1,25 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 22.1.3.29 +description: Array.prototype.values `length` property +info: > + ES6 Section 17: + 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, including optional parameters. + + [...] + + 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.values.length, 0); + +verifyNotEnumerable(Array.prototype.values, 'length'); +verifyNotWritable(Array.prototype.values, 'length'); +verifyConfigurable(Array.prototype.values, 'length'); diff --git a/test/built-ins/Array/prototype/values/name.js b/test/built-ins/Array/prototype/values/name.js new file mode 100644 index 0000000000..28087e8725 --- /dev/null +++ b/test/built-ins/Array/prototype/values/name.js @@ -0,0 +1,26 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 22.1.3.29 +description: Array.prototype.values `name` property +info: > + ES6 Section 17: + + 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.prototype.values.name, 'values'); + +verifyNotEnumerable(Array.prototype.values, 'name'); +verifyNotWritable(Array.prototype.values, 'name'); +verifyConfigurable(Array.prototype.values, 'name'); diff --git a/test/built-ins/Array/prototype/values/prop-desc.js b/test/built-ins/Array/prototype/values/prop-desc.js new file mode 100644 index 0000000000..87064a61d8 --- /dev/null +++ b/test/built-ins/Array/prototype/values/prop-desc.js @@ -0,0 +1,17 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 22.1.3.29 +description: Array.prototype.values property descriptor +info: > + 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.values, 'function'); + +verifyNotEnumerable(Array.prototype, 'values'); +verifyWritable(Array.prototype, 'values'); +verifyConfigurable(Array.prototype, 'values'); diff --git a/test/built-ins/Array/prototype/values/this-val-non-obj-coercible.js b/test/built-ins/Array/prototype/values/this-val-non-obj-coercible.js new file mode 100644 index 0000000000..92355a44dc --- /dev/null +++ b/test/built-ins/Array/prototype/values/this-val-non-obj-coercible.js @@ -0,0 +1,18 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 22.1.3.29 +description: > + `this` value not object coercible +info: > + 1. Let O be ToObject(this value). + 2. ReturnIfAbrupt(O). +---*/ + +assert.throws(TypeError, function() { + Array.prototype.values.call(undefined); +}); + +assert.throws(TypeError, function() { + Array.prototype.values.call(null); +});