Bug 22355

Summary: Systematize code for replacing global constructors
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: WebCore JavaScriptAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
proposed patch darin: review+

Alexey Proskuryakov
Reported 2008-11-19 08:26:17 PST
JSDOMWindow implements global constructor replacement in setJSDOMWindowXXX functions; JSDOMWindowBase has special cases in put(), and JSWorkerContext is just broken. Probably easiest to make all code match generated one; patch forthcoming.
Attachments
proposed patch (10.62 KB, patch)
2008-11-19 08:31 PST, Alexey Proskuryakov
darin: review+
Alexey Proskuryakov
Comment 1 2008-11-19 08:31:37 PST
Created attachment 25271 [details] proposed patch
Sam Weinig
Comment 2 2008-11-19 09:29:10 PST
Can we autogenerate this code?
Darin Adler
Comment 3 2008-11-19 09:32:35 PST
Comment on attachment 25271 [details] proposed patch > + if (!static_cast<JSDOMWindowBase*>(thisObject)->allowsAccessFrom(exec)) > + return; > + // Shadowing a built-in constructor > + static_cast<JSDOMWindowBase*>(thisObject)->putDirect(Identifier(exec, "Event"), value); How about a helper function for this idiom? I can't think of any good reason to write this out explicitly 8 times instead of using a function. r=me
Alexey Proskuryakov
Comment 4 2008-11-19 10:31:18 PST
Committed revision 38599. (In reply to comment #3) > How about a helper function for this idiom? I can't think of any good reason to > write this out explicitly 8 times instead of using a function. I like that these look as close as possible to JSDOMWindow auto-generated ones. Lately, I've spent considerable time digging through minor differences in how the same things are implemented, so I think that consistency is important here. What we really need is to auto-generate these, and move them to DOMWindow from JSDOMWindowBase.
Note You need to log in before you can comment on or make changes to this bug.