Re: es7 proposal/polyfill?: base Map/WeakMap off Proxy + Weak References

2016-02-22 Thread Steve Fink
On 02/19/2016 01:06 PM, Coroutines wrote: On Fri, Feb 19, 2016 at 1:03 PM, Tab Atkins Jr. wrote: On Fri, Feb 19, 2016 at 12:59 PM, Boris Zbarsky wrote: On 2/19/16 3:50 PM, Coroutines wrote: Side discussion: Why does Javascript have this limitation? -

Re: es7 proposal/polyfill?: base Map/WeakMap off Proxy + Weak References

2016-02-19 Thread Coroutines
On Fri, Feb 19, 2016 at 1:03 PM, Tab Atkins Jr. wrote: > On Fri, Feb 19, 2016 at 12:59 PM, Boris Zbarsky wrote: >> On 2/19/16 3:50 PM, Coroutines wrote: >>> Side discussion: Why does Javascript have this limitation? - what I >>> view as a limitation?

Re: es7 proposal/polyfill?: base Map/WeakMap off Proxy + Weak References

2016-02-19 Thread Tab Atkins Jr.
On Fri, Feb 19, 2016 at 12:59 PM, Boris Zbarsky wrote: > On 2/19/16 3:50 PM, Coroutines wrote: >> Side discussion: Why does Javascript have this limitation? - what I >> view as a limitation? You'd think this could be supported without >> breaking older JS.. > > I don't see how

Re: es7 proposal/polyfill?: base Map/WeakMap off Proxy + Weak References

2016-02-19 Thread Boris Zbarsky
On 2/19/16 3:50 PM, Coroutines wrote: Side discussion: Why does Javascript have this limitation? - what I view as a limitation? You'd think this could be supported without breaking older JS.. I don't see how it could. I'll bet $50 someone out there is using obj[location] for example.

Re: es7 proposal/polyfill?: base Map/WeakMap off Proxy + Weak References

2016-02-19 Thread Coroutines
On Fri, Feb 19, 2016 at 4:40 AM, Thomas Foster wrote: > Not sure where you got that idea, but aren't the objects just being converted > to string property names? Huh. I was so certain Node allowed that - I guess I just never made use of it. I knew that 'legally'

Re: es7 proposal/polyfill?: base Map/WeakMap off Proxy + Weak References

2016-02-19 Thread Thomas
> Map's API could just go away and follow traditional Object assignment > and existence checks: > > map[key] = value; > > // wish JS had a null-coalescing `?` operator like Coffeescript.. > if (map[key] !== undefined || map[key] !== null) { ... } > > It's totally legal in non-Node JS to have

Re: es7 proposal/polyfill?: base Map/WeakMap off Proxy + Weak References

2016-02-19 Thread Mark S. Miller
On Fri, Feb 19, 2016 at 1:17 AM, Coroutines wrote: > Hi - I hope I am not suggesting something that has been said before ~ > > Having Proxy and eventual Weak References makes it possible to build > Map/WeakMap in plain JS - nothing in hidden, 'native code' (C++). > Not

es7 proposal/polyfill?: base Map/WeakMap off Proxy + Weak References

2016-02-19 Thread Coroutines
Hi - I hope I am not suggesting something that has been said before ~ Having Proxy and eventual Weak References makes it possible to build Map/WeakMap in plain JS - nothing in hidden, 'native code' (C++). I'd like to propose basing them off of these when Weak References are a 'thing'. Map's API