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

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
Index: lib/html/scripts/systemhtml.py
diff --git a/lib/html/scripts/systemhtml.py b/lib/html/scripts/systemhtml.py
index 40d04076105d93fcabce206c20ae1d52929ed8c5..572ca81e36e91aaae52aa24120c72153521077ad 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.ParametersInterfaceDeclaration(rename_type))
+ PARAMS=constructor_info.ParametersInterfaceDeclaration(
+ rename_type, force_optional=True))
for param in constructor_info.param_infos:
inits.Emit(' if ($E != null) _e.$E = $E;\n', E=param.name)

Powered by Google App Engine
This is Rietveld 408576698