Bug 911216 - Part 25: Fix Promise accessors on Debugger.Object.prototype. r=ejpbruel
authorTill Schneidereit <till@tillschneidereit.net>
Sat, 02 Jul 2016 02:00:47 +0200
changeset 303424 9501d1e10aa7c40d7db39d85a041f8d5fe982370
parent 303423 639184c289f5a56a94c3b1299b566ebcb5340c63
child 303425 2f5a91f64ac74c23c1a967504817b7e7d7a55784
push id79079
push usertschneidereit@gmail.com
push dateSat, 02 Jul 2016 00:03:42 +0000
treeherdermozilla-inbound@fcec96be60db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersejpbruel
bugs911216
milestone50.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 911216 - Part 25: Fix Promise accessors on Debugger.Object.prototype. r=ejpbruel
js/src/vm/Debugger.cpp
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -8251,18 +8251,21 @@ DebuggerObject_getPromiseTimeToResolutio
 }
 
 static bool
 DebuggerObject_getPromiseAllocationSite(JSContext* cx, unsigned argc, Value* vp)
 {
     THIS_DEBUGOBJECT_PROMISE(cx, argc, vp, "get promiseAllocationSite", args, refobj);
 
     RootedObject allocSite(cx, promise->allocationSite());
-    if (!allocSite)
-        return null(args);
+    if (!allocSite) {
+        args.rval().setNull();
+        return true;
+    }
+
     if (!cx->compartment()->wrap(cx, &allocSite))
         return false;
     args.rval().set(ObjectValue(*allocSite));
     return true;
 }
 
 static bool
 DebuggerObject_getPromiseResolutionSite(JSContext* cx, unsigned argc, Value* vp)
@@ -8270,18 +8273,21 @@ DebuggerObject_getPromiseResolutionSite(
     THIS_DEBUGOBJECT_PROMISE(cx, argc, vp, "get promiseResolutionSite", args, refobj);
 
     if (promise->state() == JS::PromiseState::Pending) {
         JS_ReportErrorNumber(cx, GetErrorMessage, nullptr, JSMSG_DEBUG_PROMISE_NOT_RESOLVED);
         return false;
     }
 
     RootedObject resolutionSite(cx, promise->resolutionSite());
-    if (!resolutionSite)
-        return null(args);
+    if (!resolutionSite) {
+        args.rval().setNull();
+        return true;
+    }
+
     if (!cx->compartment()->wrap(cx, &resolutionSite))
         return false;
     args.rval().set(ObjectValue(*resolutionSite));
     return true;
 }
 
 static bool
 DebuggerObject_getPromiseID(JSContext* cx, unsigned argc, Value* vp)