-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Description
For some reason, Object literal extensions involving Symbols (like creating your own @@iterable) doesn't seem to be working; an example of usage that works within 6t05, Traceur, and es6fiddle.net is below this paragraph as a code snippet:
let fooCollection = {
itemsToIterate = [],
*[Symbol.iterator](){
yield *this.itemsToIterate.values();
}
fooCollection.items.push(1);
fooCollection.items.push(2);
fooCollection.items.push(3);
for ( let itemToIterate of FooCollection){
console.log(itemToIterate);
}Here's successful example running within ES6 Fiddle I've screen captured as well:

Seemingly, including the fact literal shorthands of declaring properties also doesn't work for me with iojs at the moment, the docs may need to be edited to omit Object literal extensions being covered by --es_staging or --harmony
The error typically thrown by iojs when running scripts attempting to use object literal extensions is screen captured below:

Metadata
Metadata
Assignees
Labels
No labels