mirror of
https://github.com/servo/servo
synced 2026-05-01 20:07:22 +02:00
For WebIDL interfaces without constant members, do not generate a 'Constant' module
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user