mirror of
https://github.com/servo/servo
synced 2026-04-30 11:27:28 +02:00
Support default toJSON in WebIDL
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user