Re: Maps and WeakMaps interoperability

2012-01-02 Thread Andreas Rossberg
On 27 December 2011 16:15, David Bruant 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 ___

Re: Maps and WeakMaps interoperability

2011-12-28 Thread Allen Wirfs-Brock
On Dec 27, 2011, at 10:29 AM, David Bruant wrote: > Le 27/12/2011 19:14, Mark S. Miller a écrit : >> >> On Tue, Dec 27, 2011 at 7:15 AM, David Bruant wrote: >> ... >> That's what I wish. JS already has name-based polymorphism (as is typical of >> scripting languages). Generic methods, such as

Re: Maps and WeakMaps interoperability

2011-12-27 Thread David Bruant
Le 27/12/2011 19:14, Mark S. Miller a écrit : > On Tue, Dec 27, 2011 at 7:15 AM, David Bruant > wrote: > > Hi, > > Maps [1] and WeakMaps [2] are very similar in their API. Since neither > proposal discusses how they should interact with each other, I was >

Re: Maps and WeakMaps interoperability

2011-12-27 Thread Mark S. Miller
On Tue, Dec 27, 2011 at 7:15 AM, David Bruant wrote: > Hi, > > Maps [1] and WeakMaps [2] are very similar in their API. Since neither > proposal discusses how they should interact with each other, I was > wondering what is supposed to happen when trying to use the API of one > on the other. > ---

Maps and WeakMaps interoperability

2011-12-27 Thread David Bruant
Hi, Maps [1] and WeakMaps [2] are very similar in their API. Since neither proposal discusses how they should interact with each other, I was wondering what is supposed to happen when trying to use the API of one on the other. - var m = new Map(); var key = {}; m.set(key, 37); WeakMap.prototy