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

Unified Diff: tools/dom/scripts/htmldartgenerator.py

Issue 904663005: Revert "Annotate dart:html constructor expressions with precise non-nullable types." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | « tests/html/element_types_test.dart ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/htmldartgenerator.py
diff --git a/tools/dom/scripts/htmldartgenerator.py b/tools/dom/scripts/htmldartgenerator.py
index da82b1ad2281ba039ac2c278b96257ad617fc1cd..6699fd3ca366136b15f2c001b540bc9fa9c890dc 100644
--- a/tools/dom/scripts/htmldartgenerator.py
+++ b/tools/dom/scripts/htmldartgenerator.py
@@ -547,29 +547,31 @@ class HtmlDartGenerator(object):
has_optional = any(param_info.is_optional
for param_info in constructor_info.param_infos)
- factory_expression = self.FactoryConstructorExpression(constructor_info,
- factory_name, factory_constructor_name, factory_parameters)
-
if not has_optional:
self._members_emitter.Emit(
'\n $(METADATA)'
- 'factory $CTOR($PARAMS) => $FACTORY_EXPRESSION;\n',
+ 'factory $CTOR($PARAMS) => '
+ '$FACTORY.$CTOR_FACTORY_NAME($FACTORY_PARAMS);\n',
CTOR=constructor_info._ConstructorFullName(self._DartType),
PARAMS=constructor_info.ParametersAsDeclaration(self._DartType),
- FACTORY_EXPRESSION=factory_expression,
- METADATA=metadata)
+ FACTORY=factory_name,
+ METADATA=metadata,
+ CTOR_FACTORY_NAME=factory_constructor_name,
+ FACTORY_PARAMS=factory_parameters)
else:
inits = self._members_emitter.Emit(
'\n $(METADATA)'
'factory $CONSTRUCTOR($PARAMS) {\n'
- ' var e = $FACTORY_EXPRESSION;\n'
+ ' var e = $FACTORY.$CTOR_FACTORY_NAME($FACTORY_PARAMS);\n'
'$!INITS'
' return e;\n'
' }\n',
CONSTRUCTOR=constructor_info._ConstructorFullName(self._DartType),
METADATA=metadata,
- FACTORY_EXPRESSION=factory_expression,
- PARAMS=constructor_info.ParametersAsDeclaration(self._DartType))
+ FACTORY=factory_name,
+ CTOR_FACTORY_NAME=factory_constructor_name,
+ PARAMS=constructor_info.ParametersAsDeclaration(self._DartType),
+ FACTORY_PARAMS=factory_parameters)
for index, param_info in enumerate(constructor_info.param_infos):
if param_info.is_optional:
@@ -626,14 +628,6 @@ class HtmlDartGenerator(object):
IsOptional,
overload_emitter)
- def FactoryConstructorExpression(self, constructor_info,
- factory_name, factory_constructor_name, factory_parameters):
- return emitter.Format(
- '$FACTORY.$CTOR_FACTORY_NAME($FACTORY_PARAMS)',
- FACTORY=factory_name,
- CTOR_FACTORY_NAME=factory_constructor_name,
- FACTORY_PARAMS=factory_parameters);
-
def _AddFutureifiedOperation(self, info, html_name):
"""Given a API function that uses callbacks, convert it to using Futures.
« no previous file with comments | « tests/html/element_types_test.dart ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698