Closed Bug 460809 Opened 16 years ago Closed 6 years ago

InitClassesWithNewWrappedGlobal with INIT_JS_STANDARD_CLASSES horribly broken

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED INACTIVE
mozilla1.9.1b2

People

(Reporter: bent.mozilla, Unassigned)

References

Details

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.
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
Closed: 16 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
Closed: 16 years ago6 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.