Summary: | ES6: Iterator toString names should be consistent | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Joseph Pecoraro <joepeck> | ||||
Component: | JavaScriptCore | Assignee: | Yusuke Suzuki <ysuzuki> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | commit-queue, ggaren, joepeck, ysuzuki | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Created attachment 250491 [details]
Patch
Comment on attachment 250491 [details]
Patch
r=me
Comment on attachment 250491 [details] Patch Clearing flags on attachment: 250491 Committed r182647: <http://trac.webkit.org/changeset/182647> All reviewed patches have been landed. Closing bug. |
* SUMMARY Iterator Object Names in the spec right now have spaces. In our implementation some do and some don't. * TEST js> "string"[Symbol.iterator]().toString() <- "[object StringIterator]" js> (new Map).entries().toString() <- "[object Map Iterator]" We have Map/Set with spaces, but String/Array without spaces. Also, I don't know what would be expected of "ArgumentsIterator" given it is an internal type. * SPEC > 21.1.5.2.2 %StringIteratorPrototype% [ @@toStringTag ] > The initial value of the @@toStringTag property is the string value "String Iterator". > > 22.1.5.2.2 %ArrayIteratorPrototype% [ @@toStringTag ] > The initial value of the @@toStringTag property is the string value "Array Iterator". > > 23.1.5.2.2 %MapIteratorPrototype% [ @@toStringTag ] > The initial value of the @@toStringTag property is the string value "Map Iterator". > > 23.2.5.2.2 %SetIteratorPrototype% [ @@toStringTag ] > The initial value of the @@toStringTag property is the string value "Set Iterator". I think it is weird to have spaces. The spec defines "GeneratorFunction" without a space. Maybe this is something that should change in the spec or be discussed.