summaryrefslogtreecommitdiffstats
path: root/js/src/json.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/json.cpp')
-rw-r--r--js/src/json.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/js/src/json.cpp b/js/src/json.cpp
index 425a2f117..08382b97b 100644
--- a/js/src/json.cpp
+++ b/js/src/json.cpp
@@ -971,9 +971,9 @@ static const JSFunctionSpec json_static_methods[] = {
JSObject*
js::InitJSONClass(JSContext* cx, HandleObject obj)
{
- Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>());
+ Handle<GlobalObject*> global = obj.as<GlobalObject>();
- RootedObject proto(cx, global->getOrCreateObjectPrototype(cx));
+ RootedObject proto(cx, GlobalObject::getOrCreateObjectPrototype(cx, global));
if (!proto)
return nullptr;
RootedObject JSON(cx, NewObjectWithGivenProto(cx, &JSONClass, proto, SingletonObject));