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

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

Issue 10443122: Revert "Revert "Rework Element constructors"" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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 | « lib/dom/scripts/dartgenerator.py ('k') | lib/dom/scripts/systemfrog.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dom/scripts/generator.py
diff --git a/lib/dom/scripts/generator.py b/lib/dom/scripts/generator.py
index f46c61c2272816963e42783bfc304ec81e7e8b9a..2813cdb202a9ceadb046886e99f44896de1024fa 100644
--- a/lib/dom/scripts/generator.py
+++ b/lib/dom/scripts/generator.py
@@ -9,6 +9,7 @@ Dart APIs from the IDL database."""
import re
_pure_interfaces = set([
+ # TODO(sra): DOMStringMap should be a class implementing Map<String,String>.
'DOMStringMap',
'ElementTimeControl',
'ElementTraversal',
@@ -234,6 +235,7 @@ def AnalyzeOperation(interface, operations):
info.overloads = operations
info.declared_name = operations[0].id
info.name = operations[0].ext_attrs.get('DartName', info.declared_name)
+ info.constructor_name = None
info.js_name = info.declared_name
info.type_name = DartType(operations[0].type.id) # TODO: widen.
info.param_infos = args
@@ -272,6 +274,7 @@ def AnalyzeConstructor(interface):
info.idl_args = idl_args
info.declared_name = name
info.name = name
+ info.constructor_name = None
info.js_name = name
info.type_name = interface.id
info.param_infos = args
@@ -351,6 +354,8 @@ class OperationInfo(object):
Attributes:
overloads: A list of IDL operation overloads with the same name.
name: A string, the simple name of the operation.
+ constructor_name: A string, the name of the constructor iff the constructor
+ is named, e.g. 'fromList' in Int8Array.fromList(list).
type_name: A string, the name of the return type of the operation.
param_infos: A list of ParamInfo.
"""
@@ -422,6 +427,12 @@ class OperationInfo(object):
assert any([is_static == o.is_static for o in self.overloads])
return is_static
+ def ConstructorFullName(self):
+ if self.constructor_name:
+ return self.type_name + '.' + self.constructor_name
+ else:
+ return self.type_name
+
def AttributeOutputOrder(a, b):
"""Canonical output ordering for attributes."""
« no previous file with comments | « lib/dom/scripts/dartgenerator.py ('k') | lib/dom/scripts/systemfrog.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698