Bug 1338059 - Part 1: Generate cycle collection related code for WebIDL type Promise, r=bz
MozReview-Commit-ID: 1wQFBCur0Uy
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -75,17 +75,17 @@ def idlTypeNeedsCycleCollection(type):
type = type.unroll() # Takes care of sequences and nullables
if ((type.isPrimitive() and type.tag() in builtinNames) or
type.isEnum() or
type.isString() or
type.isAny() or
type.isObject() or
type.isSpiderMonkeyInterface()):
return False
- elif type.isCallback() or type.isGeckoInterface():
+ elif type.isCallback() or type.isPromise() or type.isGeckoInterface():
return True
elif type.isUnion():
return any(idlTypeNeedsCycleCollection(t) for t in type.flatMemberTypes)
elif type.isRecord():
if idlTypeNeedsCycleCollection(type.inner):
raise TypeError("Cycle collection for type %s is not supported" % type)
return False
elif type.isDictionary():