From bd6819820961aaed4c57949341fedc57feab7403 Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Sun, 9 Jun 2019 00:37:55 -0400 Subject: 1320408 - Part 21: Change PromiseObject::onSettled to static method. --- js/src/builtin/Promise.cpp | 7 +++---- js/src/builtin/Promise.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'js/src/builtin') diff --git a/js/src/builtin/Promise.cpp b/js/src/builtin/Promise.cpp index 4210b9cd2..ec7845e89 100644 --- a/js/src/builtin/Promise.cpp +++ b/js/src/builtin/Promise.cpp @@ -603,7 +603,7 @@ ResolvePromise(JSContext* cx, Handle promise, HandleValue valueO // Now that everything else is done, do the things the debugger needs. // Step 7 of RejectPromise implemented in onSettled. - promise->onSettled(cx); + PromiseObject::onSettled(cx, promise); // Step 7 of FulfillPromise. // Step 8 of RejectPromise. @@ -2671,10 +2671,9 @@ PromiseObject::reject(JSContext* cx, Handle promise, HandleValue return Call(cx, funVal, UndefinedHandleValue, args, &dummy); } -void -PromiseObject::onSettled(JSContext* cx) +/* static */ void +PromiseObject::onSettled(JSContext* cx, Handle promise) { - Rooted promise(cx, this); RootedObject stack(cx); if (cx->options().asyncStack() || cx->compartment()->isDebuggee()) { if (!JS::CaptureCurrentStack(cx, &stack, JS::StackCapture(JS::AllFrames()))) { diff --git a/js/src/builtin/Promise.h b/js/src/builtin/Promise.h index 87d95f154..c76dc358c 100644 --- a/js/src/builtin/Promise.h +++ b/js/src/builtin/Promise.h @@ -71,7 +71,7 @@ class PromiseObject : public NativeObject static MOZ_MUST_USE bool reject(JSContext* cx, Handle promise, HandleValue rejectionValue); - void onSettled(JSContext* cx); + static void onSettled(JSContext* cx, Handle promise); double allocationTime() { return getFixedSlot(PromiseSlot_AllocationTime).toNumber(); } double resolutionTime() { return getFixedSlot(PromiseSlot_ResolutionTime).toNumber(); } -- cgit v1.2.3