summaryrefslogtreecommitdiffstats
path: root/dom/bindings/BindingUtils.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-12-19 01:35:24 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-12-19 01:35:24 +0100
commitfb96b43b5f6188233710c5f8c9c9e46baa9cb369 (patch)
tree54124a46275f833ecd9f6e63246e092a93843fb0 /dom/bindings/BindingUtils.cpp
parent8220776c9b2e8291f0414f98ac20fbda30e00d2e (diff)
downloadUXP-fb96b43b5f6188233710c5f8c9c9e46baa9cb369.tar
UXP-fb96b43b5f6188233710c5f8c9c9e46baa9cb369.tar.gz
UXP-fb96b43b5f6188233710c5f8c9c9e46baa9cb369.tar.lz
UXP-fb96b43b5f6188233710c5f8c9c9e46baa9cb369.tar.xz
UXP-fb96b43b5f6188233710c5f8c9c9e46baa9cb369.zip
Issue #1322 - Part 1: Remove the DOM Promise guts.
This removes all the parts guarded by SPIDERMONKEY_PROMISE
Diffstat (limited to 'dom/bindings/BindingUtils.cpp')
-rw-r--r--dom/bindings/BindingUtils.cpp37
1 files changed, 0 insertions, 37 deletions
diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp
index 6e0db29b1..b244d4d2a 100644
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -2976,42 +2976,6 @@ ConvertExceptionToPromise(JSContext* cx,
JSObject* promiseScope,
JS::MutableHandle<JS::Value> rval)
{
-#ifndef SPIDERMONKEY_PROMISE
- GlobalObject global(cx, promiseScope);
- if (global.Failed()) {
- return false;
- }
-
- JS::Rooted<JS::Value> exn(cx);
- if (!JS_GetPendingException(cx, &exn)) {
- // This is very important: if there is no pending exception here but we're
- // ending up in this code, that means the callee threw an uncatchable
- // exception. Just propagate that out as-is.
- return false;
- }
-
- JS_ClearPendingException(cx);
-
- nsCOMPtr<nsIGlobalObject> globalObj =
- do_QueryInterface(global.GetAsSupports());
- if (!globalObj) {
- ErrorResult rv;
- rv.Throw(NS_ERROR_UNEXPECTED);
- return !rv.MaybeSetPendingException(cx);
- }
-
- ErrorResult rv;
- RefPtr<Promise> promise = Promise::Reject(globalObj, cx, exn, rv);
- if (rv.MaybeSetPendingException(cx)) {
- // We just give up. We put the exception from the ErrorResult on
- // the JSContext just to make sure to not leak memory on the
- // ErrorResult, but now just put the original exception back.
- JS_SetPendingException(cx, exn);
- return false;
- }
-
- return GetOrCreateDOMReflector(cx, promise, rval);
-#else // SPIDERMONKEY_PROMISE
{
JSAutoCompartment ac(cx, promiseScope);
@@ -3037,7 +3001,6 @@ ConvertExceptionToPromise(JSContext* cx,
// Now make sure we rewrap promise back into the compartment we want
return JS_WrapValue(cx, rval);
-#endif // SPIDERMONKEY_PROMISE
}
/* static */