diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /dom/promise/Promise.cpp | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz firefox-adbda400be353e676059e335c3c0aaf99e719475.zip |
Adding upstream version 125.0.1.upstream/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.cpp | 53 |
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) { |