Bug 1338059 - Part 1: Generate cycle collection related code for WebIDL type Promise, r=bz
authorbtian <btian@mozilla.com>
Fri, 05 May 2017 10:12:40 +0800
changeset 356984 f44e06221afae5ee301b1a5185af0d49d43d1d3f
parent 356983 d7f060e17f236b66a9c6f9627de9466a8b08d9cd
child 356985 61af8ff774fe00ae51be731ac882da90c1b41868
push id31777
push usercbook@mozilla.com
push dateMon, 08 May 2017 08:04:08 +0000
treeherdermozilla-central@81977c96c6ff [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1338059
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1338059 - Part 1: Generate cycle collection related code for WebIDL type Promise, r=bz MozReview-Commit-ID: 1wQFBCur0Uy
dom/bindings/Codegen.py
--- 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():