Summary: | Bug in numeric accessors on global environment | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Gavin Barraclough <barraclough> | ||||
Component: | JavaScriptCore | Assignee: | Gavin Barraclough <barraclough> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | ggaren | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Gavin Barraclough
2012-09-24 22:53:10 PDT
Created attachment 165526 [details]
Fix
To do an assignment directly to the global object, you need to do it lexically, and not using "this" or "window". Perhaps calling bare __defineSetter__() and __defineGetter__() with a numeric property will do it. Comment on attachment 165526 [details]
Fix
r=me
(In reply to comment #2) > To do an assignment directly to the global object, you need to do it lexically, and not using "this" or "window". Perhaps calling bare __defineSetter__() and __defineGetter__() with a numeric property will do it. Sadly __defineSetter__/__defineGetter__ will replace the current getter/setter, rather than calling it. :-/ I need something equivalent to window[0] = foo; i.e. something that will do a [[Put]] rather than a [[DefineOwnProperty]], but where the base is the global environment. Still haven't worked out how to do this for a numeric name. |