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.
Created attachment 25271 [details] proposed patch
Can we autogenerate this code?
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
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.