summaryrefslogtreecommitdiffstats
path: root/js/src/jsobj.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jsobj.cpp')
-rw-r--r--js/src/jsobj.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp
index 58be1a283..4957b4d39 100644
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -1985,7 +1985,8 @@ js::GetObjectFromIncumbentGlobal(JSContext* cx, MutableHandleObject obj)
{
AutoCompartment ac(cx, globalObj);
- obj.set(globalObj->as<GlobalObject>().getOrCreateObjectPrototype(cx));
+ Handle<GlobalObject*> global = globalObj.as<GlobalObject>();
+ obj.set(GlobalObject::getOrCreateObjectPrototype(cx, global));
if (!obj)
return false;
}
@@ -2548,7 +2549,7 @@ js::SetPrototype(JSContext* cx, HandleObject obj, HandleObject proto, JS::Object
// [[Prototype]] chain is always properly immutable, even in the presence
// of lazy standard classes.
if (obj->is<GlobalObject>()) {
- Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>());
+ Handle<GlobalObject*> global = obj.as<GlobalObject>();
if (!GlobalObject::ensureConstructor(cx, global, JSProto_Object))
return false;
}