mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
For WebIDL interfaces without constant members, do not generate a 'Constant' module
This commit is contained in:
parent
b66a001451
commit
1f45eaf8a1
1 changed files with 6 additions and 3 deletions
|
@ -4950,9 +4950,12 @@ class CGDescriptor(CGThing):
|
|||
cgThings.append(CGGeneric(str(properties)))
|
||||
cgThings.append(CGCreateInterfaceObjectsMethod(descriptor, properties))
|
||||
|
||||
cgThings.append(CGNamespace.build([descriptor.name + "Constants"],
|
||||
CGConstant(m for m in descriptor.interface.members if m.isConst()),
|
||||
public=True))
|
||||
# If there are no constant members, don't make a module for constants
|
||||
constMembers = [m for m in descriptor.interface.members if m.isConst()]
|
||||
if constMembers:
|
||||
cgThings.append(CGNamespace.build([descriptor.name + "Constants"],
|
||||
CGConstant(constMembers),
|
||||
public=True))
|
||||
|
||||
if descriptor.interface.hasInterfaceObject():
|
||||
cgThings.append(CGDefineDOMInterfaceMethod(descriptor))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue