Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Unified Diff: Source/bindings/scripts/idl_definitions.py

Issue 807263007: IDL: Add forEach() method to iterable<>/maplike<>/setlike<> interfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/bindings/scripts/idl_definitions.py
diff --git a/Source/bindings/scripts/idl_definitions.py b/Source/bindings/scripts/idl_definitions.py
index 2f3dd17e099650da2ea3a630243be865f4b62c81..c3de60b66c59792c5848c21902c77677b6a80c5f 100644
--- a/Source/bindings/scripts/idl_definitions.py
+++ b/Source/bindings/scripts/idl_definitions.py
@@ -505,11 +505,12 @@ class IdlOperation(TypedObject):
self.extended_attributes = {}
self.specials = []
self.is_constructor = False
+ self.idl_name = idl_name
+ self.is_static = False
if not node:
- self.is_static = False
return
- self.idl_name = idl_name
+
self.name = node.GetName() # FIXME: should just be: or ''
# FIXME: AST should use None internally
if self.name == '_unnamed_':
@@ -574,15 +575,20 @@ class IdlOperation(TypedObject):
################################################################################
class IdlArgument(TypedObject):
- def __init__(self, idl_name, node):
+ def __init__(self, idl_name, node=None):
self.extended_attributes = {}
self.idl_type = None
- self.is_optional = node.GetProperty('OPTIONAL') # syntax: (optional T)
+ self.is_optional = False # syntax: (optional T)
self.is_variadic = False # syntax: (T...)
self.idl_name = idl_name
- self.name = node.GetName()
self.default_value = None
+ if not node:
+ return
+
+ self.is_optional = node.GetProperty('OPTIONAL')
+ self.name = node.GetName()
+
children = node.GetChildren()
for child in children:
child_class = child.GetClass()

Powered by Google App Engine
This is Rietveld 408576698