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

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

Issue 2705213003: Refined types for most HtmlElement factory constructors (Closed)
Patch Set: Created 3 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 | « tools/dom/scripts/css_code_generator.py ('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 2d5e52d12456adf936a5f64aea243ed4081d5cb3..62056e7372a046fda358ba223c8aad680b8e6b09 100644
--- a/tools/dom/scripts/htmldartgenerator.py
+++ b/tools/dom/scripts/htmldartgenerator.py
@@ -572,32 +572,30 @@ class HtmlDartGenerator(object):
# TODO(antonm): use common dispatcher generation for this case as well.
has_optional = any(param_info.is_optional
for param_info in constructor_info.param_infos)
-
+ factory_call = self.MakeFactoryCall(
+ factory_name, factory_constructor_name, factory_parameters,
+ constructor_info)
if not has_optional:
self._members_emitter.Emit(
'\n $(METADATA)'
'factory $CTOR($PARAMS) => '
- '$FACTORY.$CTOR_FACTORY_NAME($FACTORY_PARAMS);\n',
+ '$FACTORY_CALL;\n',
CTOR=constructor_info._ConstructorFullName(self._DartType),
PARAMS=constructor_info.ParametersAsDeclaration(InputType),
- FACTORY=factory_name,
- METADATA=metadata,
- CTOR_FACTORY_NAME=factory_constructor_name,
- FACTORY_PARAMS=factory_parameters)
+ FACTORY_CALL=factory_call,
+ METADATA=metadata)
else:
inits = self._members_emitter.Emit(
'\n $(METADATA)'
'factory $CONSTRUCTOR($PARAMS) {\n'
- ' $CONSTRUCTOR e = $FACTORY.$CTOR_FACTORY_NAME($FACTORY_PARAMS);\n'
+ ' $CONSTRUCTOR e = $FACTORY_CALL;\n'
'$!INITS'
' return e;\n'
' }\n',
CONSTRUCTOR=constructor_info._ConstructorFullName(self._DartType),
METADATA=metadata,
- FACTORY=factory_name,
- CTOR_FACTORY_NAME=factory_constructor_name,
- PARAMS=constructor_info.ParametersAsDeclaration(InputType),
- FACTORY_PARAMS=factory_parameters)
+ FACTORY_CALL=factory_call,
+ PARAMS=constructor_info.ParametersAsDeclaration(InputType))
for index, param_info in enumerate(constructor_info.param_infos):
if param_info.is_optional:
« no previous file with comments | « tools/dom/scripts/css_code_generator.py ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698