summaryrefslogtreecommitdiffstats
path: root/dom/bindings/Codegen.py
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/Codegen.py
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/Codegen.py')
-rw-r--r--dom/bindings/Codegen.py40
1 files changed, 1 insertions, 39 deletions
diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py
index 924241aa0..9cde82df9 100644
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -3052,23 +3052,6 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
else:
unforgeableHolderSetup = None
- if self.descriptor.name == "Promise":
- speciesSetup = CGGeneric(fill(
- """
- #ifndef SPIDERMONKEY_PROMISE
- JS::Rooted<JSObject*> promiseConstructor(aCx, *interfaceCache);
- JS::Rooted<jsid> species(aCx,
- SYMBOL_TO_JSID(JS::GetWellKnownSymbol(aCx, JS::SymbolCode::species)));
- if (!JS_DefinePropertyById(aCx, promiseConstructor, species, JS::UndefinedHandleValue,
- JSPROP_SHARED, Promise::PromiseSpecies, nullptr)) {
- $*{failureCode}
- }
- #endif // SPIDERMONKEY_PROMISE
- """,
- failureCode=failureCode))
- else:
- speciesSetup = None
-
if (self.descriptor.interface.isOnGlobalProtoChain() and
needInterfacePrototypeObject):
makeProtoPrototypeImmutable = CGGeneric(fill(
@@ -3094,7 +3077,7 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
return CGList(
[getParentProto, getConstructorProto, initIds,
prefCache, CGGeneric(call), defineAliases, unforgeableHolderSetup,
- speciesSetup, makeProtoPrototypeImmutable],
+ makeProtoPrototypeImmutable],
"\n").define()
@@ -5414,7 +5397,6 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
$*{exceptionCode}
}
binding_detail::FastErrorResult promiseRv;
- #ifdef SPIDERMONKEY_PROMISE
nsCOMPtr<nsIGlobalObject> global =
do_QueryInterface(promiseGlobal.GetAsSupports());
if (!global) {
@@ -5427,26 +5409,6 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
if (promiseRv.MaybeSetPendingException(cx)) {
$*{exceptionCode}
}
- #else
- JS::Handle<JSObject*> promiseCtor =
- PromiseBinding::GetConstructorObjectHandle(cx);
- if (!promiseCtor) {
- $*{exceptionCode}
- }
- JS::Rooted<JS::Value> resolveThisv(cx, JS::ObjectValue(*promiseCtor));
- JS::Rooted<JS::Value> resolveResult(cx);
- Promise::Resolve(promiseGlobal, resolveThisv, valueToResolve,
- &resolveResult, promiseRv);
- if (promiseRv.MaybeSetPendingException(cx)) {
- $*{exceptionCode}
- }
- nsresult unwrapRv = UNWRAP_OBJECT(Promise, &resolveResult.toObject(), $${declName});
- if (NS_FAILED(unwrapRv)) { // Quite odd
- promiseRv.Throw(unwrapRv);
- promiseRv.MaybeSetPendingException(cx);
- $*{exceptionCode}
- }
- #endif // SPIDERMONKEY_PROMISE
}
""",
getPromiseGlobal=getPromiseGlobal,