-
rossberg@chromium.org authored
Refresh the implementation of Symbols to catch up with what the specification now mandates: * The global Symbol() function manufactures new Symbol values, optionally with a string description attached. * Invoking Symbol() as a constructor will now throw. * ToString() over Symbol values still throws, and Object.prototype.toString() stringifies like before. * A Symbol value is wrapped in a Symbol object either implicitly if it is the receiver, or explicitly done via Object(symbolValue) or (new Object(symbolValue).) * The Symbol.prototype.toString() method no longer throws on Symbol wrapper objects (nor Symbol values.) Ditto for Symbol.prototype.valueOf(). * Symbol.prototype.toString() stringifies as "Symbol("<description>"), valueOf() returns the wrapper's Symbol value. * ToPrimitive() over Symbol wrapper objects now throws. Overall, this provides a stricter separation between Symbol values and wrapper objects than before, and the explicit fetching out of the description (nee name) via the "name" property is no longer supported (by the spec nor the implementation.) Adjusted existing Symbol test files to fit current, adding some extra tests for new/changed behavior. LOG=N R=arv@chromium.org, rossberg@chromium.org, arv, rossberg BUG=v8:3053 Review URL: https://codereview.chromium.org/118553003 Patch from Sigbjorn Finne <sigbjornf@opera.com>. git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19490 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
0d34254f