mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 720580 - Assert against creating globals in xpc_NewSystemInheritingJSObject. r=mrbkap
With this patch, the only call to JS_NewGlobalObject in XPConnect happens in xpc_CreateGlobalObject. \o/
This commit is contained in:
parent
c6f2bff359
commit
9c7a81fdcd
@ -658,14 +658,11 @@ inline JSObject*
|
||||
xpc_NewSystemInheritingJSObject(JSContext *cx, JSClass *clasp, JSObject *proto,
|
||||
bool uniqueType, JSObject *parent)
|
||||
{
|
||||
// Global creation should go through XPCWrappedNative::WrapNewGlobal().
|
||||
MOZ_ASSERT(!(clasp->flags & JSCLASS_IS_GLOBAL));
|
||||
|
||||
JSObject *obj;
|
||||
if (clasp->flags & JSCLASS_IS_GLOBAL) {
|
||||
obj = JS_NewGlobalObject(cx, clasp);
|
||||
if (obj && proto) {
|
||||
if (!JS_SplicePrototype(cx, obj, proto))
|
||||
obj = NULL;
|
||||
}
|
||||
} else if (uniqueType) {
|
||||
if (uniqueType) {
|
||||
obj = JS_NewObjectWithUniqueType(cx, clasp, proto, parent);
|
||||
} else {
|
||||
obj = JS_NewObject(cx, clasp, proto, parent);
|
||||
|
Loading…
Reference in New Issue
Block a user