Bug 157288

Summary: Web Inspector: Reflect.toString() should be [object Object] not [object Reflect]
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: JavaScriptCoreAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, keith_miller, mark.lam, msaboff, saam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix none

Description Joseph Pecoraro 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]".
Comment 1 Joseph Pecoraro 2016-05-02 17:08:40 PDT
Created attachment 277947 [details]
[PATCH] Proposed Fix
Comment 2 WebKit Commit Bot 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>
Comment 3 WebKit Commit Bot 2016-05-02 18:59:51 PDT
All reviewed patches have been landed.  Closing bug.