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

Unified Diff: lib/dom/scripts/idlnode.py

Issue 10068019: Fix ApiDoc to work with new dart:html code. Tweak dart:html generator to generate clearer @domName … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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: 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')

Powered by Google App Engine
This is Rietveld 408576698