RESOLVED FIXED 141173
Web Inspector: ES6: Improved Console Support for Symbol Objects
https://bugs.webkit.org/show_bug.cgi?id=141173
Summary Web Inspector: ES6: Improved Console Support for Symbol Objects
Joseph Pecoraro
Reported 2015-02-02 14:33:31 PST
* SUMMARY JSC got ES6 Symbol support in: http://trac.webkit.org/changeset/179429 We should do a good job with Symbols in the Console. (1) Formatting Symbol Objects js> Symbol("test") ACTUAL => Symbol EXPECT => Symbol(test) (2) Showing Symbol properties on Objects js> var o = {}; o[Symbol("test")] = 1; o; ACTUAL => {} EXPECT => {Symbol("test"): 1} Note, for (2) we may need Object.getOwnPropertySymbols, which doesn't look like JSC has yet. Anything else that might be useful for Symbols?
Attachments
[PATCH] Proposed Fix (12.98 KB, patch)
2015-02-03 19:05 PST, Joseph Pecoraro
timothy: review+
[IMAGE] Symbol Appearance (100.04 KB, image/png)
2015-02-03 19:05 PST, Joseph Pecoraro
no flags
Radar WebKit Bug Importer
Comment 1 2015-02-02 14:34:03 PST
Joseph Pecoraro
Comment 2 2015-02-02 14:40:21 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!
Joseph Pecoraro
Comment 3 2015-02-02 14:46:14 PST
> (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}
Joseph Pecoraro
Comment 4 2015-02-02 14:49:35 PST
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).
Joseph Pecoraro
Comment 5 2015-02-03 19:05:16 PST
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.
Joseph Pecoraro
Comment 6 2015-02-03 19:05:50 PST
Created attachment 246007 [details] [IMAGE] Symbol Appearance
Joseph Pecoraro
Comment 7 2015-02-04 19:15:42 PST
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
Note You need to log in before you can comment on or make changes to this bug.