summaryrefslogtreecommitdiffstats
path: root/dom/promise/Promise.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /dom/promise/Promise.cpp
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/promise/Promise.cpp')
-rw-r--r--dom/promise/Promise.cpp53
1 files changed, 0 insertions, 53 deletions
diff --git a/dom/promise/Promise.cpp b/dom/promise/Promise.cpp
index fb4989c43d..3abb517ac7 100644
--- a/dom/promise/Promise.cpp
+++ b/dom/promise/Promise.cpp
@@ -213,59 +213,6 @@ already_AddRefed<Promise> Promise::All(
return CreateFromExisting(global, result, aPropagateUserInteraction);
}
-void Promise::Then(JSContext* aCx,
- // aCalleeGlobal may not be in the compartment of aCx, when
- // called over Xrays.
- JS::Handle<JSObject*> aCalleeGlobal,
- AnyCallback* aResolveCallback, AnyCallback* aRejectCallback,
- JS::MutableHandle<JS::Value> aRetval, ErrorResult& aRv) {
- NS_ASSERT_OWNINGTHREAD(Promise);
-
- // Let's hope this does the right thing with Xrays... Ensure everything is
- // just in the caller compartment; that ought to do the trick. In theory we
- // should consider aCalleeGlobal, but in practice our only caller is
- // DOMRequest::Then, which is not working with a Promise subclass, so things
- // should be OK.
- JS::Rooted<JSObject*> promise(aCx, PromiseObj());
- if (!promise) {
- // This promise is no-op, so do nothing.
- return;
- }
-
- if (!JS_WrapObject(aCx, &promise)) {
- aRv.NoteJSContextException(aCx);
- return;
- }
-
- JS::Rooted<JSObject*> resolveCallback(aCx);
- if (aResolveCallback) {
- resolveCallback = aResolveCallback->CallbackOrNull();
- if (!JS_WrapObject(aCx, &resolveCallback)) {
- aRv.NoteJSContextException(aCx);
- return;
- }
- }
-
- JS::Rooted<JSObject*> rejectCallback(aCx);
- if (aRejectCallback) {
- rejectCallback = aRejectCallback->CallbackOrNull();
- if (!JS_WrapObject(aCx, &rejectCallback)) {
- aRv.NoteJSContextException(aCx);
- return;
- }
- }
-
- JS::Rooted<JSObject*> retval(aCx);
- retval = JS::CallOriginalPromiseThen(aCx, promise, resolveCallback,
- rejectCallback);
- if (!retval) {
- aRv.NoteJSContextException(aCx);
- return;
- }
-
- aRetval.setObject(*retval);
-}
-
static void SettlePromise(Promise* aSettlingPromise, Promise* aCallbackPromise,
ErrorResult& aRv) {
if (!aSettlingPromise) {