summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-06-09 00:37:55 -0400
committerGaming4JC <g4jc@hyperbola.info>2019-07-18 22:38:28 -0400
commitbd6819820961aaed4c57949341fedc57feab7403 (patch)
treeab9f917304a58671e85da23a5eebfca5536a6716 /js
parente1e313f3b6905c39a4b78a2e6cc918238540aeb2 (diff)
downloadUXP-bd6819820961aaed4c57949341fedc57feab7403.tar
UXP-bd6819820961aaed4c57949341fedc57feab7403.tar.gz
UXP-bd6819820961aaed4c57949341fedc57feab7403.tar.lz
UXP-bd6819820961aaed4c57949341fedc57feab7403.tar.xz
UXP-bd6819820961aaed4c57949341fedc57feab7403.zip
1320408 - Part 21: Change PromiseObject::onSettled to static method.
Diffstat (limited to 'js')
-rw-r--r--js/src/builtin/Promise.cpp7
-rw-r--r--js/src/builtin/Promise.h2
2 files changed, 4 insertions, 5 deletions
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<PromiseObject*> 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<PromiseObject*> promise, HandleValue
return Call(cx, funVal, UndefinedHandleValue, args, &dummy);
}
-void
-PromiseObject::onSettled(JSContext* cx)
+/* static */ void
+PromiseObject::onSettled(JSContext* cx, Handle<PromiseObject*> promise)
{
- Rooted<PromiseObject*> 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<PromiseObject*> promise,
HandleValue rejectionValue);
- void onSettled(JSContext* cx);
+ static void onSettled(JSContext* cx, Handle<PromiseObject*> promise);
double allocationTime() { return getFixedSlot(PromiseSlot_AllocationTime).toNumber(); }
double resolutionTime() { return getFixedSlot(PromiseSlot_ResolutionTime).toNumber(); }