InitClassesWithNewWrappedGlobal with INIT_JS_STANDARD_CLASSES horribly broken

REOPENED
Unassigned

Status

()

Core
XPConnect
REOPENED
10 years ago
10 years ago

People

(Reporter: Ben Turner (not reading bugmail, use the needinfo flag!), Unassigned)

Tracking

Trunk
mozilla1.9.1b2
Points:
---

Firefox Tracking Flags

(Not tracked)

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
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.