Bug 925070, r=bz
authorBen Turner <bent.mozilla@gmail.com>
Wed, 09 Oct 2013 18:00:38 -0400
changeset 150275 8aea67a6a17c5951fb5c7d28e834045e4270f52d
parent 150274 2f879cfc861fc56b631bdafa8d3d20e1001c5686
child 150276 734a282006c26e01288f9b0a7664c8dfbaf9b088
push id25429
push usercbook@mozilla.com
push dateThu, 10 Oct 2013 11:35:36 +0000
treeherdermozilla-central@977afa826c5e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs925070
milestone27.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 925070, r=bz
dom/workers/Worker.cpp
--- a/dom/workers/Worker.cpp
+++ b/dom/workers/Worker.cpp
@@ -101,18 +101,23 @@ protected:
   static bool
   ConstructInternal(JSContext* aCx, JS::CallArgs aArgs, bool aIsChromeWorker)
   {
     if (!aArgs.length()) {
       JS_ReportError(aCx, "Constructor requires at least one argument!");
       return false;
     }
 
+    JS::RootedString scriptURLStr(aCx, JS_ValueToString(aCx, aArgs[0]));
+    if (!scriptURLStr) {
+      return false;
+    }
+
     nsDependentJSString scriptURL;
-    if (!scriptURL.init(aCx, aArgs[0])) {
+    if (!scriptURL.init(aCx, scriptURLStr)) {
       return false;
     }
 
     JS::Rooted<JS::Value> priv(aCx,
       js::GetFunctionNativeReserved(&aArgs.callee(), CONSTRUCTOR_SLOT_PARENT));
 
     WorkerPrivate* parent;
     if (priv.isUndefined()) {