WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
22355
Systematize code for replacing global constructors
https://bugs.webkit.org/show_bug.cgi?id=22355
Summary
Systematize code for replacing global constructors
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+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
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.
Top of Page
Format For Printing
XML
Clone This Bug