summaryrefslogtreecommitdiffstats
path: root/js/src/jsmath.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jsmath.cpp')
-rw-r--r--js/src/jsmath.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/js/src/jsmath.cpp b/js/src/jsmath.cpp
index 08fbe048c..78a231003 100644
--- a/js/src/jsmath.cpp
+++ b/js/src/jsmath.cpp
@@ -1417,7 +1417,8 @@ static const JSFunctionSpec math_static_methods[] = {
JSObject*
js::InitMathClass(JSContext* cx, HandleObject obj)
{
- RootedObject proto(cx, obj->as<GlobalObject>().getOrCreateObjectPrototype(cx));
+ Handle<GlobalObject*> global = obj.as<GlobalObject>();
+ RootedObject proto(cx, GlobalObject::getOrCreateObjectPrototype(cx, global));
if (!proto)
return nullptr;
RootedObject Math(cx, NewObjectWithGivenProto(cx, &MathClass, proto, SingletonObject));