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

Unified Diff: lib/html/scripts/systemhtml.py

Issue 11196020: Force named arguments in constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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/html/scripts/generator.py ('k') | tests/html/element_constructor_1_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/scripts/systemhtml.py
diff --git a/lib/html/scripts/systemhtml.py b/lib/html/scripts/systemhtml.py
index caa51ef4ed6e6396e9b779196c1727a4c5b1c686..897fcd638433daa1b23cd3429b3cdd828593ce7f 100644
--- a/lib/html/scripts/systemhtml.py
+++ b/lib/html/scripts/systemhtml.py
@@ -84,6 +84,7 @@ class ElementConstructorInfo(object):
info.type_name = interface_name
info.param_infos = map(lambda tXn: ParamInfo(tXn[1], tXn[0], True),
self.opt_params)
+ info.requires_named_arguments = True
return info
_html_element_constructors = {
@@ -185,7 +186,8 @@ def EmitHtmlElementFactoryConstructors(emitter, infos, typename, class_name,
CONSTRUCTOR=constructor_info.ConstructorFactoryName(rename_type),
CLASS=class_name,
TAG=info.tag,
- PARAMS=constructor_info.ParametersDeclaration(rename_type))
+ PARAMS=constructor_info.ParametersDeclaration(
+ rename_type, force_optional=True))
for param in constructor_info.param_infos:
inits.Emit(' if ($E != null) _e.$E = $E;\n', E=param.name)
« no previous file with comments | « lib/html/scripts/generator.py ('k') | tests/html/element_constructor_1_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698