Chromium Code Reviews| Index: lib/dom/scripts/idlnode.py |
| diff --git a/lib/dom/scripts/idlnode.py b/lib/dom/scripts/idlnode.py |
| index 8e4956ca000060db1efbd2f8677fc80e4b0e9d88..7045113f28fa25079db67fc54f4e4d63a7ed4ffe 100755 |
| --- a/lib/dom/scripts/idlnode.py |
| +++ b/lib/dom/scripts/idlnode.py |
| @@ -368,13 +368,16 @@ class IDLInterface(IDLNode): |
| self._convert_annotations(ast) |
| self.parents = self._convert_all(ast, 'ParentInterface', |
| IDLParentInterface) |
| - self.operations = self._convert_all(ast, 'Operation', IDLOperation) |
| - self.attributes = self._convert_all(ast, 'Attribute', IDLAttribute) |
| - self.constants = self._convert_all(ast, 'Const', IDLConstant) |
| + self.javascript_binding_name = self.id |
|
sra1
2012/04/12 17:58:21
Since this field is about documentation and not th
Jacob
2012/04/13 08:56:01
Done.
|
| + self.operations = self._convert_all(ast, 'Operation', |
| + lambda ast: IDLOperation(ast, self.javascript_binding_name)) |
| + self.attributes = self._convert_all(ast, 'Attribute', |
| + lambda ast: IDLAttribute(ast, self.javascript_binding_name)) |
| + self.constants = self._convert_all(ast, 'Const', |
| + lambda ast: IDLConstant(ast, self.javascript_binding_name)) |
| self.is_supplemental = 'Supplemental' in self.ext_attrs |
| self.is_no_interface_object = 'NoInterfaceObject' in self.ext_attrs |
| self.is_fc_suppressed = 'Suppressed' in self.ext_attrs |
| - self.javascript_binding_name = self.id |
| def has_attribute(self, candidate): |
| for attribute in self.attributes: |
| @@ -397,18 +400,19 @@ class IDLParentInterface(IDLNode): |
| class IDLMember(IDLNode): |
| """A base class for constants, attributes and operations.""" |
| - def __init__(self, ast): |
| + def __init__(self, ast, interface_javascript_binding_name): |
| IDLNode.__init__(self, ast) |
| self.type = self._convert_first(ast, 'Type', IDLType) |
| self._convert_ext_attrs(ast) |
| self._convert_annotations(ast) |
| + self.interface_javascript_binding_name = interface_javascript_binding_name |
| self.is_fc_suppressed = 'Suppressed' in self.ext_attrs |
| class IDLOperation(IDLMember): |
| """IDLNode specialization for 'type name(args)' declarations.""" |
| - def __init__(self, ast): |
| - IDLMember.__init__(self, ast) |
| + def __init__(self, ast, interface_javascript_binding_name): |
| + IDLMember.__init__(self, ast, interface_javascript_binding_name) |
| self.type = self._convert_first(ast, 'ReturnType', IDLType) |
| self.arguments = self._convert_all(ast, 'Argument', IDLArgument) |
| self.raises = self._convert_first(ast, 'Raises', IDLType) |
| @@ -421,8 +425,8 @@ class IDLOperation(IDLMember): |
| class IDLAttribute(IDLMember): |
| """IDLNode specialization for 'attribute type name' declarations.""" |
| - def __init__(self, ast): |
| - IDLMember.__init__(self, ast) |
| + def __init__(self, ast, interface_javascript_binding_name): |
| + IDLMember.__init__(self, ast, interface_javascript_binding_name) |
| self.is_read_only = self._has(ast, 'ReadOnly') |
| # There are various ways to define exceptions for attributes: |
| self.raises = self._convert_first(ast, 'Raises', IDLType) |
| @@ -443,8 +447,8 @@ class IDLAttribute(IDLMember): |
| class IDLConstant(IDLMember): |
| """IDLNode specialization for 'const type name = value' declarations.""" |
| - def __init__(self, ast): |
| - IDLMember.__init__(self, ast) |
| + def __init__(self, ast, interface_javascript_binding_name): |
| + IDLMember.__init__(self, ast, interface_javascript_binding_name) |
| self.value = self._find_first(ast, 'ConstExpr') |