mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Reuse getTypes in UnionConversions().
This should be equivalent, except that the removed code ignores return values (which we currently don't support).
This commit is contained in:
parent
19166b2f53
commit
c51879767e
1 changed files with 2 additions and 13 deletions
|
@ -1688,19 +1688,8 @@ def UnionConversions(descriptors):
|
||||||
if not name in unionConversions:
|
if not name in unionConversions:
|
||||||
unionConversions[name] = CGUnionConversionStruct(type, d)
|
unionConversions[name] = CGUnionConversionStruct(type, d)
|
||||||
|
|
||||||
members = [m for m in d.interface.members]
|
for t in getTypes(d):
|
||||||
if d.interface.ctor():
|
addUnionTypes(t)
|
||||||
members.append(d.interface.ctor())
|
|
||||||
signatures = [s for m in members if m.isMethod() for s in m.signatures()]
|
|
||||||
for s in signatures:
|
|
||||||
assert len(s) == 2
|
|
||||||
(_, arguments) = s
|
|
||||||
for a in arguments:
|
|
||||||
addUnionTypes(a.type)
|
|
||||||
|
|
||||||
for m in members:
|
|
||||||
if m.isAttr() and not m.readonly:
|
|
||||||
addUnionTypes(m.type)
|
|
||||||
|
|
||||||
return CGWrapper(CGList(SortedDictValues(unionConversions), "\n"),
|
return CGWrapper(CGList(SortedDictValues(unionConversions), "\n"),
|
||||||
post="\n\n")
|
post="\n\n")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue