Maps and WeakMaps interoperability

Andreas Rossberg rossberg at google.com
Mon Jan 2 03:30:57 PST 2012


On 27 December 2011 16:15, David Bruant <bruant.d at gmail.com> wrote:
> -----
> var m = new Map();
> var key = {};
> m.set(key, 37);
>
> WeakMap.prototype.get.call(m, key); // ?
> -----
>
> Currently Chrome canary says "illegal access".

That is a bug. It should throw TypeError.

/Andreas


More information about the es-discuss mailing list