Re: Relationship between globals, Realms, and global environment records

2014-11-26 Thread Anne van Kesteren
On Wed, Nov 26, 2014 at 1:48 AM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: Given that ES6 doesn't have a public Realm API it really doesn't make much difference. Why not? Currently HTML overrides to make the existing setup work... That's the whole reason we wanted to change this in the

Removal of WeakMap/WeakSet clear

2014-11-26 Thread Katelyn Gadd
Is there a detailed rationale for this somewhere? Making typical applications pay the cost here for a specific security scenario seems really bizarre to me. Clearing standard library data structures is an incredibly common operation. If you want to ensure that someone can't clear the map/set,

Re: Removal of WeakMap/WeakSet clear

2014-11-26 Thread Claude Pache
The root of the issue, is that WeakMaps are thought as a tool for two unrelated use cases. Quoting [1]: (...) WeakMaps were motivate[d] by two distinct use cases. Soft fields and object-keyed caches. Now, in short, for the soft fields use case, a `.clear()` method is unwanted, but for the

Re: Removal of WeakMap/WeakSet clear

2014-11-26 Thread Allen Wirfs-Brock
On Nov 26, 2014, at 10:22 AM, Claude Pache wrote: The root of the issue, is that WeakMaps are thought as a tool for two unrelated use cases. Quoting [1]: (...) WeakMaps were motivate[d] by two distinct use cases. Soft fields and object-keyed caches. Now, in short, for the soft

RE: Removal of WeakMap/WeakSet clear

2014-11-26 Thread Andrea Giammarchi
Agreed, and i believe the only real reason would be the inability to polyfill it properly, in order to discourage its usage. If this is why, it doesn't justify its drop, imo -Original Message- From: Katelyn Gadd k...@luminance.org Sent: ‎26/‎11/‎2014 17:33 To: es-discuss

Re: Removal of WeakMap/WeakSet clear

2014-11-26 Thread Mark S. Miller
On Wed, Nov 26, 2014 at 9:33 AM, Katelyn Gadd k...@luminance.org wrote: Is there a detailed rationale for this somewhere? It is a combination of three issues. 1. The security issue. 2. The implementation issue. 3. The ES process issue. The implementation issue is that the use cases for

Re: Removal of WeakMap/WeakSet clear

2014-11-26 Thread Mark S. Miller
On Wed, Nov 26, 2014 at 11:09 AM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Nov 26, 2014, at 10:22 AM, Claude Pache wrote: The root of the issue, is that WeakMaps are thought as a tool for two unrelated use cases. Quoting [1]: (...) WeakMaps were motivate[d] by two distinct use

Re: Removal of WeakMap/WeakSet clear

2014-11-26 Thread Tab Atkins Jr.
On Wed, Nov 26, 2014 at 11:23 AM, Mark S. Miller erig...@google.com wrote: On Wed, Nov 26, 2014 at 11:09 AM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Nov 26, 2014, at 10:22 AM, Claude Pache wrote: The root of the issue, is that WeakMaps are thought as a tool for two unrelated use

Re: Removal of WeakMap/WeakSet clear

2014-11-26 Thread Allen Wirfs-Brock
On Nov 26, 2014, at 11:25 AM, Tab Atkins Jr. wrote: On Wed, Nov 26, 2014 at 11:23 AM, Mark S. Miller erig...@google.com wrote: On Wed, Nov 26, 2014 at 11:09 AM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Nov 26, 2014, at 10:22 AM, Claude Pache wrote: The root of the issue, is

Re: Removal of WeakMap/WeakSet clear

2014-11-26 Thread Katelyn Gadd
The detailed explanations are helpful for understanding this, at least when it comes to WeakMap. Thanks. I was not aware that clear() was a tenative addition - MDN (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) lists it as available in all the major

Re: Removal of WeakMap/WeakSet clear

2014-11-26 Thread Brendan Eich
Katelyn Gadd wrote: However: Does this mean that if I implement clear myself by creating new WeakMaps, i'm inadvertently doing horrible things to the GC? Assume yes (only defensive assumption). What goes wrong? Sorry if I missed it: what is your .clear use case, in example code? /be

Re: Removal of WeakMap/WeakSet clear

2014-11-26 Thread Mark S. Miller
On Wed, Nov 26, 2014 at 2:49 PM, Katelyn Gadd k...@luminance.org wrote: The detailed explanations are helpful for understanding this, at least when it comes to WeakMap. Thanks. I was not aware that clear() was a tenative addition - MDN