On Mar 13, 2013, at 7:27 AM, Andreas Rossberg <[email protected]> wrote:

> On 13 March 2013 14:56, Michael Schwartz <[email protected]> wrote:
>> Can Harmony Proxies be used to detect when the prototypes or builtins are
>> being overridden?
>> 
>> If so, you could save the original and provide a new API to fetch the
>> original.
> 
> I don't see how proxies help here. Saving the originals certainly doesn't 
> require proxies (nor private symbols).

A proxy would be able to detect Array.prototype.forEach is being stored to.

A proxy on window would be able to detect JSON being stored to.  

A proxy on document would be able to detect createElement being stored to.

&c

The extensions team can choose which object to proxy and when.

Last time I checked, Harmony extensions had to be enabled via command switch 
when launching Chrome.  That would preclude using proxies as I suggested here.


On Mar 12, 2013, at 3:56 PM, Benjamin Kalman <[email protected]> wrote:

> I'm on the Chrome Extensions team, and we've run into a problem where 
> extensions override Array.prototype.forEach in a way that breaks our internal 
> JS.
> 
> A workaround we've done is to write our own forEach method, but this problem 
> is widespread - extensions also override JSON, document.createElement, etc - 
> the vector for accidental breakage is as widespread as all of the JS and DOM 
> libraries.
> 
> What is the best way to protect against this in a general way? The only safe 
> thing I can think of is to run all our code in a separate context, but I've 
> been told that creating contexts is an expensive operation. How expensive? 
> Alternatively, apparently v8 has solved this problem internally by 
> guaranteeing that it's running the builtin libraries - is/can this be exposed?
> 
> Cheers,
> Ben.
> 
> -- 
> -- 
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users
> --- 
> You received this message because you are subscribed to the Google Groups 
> "v8-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to