mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Auto merge of #9430 - doomrobo:WebIDL-no-empty-const-modules, r=nox
Fix issue #9411 - Do not generate empty WebIDL 'Constant' modules Fixes issue #9411 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9430) <!-- Reviewable:end -->
This commit is contained in:
commit
a19b14313a
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