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

Unified Diff: sdk/lib/html/scripts/htmldartgenerator.py

Issue 11697007: Generate static factories with optional arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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: sdk/lib/html/scripts/htmldartgenerator.py
diff --git a/sdk/lib/html/scripts/htmldartgenerator.py b/sdk/lib/html/scripts/htmldartgenerator.py
index 5275cf131958b96b7086c851b066fcfcc7042e3c..1d7e1c067c8effe7cb5c3e38b2cdaee6a61904b3 100644
--- a/sdk/lib/html/scripts/htmldartgenerator.py
+++ b/sdk/lib/html/scripts/htmldartgenerator.py
@@ -274,7 +274,7 @@ class HtmlDartGenerator(object):
' if (!?$OPT_PARAM_NAME) {\n'
' return $FACTORY._create($FACTORY_PARAMS);\n'
' }\n',
- OPT_PARAM_NAME=constructor_info.param_infos[index].name,
+ OPT_PARAM_NAME=param_info.name,
FACTORY=factory_name,
FACTORY_PARAMS=constructor_info.ParametersAsArgumentList(index))
else:
@@ -293,8 +293,7 @@ class HtmlDartGenerator(object):
for index, param_info in enumerate(constructor_info.param_infos):
if param_info.is_optional:
- inits.Emit(' if ($E != null) e.$E = $E;\n',
- E=constructor_info.param_infos[index].name)
+ inits.Emit(' if ($E != null) e.$E = $E;\n', E=param_info.name)
if not constructor_info.pure_dart_constructor:
template_file = ('factoryprovider_%s.darttemplate' % self._interface.doc_js_name)

Powered by Google App Engine
This is Rietveld 408576698