| Summary: | Web Inspector: ES6: Improved Console Support for Symbol Objects | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Joseph Pecoraro <joepeck> | ||||||
| Component: | Web Inspector | Assignee: | Nobody <webkit-unassigned> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | ggaren, graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer, ysuzuki | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | 528+ (Nightly build) | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Attachments: |
|
||||||||
|
Description
Joseph Pecoraro
2015-02-02 14:33:31 PST
Note inspector is already complaining in a few places that it doesn't know about symbols, since it is a new default type:
js> typeof Symbol("test")
"symbol"
I'll probably have to look into this sooner than later!
> (2) Showing Symbol properties on Objects
>
> js> var o = {}; o[Symbol("test")] = 1; o;
> ACTUAL => {}
> EXPECT => {Symbol("test"): 1}
Err, the EXPECT should have been {Symbol(test): 1}
Another note about Symbols:
js> "" + Symbol("test")
TypeError: Type error
However, String() works:
js> String(Symbol("test"))
"Symbol(test)"
So we likely have to update InjectedScriptSource's stringification to use String() or move away from (""+o).
Created attachment 246006 [details]
[PATCH] Proposed Fix
This handles (1). I'll have to address (2) "symbol properties on objects" separately. Ideally once we get Object.getOwnPropertySymbols in JavaScriptCore.
Created attachment 246007 [details]
[IMAGE] Symbol Appearance
http://trac.webkit.org/changeset/179659 Part (2) to be covered by bug 141279: <https://webkit.org/b/141279> Web Inspector: ES6: Show Symbol properties on Objects |