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: |