Bug 142424 - ES6: Iterator toString names should be consistent
Summary: ES6: Iterator toString names should be consistent
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-06 18:16 PST by Joseph Pecoraro
Modified: 2015-04-10 18:01 PDT (History)
4 users (show)

See Also:


Attachments
Patch (3.68 KB, patch)
2015-04-09 18:08 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2015-03-06 18:16:53 PST
* 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.
Comment 1 Yusuke Suzuki 2015-04-09 18:08:07 PDT
Created attachment 250491 [details]
Patch
Comment 2 Geoffrey Garen 2015-04-10 11:30:45 PDT
Comment on attachment 250491 [details]
Patch

r=me
Comment 3 WebKit Commit Bot 2015-04-10 18:01:05 PDT
Comment on attachment 250491 [details]
Patch

Clearing flags on attachment: 250491

Committed r182647: <http://trac.webkit.org/changeset/182647>
Comment 4 WebKit Commit Bot 2015-04-10 18:01:09 PDT
All reviewed patches have been landed.  Closing bug.