Re: Removal of WeakMap/WeakSet clear

2014-12-04 Thread Andreas Rossberg
On 4 December 2014 at 00:54, David Bruant bruan...@gmail.com wrote: The way I see it, data structures are a tool to efficiently query data. They don't *have* to be arbitrarily mutable anytime for this purpose. It's a point of view problem, but in my opinion, mutability is the problem, not

Re: Figuring out the behavior of WindowProxy in the face of non-configurable properties

2014-12-04 Thread Boris Zbarsky
On 11/30/14, 6:12 PM, Mark S. Miller wrote: On Sun, Nov 30, 2014 at 12:21 PM, Boris Zbarsky bzbar...@mit.edu wrote: Per spec ES6, it seems to me like attempting to define a non-configurable property on a WindowProxy should throw and getting a property descriptor for a non-configurable property

Re: Removal of WeakMap/WeakSet clear

2014-12-04 Thread David Bruant
Le 04/12/2014 09:55, Andreas Rossberg a écrit : On 4 December 2014 at 00:54, David Bruant bruan...@gmail.com wrote: The way I see it, data structures are a tool to efficiently query data. They don't *have* to be arbitrarily mutable anytime for this purpose. It's a point of view problem, but in

Re: Removal of WeakMap/WeakSet clear

2014-12-04 Thread Katelyn Gadd
There are scenarios where both security and performance matter. I think this is more than self-evident at this point in the thread since examples of both have been provided repeatedly. 'can you demonstrate there are no such scenario' isn't really a necessary question because we already know the

Re: Removal of WeakMap/WeakSet clear

2014-12-04 Thread Andreas Rossberg
On 4 December 2014 at 13:58, David Bruant bruan...@gmail.com wrote: Le 04/12/2014 09:55, Andreas Rossberg a écrit : On 4 December 2014 at 00:54, David Bruant bruan...@gmail.com wrote: The way I see it, data structures are a tool to efficiently query data. They don't *have* to be arbitrarily

Re: Figuring out the behavior of WindowProxy in the face of non-configurable properties

2014-12-04 Thread Mark S. Miller
On Thu, Dec 4, 2014 at 2:58 AM, Boris Zbarsky bzbar...@mit.edu wrote: On 11/30/14, 6:12 PM, Mark S. Miller wrote: On Sun, Nov 30, 2014 at 12:21 PM, Boris Zbarsky bzbar...@mit.edu wrote: Per spec ES6, it seems to me like attempting to define a non-configurable property on a WindowProxy should

Re: Removal of WeakMap/WeakSet clear

2014-12-04 Thread C. Scott Ananian
On Thu, Dec 4, 2014 at 9:25 AM, Katelyn Gadd k...@luminance.org wrote: The only way I can imagine to solve this is to make really aggressive use of type information gathering and/or bailouts in the runtime to identify every type used as a weakmap key - at which point I suppose you would have

Re: Figuring out the behavior of WindowProxy in the face of non-configurable properties

2014-12-04 Thread Boris Zbarsky
On 12/4/14, 10:44 AM, Travis Leithead wrote: So... this will prevent defining non-configurable properties on the global? It will prevent using Object.defineProperty(window, name, non-configurable-descriptor); to define a property. Note that window is not the global. It's a proxy whose

Re: Removal of WeakMap/WeakSet clear

2014-12-04 Thread Mark S. Miller
On Thu, Dec 4, 2014 at 6:25 AM, Katelyn Gadd k...@luminance.org wrote: [...] I should also note that while much of the above is speculative and based on intuition/experience, I *have* been shipping a use of WeakMap for performance-critical code for over a year now Hi Katelyn, could you say

%TypedArray%.prototype.includes

2014-12-04 Thread Domenic Denicola
When implementing Array.prototype.includes for V8, we realized suddenly that we should probably do the same for typed arrays. Looking at many of the %TypedArray%.prototype methods, it seems most of them are specified as basically the same as Array, but with these minor tweaks. E.g. -

Re: %TypedArray%.prototype.includes

2014-12-04 Thread Allen Wirfs-Brock
On Dec 4, 2014, at 2:25 PM, Domenic Denicola wrote: When implementing Array.prototype.includes for V8, we realized suddenly that we should probably do the same for typed arrays. Of course! Looking at many of the %TypedArray%.prototype methods, it seems most of them are specified as

RE: %TypedArray%.prototype.includes

2014-12-04 Thread Domenic Denicola
From: Allen Wirfs-Brock [mailto:al...@wirfs-brock.com] Because some of the Array.prototype algorithms depend upon of the ability to an Array to dynamically grow its length or other characteristics that are not true of Typed Array instances. A new algorithm that is appropriate for a Typed

Re: Figuring out the behavior of WindowProxy in the face of non-configurable properties

2014-12-04 Thread Boris Zbarsky
On 12/4/14, 1:36 PM, Travis Leithead wrote: Note that window is not the global. It's a proxy whose target is the global. Yes, but within a browser UA, there is no way to get a reference to the naked global because all entry-points return window proxies ;-) Well, no way from web script.

Re: Figuring out the behavior of WindowProxy in the face of non-configurable properties

2014-12-04 Thread Mark Miller
On Thu, Dec 4, 2014 at 4:32 PM, Boris Zbarsky bzbar...@mit.edu wrote: On 12/4/14, 1:36 PM, Travis Leithead wrote: Note that window is not the global. It's a proxy whose target is the global. Yes, but within a browser UA, there is no way to get a reference to the naked global because all

Re: Figuring out the behavior of WindowProxy in the face of non-configurable properties

2014-12-04 Thread Boris Zbarsky
On 12/4/14, 4:45 PM, Mark Miller wrote: On Thu, Dec 4, 2014 at 4:32 PM, Boris Zbarsky bzbar...@mit.edu wrote: Sure, for a scope chain. Testcase at https://web.mit.edu/bzbarsky/www/testcases/windowproxy/use-old-window-1.html That page demands a client certificate. Is that intentional? Er,

Re: Figuring out the behavior of WindowProxy in the face of non-configurable properties

2014-12-04 Thread Mark Miller
On Thu, Dec 4, 2014 at 4:49 PM, Boris Zbarsky bzbar...@mit.edu wrote: On 12/4/14, 4:45 PM, Mark Miller wrote: On Thu, Dec 4, 2014 at 4:32 PM, Boris Zbarsky bzbar...@mit.edu wrote: Sure, for a scope chain. Testcase at

Re: Removal of WeakMap/WeakSet clear

2014-12-04 Thread Katelyn Gadd
JSIL has a shim that emulates the 2D portion of the XNA game framework's graphics stack using HTML5 canvas (for compatibility). Many of the stack's features don't have direct equivalents in canvas, so I have to generate and cache various bits of data and graphics resources on-demand to implement

Re: Removal of WeakMap/WeakSet clear

2014-12-04 Thread Alex Russell
I support Katelyn's suggestion to make clear() neuterable on an instance, perhaps with per-object configuration. It leaves the API intact while allowing those with security concerns to address them. On 4 Dec 2014 20:01, Katelyn Gadd k...@luminance.org wrote: JSIL has a shim that emulates the 2D

Re: Removal of WeakMap/WeakSet clear

2014-12-04 Thread Steve Fink
On 12/04/2014 08:00 PM, Katelyn Gadd wrote: I do still use WeakMap in a few other places, for example to implement Object.GetHashCode. This is a case where the transposed representation is likely optimal - though in practice, I shouldn't need any sort of container here, if only the hashing

Re: Removal of WeakMap/WeakSet clear

2014-12-04 Thread Katelyn Gadd
.NET's hashing protocol is weird and arguably it's some awful baggage carried over from its Java influences. All instances, value or reference type, have GetHashCode. For a given type there is the 'default' implementation, or you can provide a specific one. This enables anything to be used as a