mirror of https://github.com/tc39/test262.git
Add tests for Array.prototype.values
This commit is contained in:
parent
5cb1ba27d3
commit
761c384d7c
|
@ -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');
|
|
@ -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');
|
|
@ -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');
|
|
@ -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);
|
||||
});
|
Loading…
Reference in New Issue