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

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

Issue 2290113002: Add extended attributes to IdlCallbackFunction (Closed)
Patch Set: Addressed comments Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/scripts/idl_definitions.py
diff --git a/third_party/WebKit/Source/bindings/scripts/idl_definitions.py b/third_party/WebKit/Source/bindings/scripts/idl_definitions.py
index 95006780d7a86c881725b4764acddda8bf4c3ade..5ed496a16d5c2ebd1169af656f1f53012b01f211 100644
--- a/third_party/WebKit/Source/bindings/scripts/idl_definitions.py
+++ b/third_party/WebKit/Source/bindings/scripts/idl_definitions.py
@@ -173,9 +173,16 @@ class IdlCallbackFunction(TypedObject):
def __init__(self, idl_name, node):
children = node.GetChildren()
num_children = len(children)
- if num_children != 2:
- raise ValueError('Expected 2 children, got %s' % num_children)
- type_node, arguments_node = children
+ if num_children < 2 or num_children > 3:
+ raise ValueError('Expected 2 or 3 children, got %s' % num_children)
+ type_node = children[0]
+ arguments_node = children[1]
+ if num_children == 3:
+ ext_attributes_node = children[2]
+ self.extended_attributes = (
+ ext_attributes_node_to_extended_attributes(idl_name, ext_attributes_node))
+ else:
+ self.extended_attributes = {}
arguments_node_class = arguments_node.GetClass()
if arguments_node_class != 'Arguments':
raise ValueError('Expected Arguments node, got %s' % arguments_node_class)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698