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 → ---
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: REOPENED → RESOLVED
Last Resolved: 10 years ago → 8 months ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.