From 98f42548717801a839f6df892b4bf5f8549b904a Mon Sep 17 00:00:00 2001 From: Tooru Fujisawa Date: Sun, 11 Sep 2016 19:22:03 +0900 Subject: [PATCH] Bug 1290337 - Part 4: Replace Value parameter to HandleValue in js shell. r=sfink --- js/src/shell/js.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 56ede50c1a2d..e607367a189b 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -2211,10 +2211,8 @@ AssertEq(JSContext* cx, unsigned argc, Value* vp) } static JSScript* -ValueToScript(JSContext* cx, Value vArg, JSFunction** funp = nullptr) +ValueToScript(JSContext* cx, HandleValue v, JSFunction** funp = nullptr) { - RootedValue v(cx, vArg); - if (v.isString()) { // To convert a string to a script, compile it. Parse it as an ES6 Program. RootedLinearString linearStr(cx, StringToLinearString(cx, v.toString())); @@ -2275,7 +2273,7 @@ GetScriptAndPCArgs(JSContext* cx, unsigned argc, Value* argv, MutableHandleScrip RootedScript script(cx, GetTopScript(cx)); *ip = 0; if (argc != 0) { - Value v = argv[0]; + RootedValue v(cx, argv[0]); unsigned intarg = 0; if (v.isObject() && JS_GetClass(&v.toObject()) == Jsvalify(&JSFunction::class_)) { @@ -6152,7 +6150,7 @@ DefineConsole(JSContext* cx, HandleObject global) #undef EXTERNAL_FUNCTION_COUNT static bool -PrintHelpString(JSContext* cx, Value v) +PrintHelpString(JSContext* cx, HandleValue v) { JSString* str = v.toString(); MOZ_ASSERT(gOutFile->isOpen());