Maps and WeakMaps interoperability

David Bruant bruant.d at
Tue Dec 27 07:15:49 PST 2011


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);, key); // ?

Currently Chrome canary says "illegal access".
Is it the behavior that is wished for the features?
My question obviously extends to Sets and any other such abstraction
that would be considered in the future.



More information about the es-discuss mailing list