RESOLVED FIXED 157288
Web Inspector: Reflect.toString() should be [object Object] not [object Reflect]
https://bugs.webkit.org/show_bug.cgi?id=157288
Summary Web Inspector: Reflect.toString() should be [object Object] not [object Reflect]
Joseph Pecoraro
Reported 2016-05-02 17:08:07 PDT
* SUMMARY Web Inspector: Reflect.toString() should be [object Object] not [object Reflect] <https://github.com/tc39/ecma262/issues/495> <https://github.com/tc39/ecma262/issues/495#issuecomment-201909471> > No, this was intentional decision. > > [snip] > > Reflect isn't a "class", it is just namespace defined using an ordinary object. > Such name space objects are now widely used in JS code and typically don't have > custom toString behavior. So we followed the precedent of ECMA-402 Intl and did > not give Reflect its own @@toStringTag > > Part of the motivation, was a desire during ES6 that we should minimize the > specialness of builtins. In general, we wanted built-ins to be as much as > possible just ordinary objects that might be implemented by everyday JS > programmers and hence the builtins should generally follow the same > conventions as we expect ordinary JS programmers to follow. For the > class-like buildins we established a new convention of using @@toString on > the prototype to name class instances. Hopefully that is a convention that > will catch on with JS programmers. For namespace objects like Reflect we > expect JS programmers to continue to use direct object instance (often > constructed via object literals) and that they typically won't give them > unique @@toStringTag properties. So most name spaces including Intl and > Reflect will print as "[object Object]".
Attachments
[PATCH] Proposed Fix (1.93 KB, patch)
2016-05-02 17:08 PDT, Joseph Pecoraro
no flags
Joseph Pecoraro
Comment 1 2016-05-02 17:08:40 PDT
Created attachment 277947 [details] [PATCH] Proposed Fix
WebKit Commit Bot
Comment 2 2016-05-02 18:59:46 PDT
Comment on attachment 277947 [details] [PATCH] Proposed Fix Clearing flags on attachment: 277947 Committed r200355: <http://trac.webkit.org/changeset/200355>
WebKit Commit Bot
Comment 3 2016-05-02 18:59:51 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.