google / traceur-compiler

Traceur is a JavaScript.next-to-JavaScript-of-today compiler
Apache License 2.0
8.17k stars 580 forks source link

Basic implementation of WeakMap/WeakSet #1984

Closed arv closed 8 years ago

arv commented 9 years ago

Uses an expando on the key

Issue #898

arv commented 9 years ago

@johnjbarton PTAL

The motivation for finally doing this is that I want to get rid of our createPrivateName and replace all of those with weak maps.

arv commented 9 years ago

This does not handle non extensible/frozen objects but we can update to support that and or just switch to core-js (see issue #1976).

johnjbarton commented 9 years ago

LGTM, though using eg corejs is attractive from the maintenance viewpoint.

arv commented 8 years ago

I realized this was still pending. I added support for frozen keys (which have to be strongly held) as well as fixed few issues regarding non object keys.

PTAL.

arv commented 8 years ago

TODO: Handle the case where a key gets added and then later gets frozen...

arv commented 8 years ago

I thought more about the case where a key is later frozen. It gets complicated and I don't think it is worth supporting at this point.