Commit e98eb223 authored by lkawai's avatar lkawai Committed by Commit bot

It is necessary to deal with callback function.

BUG=569301

Review-Url: https://codereview.chromium.org/2290113002
Cr-Commit-Position: refs/heads/master@{#415256}
parent 40dc7d65
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment