From c2b1e70b763660da2a41a826b4049360090ff373 Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Sat, 8 Jun 2019 19:05:28 -0400 Subject: 1320408 - Part 3: Remove JSContext* parameter from JSFunction::getBoundFunctionArgument. --- js/src/jsfun.cpp | 6 ++---- js/src/jsfun.h | 2 +- js/src/vm/Debugger.cpp | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) (limited to 'js') diff --git a/js/src/jsfun.cpp b/js/src/jsfun.cpp index 41f935080..f032b822f 100644 --- a/js/src/jsfun.cpp +++ b/js/src/jsfun.cpp @@ -1325,13 +1325,11 @@ GetBoundFunctionArguments(const JSFunction* boundFun) } const js::Value& -JSFunction::getBoundFunctionArgument(JSContext* cx, unsigned which) const +JSFunction::getBoundFunctionArgument(unsigned which) const { MOZ_ASSERT(which < getBoundFunctionArgumentCount()); - RootedArrayObject boundArgs(cx, GetBoundFunctionArguments(this)); - RootedValue res(cx); - return boundArgs->getDenseElement(which); + return GetBoundFunctionArguments(this)->getDenseElement(which); } size_t diff --git a/js/src/jsfun.h b/js/src/jsfun.h index 781ca6223..f3643f1e6 100644 --- a/js/src/jsfun.h +++ b/js/src/jsfun.h @@ -591,7 +591,7 @@ class JSFunction : public js::NativeObject JSObject* getBoundFunctionTarget() const; const js::Value& getBoundFunctionThis() const; - const js::Value& getBoundFunctionArgument(JSContext* cx, unsigned which) const; + const js::Value& getBoundFunctionArgument(unsigned which) const; size_t getBoundFunctionArgumentCount() const; private: diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index 988ae413b..5cc054308 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -9611,7 +9611,7 @@ DebuggerObject::getBoundArguments(JSContext* cx, HandleDebuggerObject object, if (!result.resize(length)) return false; for (size_t i = 0; i < length; i++) { - result[i].set(referent->getBoundFunctionArgument(cx, i)); + result[i].set(referent->getBoundFunctionArgument(i)); if (!dbg->wrapDebuggeeValue(cx, result[i])) return false; } -- cgit v1.2.3