Template site objects and WeakMap

Mark S. Miller erights at google.com
Wed Jun 17 18:14:29 UTC 2015

On Wed, Jun 17, 2015 at 9:31 AM, Yusuke SUZUKI <utatane.tea at gmail.com>

> On Thu, Jun 18, 2015 at 1:18 AM, Mark S. Miller <erights at google.com>
> wrote:
>> [+Allen]
>> Can registered Symbols be used as keys in WeakMaps? If so, we have a
>> fatal unauthorized communications channel that we need to fix in the spec
>> asap!
> Why do registered Symbols appear? (oops, maybe I missed some context...)
> User exposed WeakMap only accepts objects as a key.

On Wed, Jun 17, 2015 at 10:00 AM, Benjamin Gruenbaum <inglor at gmail.com>

> Aren't WeakMap keys only objects?

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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150617/59aa75a6/attachment.html>

More information about the es-discuss mailing list