mirror of
https://github.com/servo/servo.git
synced 2025-06-09 17:13:24 +00:00
script: Ensure promises are considered DOM interfaces when generating bindings. (#36107)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
8c2ac88ad0
commit
4814cbdb1f
2 changed files with 5 additions and 3 deletions
|
@ -74,7 +74,7 @@ def isDomInterface(t, logging=False):
|
|||
t = t.inner
|
||||
if isinstance(t, IDLInterface):
|
||||
return True
|
||||
if t.isCallback():
|
||||
if t.isCallback() or t.isPromise():
|
||||
return True
|
||||
return t.isInterface() and (t.isGeckoInterface() or (t.isSpiderMonkeyInterface() and not t.isBufferSource()))
|
||||
|
||||
|
@ -88,12 +88,12 @@ def containsDomInterface(t, logging=False):
|
|||
t = t.inner
|
||||
if t.isEnum():
|
||||
return False
|
||||
if isDomInterface(t):
|
||||
return True
|
||||
if t.isUnion():
|
||||
return any(map(lambda x: containsDomInterface(x), t.flatMemberTypes))
|
||||
if t.isDictionary():
|
||||
return any(map(lambda x: containsDomInterface(x), t.members)) or (t.parent and containsDomInterface(t.parent))
|
||||
if isDomInterface(t):
|
||||
return True
|
||||
if t.isSequence():
|
||||
return containsDomInterface(t.inner)
|
||||
return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue