* 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?
<rdar://problem/19690733>
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