Bug 1230698. Make NS_CreateJSTimeoutHandler with a string propagate out exceptions from the nsJSScriptTimeoutHandler constructor if they happen. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 10 Dec 2015 16:14:10 -0500
changeset 310280 02c69f4f896255189ce2f9f4e0d875e383bcfbd7
parent 310279 3c31d67c74d2d56c42b2b3ae913d21e0d8907c54
child 310281 deae83275ac77def16287b771570d0a7ce385c8f
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs1230698
milestone45.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 1230698. Make NS_CreateJSTimeoutHandler with a string propagate out exceptions from the nsJSScriptTimeoutHandler constructor if they happen. r=peterv
dom/base/nsJSTimeoutHandler.cpp
--- a/dom/base/nsJSTimeoutHandler.cpp
+++ b/dom/base/nsJSTimeoutHandler.cpp
@@ -281,18 +281,17 @@ NS_CreateJSTimeoutHandler(JSContext *aCx
     new nsJSScriptTimeoutHandler(aCx, aWindow, aFunction, args, aError);
   return aError.Failed() ? nullptr : handler.forget();
 }
 
 already_AddRefed<nsIScriptTimeoutHandler>
 NS_CreateJSTimeoutHandler(JSContext* aCx, nsGlobalWindow *aWindow,
                           const nsAString& aExpression, ErrorResult& aError)
 {
-  ErrorResult rv;
   bool allowEval = false;
   RefPtr<nsJSScriptTimeoutHandler> handler =
-    new nsJSScriptTimeoutHandler(aCx, aWindow, aExpression, &allowEval, rv);
-  if (rv.Failed() || !allowEval) {
+    new nsJSScriptTimeoutHandler(aCx, aWindow, aExpression, &allowEval, aError);
+  if (aError.Failed() || !allowEval) {
     return nullptr;
   }
 
   return handler.forget();
 }