Bug 1546727: Make DebuggerFrame_getScript a static method of DebuggerFrame. r=jorendorff
authorJim Blandy <jimb@mozilla.com>
Tue, 14 May 2019 02:55:22 +0000
changeset 532545 f8b9b7dcd147413285007736cbb2ba51e79ca30d
parent 532544 b4e7d290701a7db413bc912d12c6597ede43b728
child 532546 d57a8a8d3f8d2cec45ebb4fe4c832fffa0a6a8e0
push id11270
push userrgurzau@mozilla.com
push dateWed, 15 May 2019 15:07:19 +0000
treeherdermozilla-beta@571bc76da583 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1546727: Make DebuggerFrame_getScript a static method of DebuggerFrame. r=jorendorff This function probably predates the existence of the DebuggerFrame class, and was never moved in. Depends on D28785 Differential Revision: https://phabricator.services.mozilla.com/D28786
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -9806,17 +9806,17 @@ bool DebuggerFrame::olderGetter(JSContex
     return false;
   return true;
 // The getter used for each element of frame.arguments.
-// See DebuggerFrame_getArguments.
+// See DebuggerFrame::getArguments.
 static bool DebuggerArguments_getArg(JSContext* cx, unsigned argc, Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
   int32_t i = args.callee().as<JSFunction>().getExtendedSlot(0).toInt32();
   // Check that the this value is an Arguments object.
   RootedObject argsobj(cx, NonNullObject(cx, args.thisv()));
   if (!argsobj) {
     return false;
@@ -9927,17 +9927,18 @@ bool DebuggerFrame::argumentsGetter(JSCo
   if (!DebuggerFrame::getArguments(cx, frame, &result)) {
     return false;
   return true;
-static bool DebuggerFrame_getScript(JSContext* cx, unsigned argc, Value* vp) {
+/* static */
+bool DebuggerFrame::getScript(JSContext* cx, unsigned argc, Value* vp) {
   THIS_FRAME(cx, argc, vp, "get script", args, thisobj, frameIter, frame);
   Debugger* debug = Debugger::fromChildJSObject(thisobj);
   RootedObject scriptObject(cx);
   if (frame.isWasmDebugFrame()) {
     RootedWasmInstanceObject instance(cx, frame.wasmInstance()->object());
     scriptObject = debug->wrapWasmScript(cx, instance);
     if (!scriptObject) {
@@ -10144,17 +10145,17 @@ const JSPropertySpec DebuggerFrame::prop
     JS_PSG("arguments", DebuggerFrame::argumentsGetter, 0),
     JS_PSG("callee", DebuggerFrame::calleeGetter, 0),
     JS_PSG("constructing", DebuggerFrame::constructingGetter, 0),
     JS_PSG("environment", DebuggerFrame::environmentGetter, 0),
     JS_PSG("generator", DebuggerFrame::generatorGetter, 0),
     JS_PSG("live", DebuggerFrame::liveGetter, 0),
     JS_PSG("offset", DebuggerFrame::offsetGetter, 0),
     JS_PSG("older", DebuggerFrame::olderGetter, 0),
-    JS_PSG("script", DebuggerFrame_getScript, 0),
+    JS_PSG("script", DebuggerFrame::getScript, 0),
     JS_PSG("this", DebuggerFrame::thisGetter, 0),
     JS_PSG("type", DebuggerFrame::typeGetter, 0),
     JS_PSG("implementation", DebuggerFrame::implementationGetter, 0),
     JS_PSGS("onStep", DebuggerFrame::onStepGetter, DebuggerFrame::onStepSetter,
     JS_PSGS("onPop", DebuggerFrame::onPopGetter, DebuggerFrame::onPopSetter, 0),
--- a/js/src/vm/Debugger.h
+++ b/js/src/vm/Debugger.h
@@ -1451,16 +1451,17 @@ class DebuggerFrame : public NativeObjec
   static void trace(JSTracer* trc, JSObject* obj);
   static NativeObject* initClass(JSContext* cx, HandleObject dbgCtor,
                                  Handle<GlobalObject*> global);
   static DebuggerFrame* create(JSContext* cx, HandleObject proto,
                                const FrameIter& iter,
                                HandleNativeObject debugger);
+  static MOZ_MUST_USE bool getScript(JSContext* cx, unsigned argc, Value* vp);
   static MOZ_MUST_USE bool getArguments(JSContext* cx,
                                         HandleDebuggerFrame frame,
                                         MutableHandleDebuggerArguments result);
   static MOZ_MUST_USE bool getCallee(JSContext* cx, HandleDebuggerFrame frame,
                                      MutableHandleDebuggerObject result);
   static MOZ_MUST_USE bool getIsConstructing(JSContext* cx,
                                              HandleDebuggerFrame frame,
                                              bool& result);