Template site objects and WeakMap
utatane.tea at gmail.com
Wed Jun 17 18:19:38 UTC 2015
> It turns out the spec is fine <
> step 5 says
> If Type
> (*key*) is not Object, throw a *TypeError* exception.
> as I hoped and expected. The reason I was alarmed is that I got the
> following behavior on v8/iojs:
> > var w = new WeakMap();
> > var r = Symbol.for('foo');
> > w.set(r, true);
> > w.get(r)
> I will file a v8 bug. Please someone, add a test for this to test262.
Ah, I see.
FYI (you may know deeper than I ;)), since symbols are primitive values,
they cannot be used as a WeakMap's key.
And since they are primitive values, they cannot have any properties. It
means that primitive values are immutable.
So Symbol.for / Symbol.keyFor's registry can be WeakMap in the internal
Actually, we implemented so :D http://trac.webkit.org/changeset/182915
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss