Bug 1019804 - Use RootedString in shell's Run function. r=terrence
authorJan de Mooij <jdemooij@mozilla.com>
Wed, 04 Jun 2014 14:32:48 +0200
changeset 205823 fbda3cc3461a75b08351edb22e944fd3f08762c7
parent 205822 dae53a38052e91c0fc27c0a0c994acba96970b9f
child 205824 ed539e06f5c0c9f00b83f90a238b403b8a83b3ea
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs1019804
milestone32.0a1
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 1019804 - Use RootedString in shell's Run function. r=terrence
js/src/shell/js.cpp
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -1433,17 +1433,17 @@ Run(JSContext *cx, unsigned argc, jsval 
         JS_ReportErrorNumber(cx, my_GetErrorMessage, nullptr, JSSMSG_INVALID_ARGS, "run");
         return false;
     }
 
     RootedObject thisobj(cx, JS_THIS_OBJECT(cx, vp));
     if (!thisobj)
         return false;
 
-    JSString *str = JS::ToString(cx, args[0]);
+    RootedString str(cx, JS::ToString(cx, args[0]));
     if (!str)
         return false;
     args[0].setString(str);
     JSAutoByteString filename(cx, str);
     if (!filename)
         return false;
 
     const jschar *ucbuf = nullptr;