Reviewers: rossberg, Michael Starzinger,

Message:
Please take a look when you next have a moment.

The encoding/representation of the Symbol wrapper objects is one part I feel
so-so content with. A simple enough implementation of them, but there might well
be better alternatives.

Description:
Upgrade Symbol implementation to match current ES6 behavior.

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 it(Symbol) as a constructor will now throw.

  * ToString() over Symbol values still throws, and
    Object.prototype.toString() stringifies like before.

  * A Symbol value can be boxed/wrapped up in an object via
    Object(symbolValue) or (new Object(symbolValue)).

  * The Symbol wrapper object has a toString() on its prototype,
    (which stringifies as "Symbol(<the description>)") along with a
    valueOf() for returning/unwrapping the 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=
BUG=v8:3053

Please review this at https://codereview.chromium.org/118553003/

SVN Base: git://github.com/v8/v8.git@bleeding_edge

Affected files (+145, -72 lines):
  M src/messages.js
  M src/runtime.h
  M src/runtime.cc
  M src/runtime.js
  M src/symbol.js
  M test/cctest/test-api.cc
  M test/mjsunit/harmony/private.js
  M test/mjsunit/harmony/symbols.js


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to