diff options
-rw-r--r-- | js/src/builtin/TestingFunctions.cpp | 3 | ||||
-rw-r--r-- | js/src/jsobj.cpp | 7 | ||||
-rw-r--r-- | js/src/jsobj.h | 3 | ||||
-rw-r--r-- | js/src/vm/Debugger.cpp | 2 |
4 files changed, 8 insertions, 7 deletions
diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index 89e3b1793..f9e4674c8 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -3319,7 +3319,8 @@ GetConstructorName(JSContext* cx, unsigned argc, Value* vp) } RootedAtom name(cx); - if (!args[0].toObject().constructorDisplayAtom(cx, &name)) + RootedObject obj(cx, &args[0].toObject()); + if (!JSObject::constructorDisplayAtom(cx, obj, &name)) return false; if (name) { diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp index 0c7c9bc32..ce2f9a614 100644 --- a/js/src/jsobj.cpp +++ b/js/src/jsobj.cpp @@ -3849,11 +3849,10 @@ displayAtomFromObjectGroup(ObjectGroup& group) return script->function()->displayAtom(); } -bool -JSObject::constructorDisplayAtom(JSContext* cx, js::MutableHandleAtom name) +/* static */ bool +JSObject::constructorDisplayAtom(JSContext* cx, js::HandleObject obj, js::MutableHandleAtom name) { - RootedObject self(cx, this); // Temporary change. - ObjectGroup *g = JSObject::getGroup(cx, self); + ObjectGroup *g = JSObject::getGroup(cx, obj); if (!g) return false; diff --git a/js/src/jsobj.h b/js/src/jsobj.h index aa4070556..49b7c5e8e 100644 --- a/js/src/jsobj.h +++ b/js/src/jsobj.h @@ -288,7 +288,8 @@ class JSObject : public js::gc::Cell * If this object was instantiated with `new Ctor`, return the constructor's * display atom. Otherwise, return nullptr. */ - bool constructorDisplayAtom(JSContext* cx, js::MutableHandleAtom name); + static bool constructorDisplayAtom(JSContext* cx, js::HandleObject obj, + js::MutableHandleAtom name); /* * The same as constructorDisplayAtom above, however if this object has a diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index 5cc054308..a4f1f3032 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -2234,7 +2234,7 @@ Debugger::appendAllocationSite(JSContext* cx, HandleObject obj, HandleSavedFrame RootedAtom ctorName(cx); { AutoCompartment ac(cx, obj); - if (!obj->constructorDisplayAtom(cx, &ctorName)) + if (!JSObject::constructorDisplayAtom(cx, obj, &ctorName)) return false; } |