mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Support default toJSON in WebIDL
This commit is contained in:
parent
9a7e2663e8
commit
16b4e3446b
9 changed files with 106 additions and 155 deletions
|
@ -250,6 +250,8 @@ class Descriptor(DescriptorProvider):
|
|||
'Stringifier': None,
|
||||
}
|
||||
|
||||
self.hasDefaultToJSON = False
|
||||
|
||||
def addOperation(operation, m):
|
||||
if not self.operations[operation]:
|
||||
self.operations[operation] = m
|
||||
|
@ -259,6 +261,8 @@ class Descriptor(DescriptorProvider):
|
|||
for m in self.interface.members:
|
||||
if m.isMethod() and m.isStringifier():
|
||||
addOperation('Stringifier', m)
|
||||
if m.isMethod() and m.isDefaultToJSON():
|
||||
self.hasDefaultToJSON = True
|
||||
|
||||
if self.concrete:
|
||||
iface = self.interface
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue