I get *tons* of exceptions and assertions when using this method+flag combo. First we're calling JS_InitStandardClasses on a wrapped native and I get the 'cannot modify properties of a wrapped native' exception. Bad times. Second, I get a ton of these assertions: ###!!! ASSERTION: Non-global object has the wrong flags, !(jsclazz->flags & JSCLASS_IS_GLOBAL) Badder times.
10 years ago
I think I convinced bent that global objects really should implement nsIXPCScriptable and set the flags that allow modifications to the created object. Once he does that, everything works.
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → INVALID
Well, it works, but it's totally non-obvious. I think we're going to change the signature of InitClassesWithNewWrappedGlobal to take an nsIXPCScriptable* instead of nsISupports* to prevent other people from falling down this rabbit hole. jst, what do you think?
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
You need to log in before you can comment on or make changes to this bug.