Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@@toStringTag #91

Open
zloirock opened this issue Apr 25, 2016 · 5 comments · May be fixed by #198
Open

@@toStringTag #91

zloirock opened this issue Apr 25, 2016 · 5 comments · May be fixed by #198

Comments

@zloirock
Copy link
Contributor

@@toStringTag definitely should be added to all instances from this proposal.

@domenic
Copy link
Member

domenic commented Apr 25, 2016

Nope. New things (like Map, Set, Promise, user-defined classes ... and Observable) don't get toStringTag. It's a legacy language feature added to preserve back-compat.

@zloirock
Copy link
Contributor Author

Nope. New things (like Map, Set, Promise, user-defined classes ... and Observable) don't get toStringTag.

Seriously? :)

Map.prototype[Symbol.toStringTag]; // => "Map"
Object.getPrototypeOf(new Map().values())[Symbol.toStringTag]; // => "Map Iterator"
Promise.prototype[Symbol.toStringTag]; // => "Promise"
SIMD.Float32x4.prototype[Symbol.toStringTag]; // => "SIMD.Float32x4"

@domenic
Copy link
Member

domenic commented Apr 25, 2016

You're right, I was confusing this with another toString-related spec thing. Apologies.

@benjamingr
Copy link

Looks like it's defined for everything separately, http://www.ecma-international.org/ecma-262/6.0/#sec-promise.prototype-@@tostringtag I was thinking species :D

@jhusain
Copy link
Collaborator

jhusain commented Dec 31, 2016

Certainly seems like this should be done. Will try and get around to this prior to the next meeting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants