Bug 574990 - cx->globalObject needs to be innerized before it can be used. r=gal

--HG--
extra : rebase_source : 6e31e65d2e265da850b871b78ec9af984350b08c
This commit is contained in:
Blake Kaplan 2010-06-28 16:38:54 -07:00
parent b3c8c97bf8
commit 50cdb5d92b

View File

@ -699,7 +699,15 @@ NewBuiltinClassInstance(JSContext *cx, JSClass *clasp)
JS_ASSERT(protoKey != JSProto_Null);
/* NB: inline-expanded and specialized version of js_GetClassPrototype. */
JSObject *global = cx->fp ? cx->fp->scopeChain->getGlobal() : cx->globalObject;
JSObject *global;
if (!cx->fp) {
global = cx->globalObject;
OBJ_TO_INNER_OBJECT(cx, global);
if (!global)
return NULL;
} else {
global = cx->fp->scopeChain->getGlobal();
}
JS_ASSERT(global->getClass()->flags & JSCLASS_IS_GLOBAL);
jsval v = global->getReservedSlot(JSProto_LIMIT + protoKey);