mirror of https://github.com/tc39/test262.git
Add missing Symbol.iterator feature flags
This commit is contained in:
parent
9f526c0bcd
commit
2bee5df77a
|
@ -5,6 +5,7 @@
|
|||
description: Source object has iterator which throws
|
||||
esid: sec-array.from
|
||||
es6id: 22.1.2.1
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var array = [ 2, 4, 8, 16, 32, 64, 128 ];
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
description: Source object has iterator
|
||||
esid: sec-array.from
|
||||
es6id: 22.1.2.1
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var array = [ 2, 4, 8, 16, 32, 64, 128 ];
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-%arrayiteratorprototype%-@@tostringtag
|
||||
description: >
|
||||
The @@toStringTag attribute should be defined directly on the prototype.
|
||||
es6id: 22.1.5.2.2
|
||||
---*/
|
||||
esid: sec-%arrayiteratorprototype%-@@tostringtag
|
||||
description: >
|
||||
The @@toStringTag attribute should be defined directly on the prototype.
|
||||
es6id: 22.1.5.2.2
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var ArrayIteratorProto = Object.getPrototypeOf([][Symbol.iterator]());
|
||||
|
||||
|
|
|
@ -2,12 +2,13 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-%arrayiteratorprototype%-@@tostringtag
|
||||
description: >
|
||||
`Object.prototype.toString` should honor the value of the @@toStringTag
|
||||
attribute.
|
||||
es6id: 22.1.5.2.2
|
||||
---*/
|
||||
esid: sec-%arrayiteratorprototype%-@@tostringtag
|
||||
description: >
|
||||
`Object.prototype.toString` should honor the value of the @@toStringTag
|
||||
attribute.
|
||||
es6id: 22.1.5.2.2
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var iter = [][Symbol.iterator]();
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ esid: sec-%arrayiteratorprototype%.next
|
|||
description: >
|
||||
Visits each element of the array in order and ceases iteration once all
|
||||
values have been visited.
|
||||
features: [TypedArray]
|
||||
features: [Symbol.iterator, TypedArray]
|
||||
---*/
|
||||
var array = new Float32Array([3, 1, 2]);
|
||||
var iterator = array[Symbol.iterator]();
|
||||
|
|
|
@ -6,7 +6,7 @@ esid: sec-%arrayiteratorprototype%.next
|
|||
description: >
|
||||
Visits each element of the array in order and ceases iteration once all
|
||||
values have been visited.
|
||||
features: [TypedArray]
|
||||
features: [Symbol.iterator, TypedArray]
|
||||
---*/
|
||||
var array = new Float64Array([3, 1, 2]);
|
||||
var iterator = array[Symbol.iterator]();
|
||||
|
|
|
@ -6,7 +6,7 @@ esid: sec-%arrayiteratorprototype%.next
|
|||
description: >
|
||||
Visits each element of the array in order and ceases iteration once all
|
||||
values have been visited.
|
||||
features: [TypedArray]
|
||||
features: [Symbol.iterator, TypedArray]
|
||||
---*/
|
||||
var array = new Int16Array([3, 1, 2]);
|
||||
var iterator = array[Symbol.iterator]();
|
||||
|
|
|
@ -6,7 +6,7 @@ esid: sec-%arrayiteratorprototype%.next
|
|||
description: >
|
||||
Visits each element of the array in order and ceases iteration once all
|
||||
values have been visited.
|
||||
features: [TypedArray]
|
||||
features: [Symbol.iterator, TypedArray]
|
||||
---*/
|
||||
var array = new Int32Array([3, 1, 2]);
|
||||
var iterator = array[Symbol.iterator]();
|
||||
|
|
|
@ -6,7 +6,7 @@ esid: sec-%arrayiteratorprototype%.next
|
|||
description: >
|
||||
Visits each element of the array in order and ceases iteration once all
|
||||
values have been visited.
|
||||
features: [TypedArray]
|
||||
features: [Symbol.iterator, TypedArray]
|
||||
---*/
|
||||
var array = new Int8Array([3, 1, 2]);
|
||||
var iterator = array[Symbol.iterator]();
|
||||
|
|
|
@ -6,7 +6,7 @@ esid: sec-%arrayiteratorprototype%.next
|
|||
description: >
|
||||
Visits each element of the array in order and ceases iteration once all
|
||||
values have been visited.
|
||||
features: [TypedArray]
|
||||
features: [Symbol.iterator, TypedArray]
|
||||
---*/
|
||||
var array = new Uint16Array([3, 1, 2]);
|
||||
var iterator = array[Symbol.iterator]();
|
||||
|
|
|
@ -6,7 +6,7 @@ esid: sec-%arrayiteratorprototype%.next
|
|||
description: >
|
||||
Visits each element of the array in order and ceases iteration once all
|
||||
values have been visited.
|
||||
features: [TypedArray]
|
||||
features: [Symbol.iterator, TypedArray]
|
||||
---*/
|
||||
var array = new Uint32Array([3, 1, 2]);
|
||||
var iterator = array[Symbol.iterator]();
|
||||
|
|
|
@ -6,7 +6,7 @@ esid: sec-%arrayiteratorprototype%.next
|
|||
description: >
|
||||
Visits each element of the array in order and ceases iteration once all
|
||||
values have been visited.
|
||||
features: [TypedArray]
|
||||
features: [Symbol.iterator, TypedArray]
|
||||
---*/
|
||||
var array = new Uint8Array([3, 1, 2]);
|
||||
var iterator = array[Symbol.iterator]();
|
||||
|
|
|
@ -6,7 +6,7 @@ esid: sec-%arrayiteratorprototype%.next
|
|||
description: >
|
||||
Visits each element of the array in order and ceases iteration once all
|
||||
values have been visited.
|
||||
features: [TypedArray]
|
||||
features: [Symbol.iterator, TypedArray]
|
||||
---*/
|
||||
var array = new Uint8ClampedArray([3, 1, 2]);
|
||||
var iterator = array[Symbol.iterator]();
|
||||
|
|
|
@ -7,6 +7,7 @@ description: >
|
|||
Once exhausted, iterators for mapped arguments exotic objects should not
|
||||
emit new values added to the object.
|
||||
flags: [noStrict]
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
(function(a, b, c) {
|
||||
|
|
|
@ -7,6 +7,7 @@ description: >
|
|||
Prior to being exhausted, iterators for mapped arguments exotic objects
|
||||
should honor the insertion of additional argument values.
|
||||
flags: [noStrict]
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
(function(a, b, c) {
|
||||
|
|
|
@ -7,6 +7,7 @@ description: >
|
|||
Mapped arguments exotic objects should implement the Array iterator
|
||||
protocol.
|
||||
flags: [noStrict]
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
(function(a, b, c) {
|
||||
|
|
|
@ -7,6 +7,7 @@ description: >
|
|||
Prior to being exhausted, iterators for mapped arguments exotic objects
|
||||
should honor argument removal.
|
||||
flags: [noStrict]
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
(function(a, b, c) {
|
||||
|
|
|
@ -7,6 +7,7 @@ description: >
|
|||
Once exhausted, iterators for unmapped arguments exotic objects should not
|
||||
emit new values added to the object.
|
||||
flags: [noStrict]
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
(function(a, b, c) {
|
||||
|
|
|
@ -7,6 +7,7 @@ description: >
|
|||
Prior to being exhausted, iterators for unmapped arguments exotic objects
|
||||
should honor the insertion of additional argument values.
|
||||
flags: [noStrict]
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
(function(a, b, c) {
|
||||
|
|
|
@ -7,6 +7,7 @@ description: >
|
|||
Unmapped arguments exotic objects should implement the Array iterator
|
||||
protocol.
|
||||
flags: [noStrict]
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
(function(a, b, c) {
|
||||
|
|
|
@ -7,6 +7,7 @@ description: >
|
|||
Prior to being exhausted, iterators for unmapped arguments exotic objects
|
||||
should honor argument removal.
|
||||
flags: [noStrict]
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
(function(a, b, c) {
|
||||
|
|
|
@ -2,15 +2,16 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-%arrayiteratorprototype%.next
|
||||
description: >
|
||||
When an item is added to the array after the iterator is created but
|
||||
before the iterator is "done" (as defined by 22.1.5.2.1), the new item
|
||||
should be accessible via iteration. When an item is added to the array
|
||||
after the iterator is "done", the new item should not be accessible via
|
||||
iteration.
|
||||
es6id: 22.1.3.30
|
||||
---*/
|
||||
esid: sec-%arrayiteratorprototype%.next
|
||||
description: >
|
||||
When an item is added to the array after the iterator is created but
|
||||
before the iterator is "done" (as defined by 22.1.5.2.1), the new item
|
||||
should be accessible via iteration. When an item is added to the array
|
||||
after the iterator is "done", the new item should not be accessible via
|
||||
iteration.
|
||||
es6id: 22.1.3.30
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var array = [];
|
||||
var iterator = array[Symbol.iterator]();
|
||||
|
|
|
@ -2,12 +2,13 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-%arrayiteratorprototype%.next
|
||||
description: >
|
||||
The method should return a valid iterator with the context as the
|
||||
IteratedObject.
|
||||
es6id: 22.1.3.30
|
||||
---*/
|
||||
esid: sec-%arrayiteratorprototype%.next
|
||||
description: >
|
||||
The method should return a valid iterator with the context as the
|
||||
IteratedObject.
|
||||
es6id: 22.1.3.30
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var array = ['a', 'b', 'c'];
|
||||
var iterator = array[Symbol.iterator]();
|
||||
|
|
|
@ -21,6 +21,7 @@ info: >
|
|||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var ArrayIteratorProto = Object.getPrototypeOf([][Symbol.iterator]());
|
||||
|
|
|
@ -18,6 +18,7 @@ info: >
|
|||
object, if it exists, has the attributes { [[Writable]]: false,
|
||||
[[Enumerable]]: false, [[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var ArrayIteratorProto = Object.getPrototypeOf([][Symbol.iterator]());
|
||||
|
|
|
@ -2,12 +2,13 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: >
|
||||
If the `this` value does not have all of the internal slots of an Array
|
||||
Iterator Instance (22.1.5.3), throw a TypeError exception.
|
||||
es6id: 22.1.5.2.1
|
||||
esid: sec-%arrayiteratorprototype%.next
|
||||
---*/
|
||||
description: >
|
||||
If the `this` value does not have all of the internal slots of an Array
|
||||
Iterator Instance (22.1.5.3), throw a TypeError exception.
|
||||
es6id: 22.1.5.2.1
|
||||
esid: sec-%arrayiteratorprototype%.next
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var array = [0];
|
||||
var iterator = array[Symbol.iterator]();
|
||||
|
|
|
@ -2,13 +2,14 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-%arrayiteratorprototype%.next
|
||||
description: >
|
||||
The method should exist on the ArrayIterator prototype, and it should be
|
||||
writable and configurable, but not enumerable.
|
||||
includes: [propertyHelper.js]
|
||||
es6id: 17
|
||||
---*/
|
||||
esid: sec-%arrayiteratorprototype%.next
|
||||
description: >
|
||||
The method should exist on the ArrayIterator prototype, and it should be
|
||||
writable and configurable, but not enumerable.
|
||||
includes: [propertyHelper.js]
|
||||
es6id: 17
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var ArrayIteratorProto = Object.getPrototypeOf([][Symbol.iterator]());
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ description: >
|
|||
f. Let status be Call(adder, set, «nextValue.[[value]]»).
|
||||
g. If status is an abrupt completion, return IteratorClose(iter, status).
|
||||
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var count = 0;
|
||||
|
|
|
@ -11,6 +11,7 @@ description: >
|
|||
9. Repeat
|
||||
a. Let next be IteratorStep(iter).
|
||||
b. ReturnIfAbrupt(next).
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var iterable = {};
|
||||
|
|
|
@ -12,6 +12,7 @@ description: >
|
|||
...
|
||||
d. Let nextValue be IteratorValue(next).
|
||||
e. ReturnIfAbrupt(nextValue).
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var count = 0;
|
||||
|
|
|
@ -5,6 +5,7 @@ es6id: 21.1.5.2
|
|||
description: >
|
||||
The [[Prototype]] internal slot ofthe %StringIteratorPrototype% is the
|
||||
%IteratorPrototype% intrinsic object (25.1.2).
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var strItrProto = Object.getPrototypeOf(''[Symbol.iterator]());
|
||||
|
|
|
@ -17,6 +17,7 @@ info: >
|
|||
object, if it exists, has the attributes { [[Writable]]: false,
|
||||
[[Enumerable]]: false, [[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var StringIteratorProto = Object.getPrototypeOf(new String()[Symbol.iterator]());
|
||||
|
|
|
@ -5,6 +5,7 @@ es6id: 21.1.5.2.1
|
|||
description: >
|
||||
Iteration should respect UTF-16-encoded Unicode code points specified via
|
||||
surrogate pairs.
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var lo = '\uD834';
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
es6id: 21.1.5.2.1
|
||||
description: >
|
||||
Iteration should visit each UTF-8 code point exactly once.
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var string = "abc";
|
||||
|
|
|
@ -5,6 +5,7 @@ es6id: 21.1.5.2.1 S 3
|
|||
description: >
|
||||
If the `this` value does not have all of the internal slots of an String
|
||||
Iterator Instance (21.1.5.3), throw a `TypeError` exception.
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var iterator = ''[Symbol.iterator]();
|
||||
|
|
|
@ -12,7 +12,7 @@ info: >
|
|||
3. Assert: GlobalSymbolRegistry does not currently contain an entry for
|
||||
sym.
|
||||
4. Return undefined.
|
||||
features: [Symbol]
|
||||
features: [Symbol.iterator, Symbol]
|
||||
---*/
|
||||
|
||||
var constructed = Symbol('Symbol.iterator');
|
||||
|
|
|
@ -12,6 +12,7 @@ info: >
|
|||
9. Repeat
|
||||
k. Let status be Call(adder, map, «k.[[value]], v.[[value]]»).
|
||||
l. If status is an abrupt completion, return IteratorClose(iter, status).
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var count = 0;
|
||||
|
|
|
@ -13,6 +13,7 @@ info: >
|
|||
a. Let next be IteratorStep(iter).
|
||||
b. ReturnIfAbrupt(next).
|
||||
...
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var iterable = {};
|
||||
|
|
|
@ -14,6 +14,7 @@ info: >
|
|||
d. Let nextItem be IteratorValue(next).
|
||||
e. ReturnIfAbrupt(nextItem).
|
||||
...
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var iterable = {};
|
||||
|
|
|
@ -12,6 +12,7 @@ info: >
|
|||
9. Repeat
|
||||
f. Let status be Call(adder, set, «nextValue»).
|
||||
g. If status is an abrupt completion, return IteratorClose(iter, status).
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var count = 0;
|
||||
|
|
|
@ -13,6 +13,7 @@ info: >
|
|||
a. Let next be IteratorStep(iter).
|
||||
b. ReturnIfAbrupt(next).
|
||||
...
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var iterable = {};
|
||||
|
|
|
@ -13,6 +13,7 @@ info: >
|
|||
...
|
||||
d. Let nextValue be IteratorValue(next).
|
||||
e. ReturnIfAbrupt(nextValue).
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var count = 0;
|
||||
|
|
|
@ -5,6 +5,7 @@ es6id: 25.2
|
|||
description: >
|
||||
When an iterator is the operand of a `yield *` expression, the generator
|
||||
should produce an iterator that visits each iterated item.
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var results = [{ value: 1 }, { value: 8 }, { value: 34, done: true }];
|
||||
|
|
|
@ -6,7 +6,7 @@ description: >
|
|||
The [[DefineOwnProperty]] internal method returns `true` if no change is
|
||||
requested, and `false` otherwise.
|
||||
flags: [module]
|
||||
features: [Reflect, Symbol, Symbol.toStringTag]
|
||||
features: [Symbol.iterator, Reflect, Symbol, Symbol.toStringTag]
|
||||
---*/
|
||||
|
||||
import * as ns from './define-own-property.js';
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: >
|
||||
The method should return a valid iterator that can be traversed using a
|
||||
`for...of` loop.
|
||||
es6id: 22.1.3.30
|
||||
---*/
|
||||
description: >
|
||||
The method should return a valid iterator that can be traversed using a
|
||||
`for...of` loop.
|
||||
es6id: 22.1.3.30
|
||||
features: [Symbol.iterator]
|
||||
---*/
|
||||
|
||||
var array = [0, 'a', true, false, null, /* hole */, undefined, NaN];
|
||||
var i = 0;
|
||||
|
|
Loading…
Reference in New Issue