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

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

Issue 896723009: Annotate dart:html constructor expressions with precise non-nullable types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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/htmldartgenerator.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/systemhtml.py
diff --git a/tools/dom/scripts/systemhtml.py b/tools/dom/scripts/systemhtml.py
index f4bb12482dc1cc4c34ef0c1409b1ec309a64ca46..c8560bbc6e247ef66f67b13cea2cac423a5e362f 100644
--- a/tools/dom/scripts/systemhtml.py
+++ b/tools/dom/scripts/systemhtml.py
@@ -722,6 +722,27 @@ class Dart2JSBackend(HtmlDartGenerator):
def IsConstructorArgumentOptional(self, argument):
return argument.optional
+ def XXFactoryConstructorExpression(self, constructor_info,
+ factory_name, factory_constructor_name, factory_parameters):
+ if factory_name == 'document' and factory_constructor_name == 'createElement':
Alan Knight 2015/02/06 18:41:03 80 columns
sra1 2015/02/06 22:45:44 Done.
+ return emitter.Format(
+ '''JS('$TYPE', '$FACTORY.$CTOR_FACTORY_NAME($FACTORY_PARAMS))''',
+ TYPE=self._DartType(constructor_info.type_name),
+ FACTORY=factory_name,
+ CTOR_FACTORY_NAME=factory_constructor_name,
+ FACTORY_PARAMS=factory_parameters);
+ return super(Dart2JSBackend, self).FactoryConstructorExpression(
+ constructor_info, factory_name, factory_constructor_name, factory_parameters)
Alan Knight 2015/02/06 18:41:03 and here
sra1 2015/02/06 22:45:44 Done.
+
+ def FactoryConstructorExpression(self, constructor_info,
+ factory_name, factory_constructor_name, factory_parameters):
+ expression = super(Dart2JSBackend, self).FactoryConstructorExpression(
+ constructor_info, factory_name, factory_constructor_name, factory_parameters)
Alan Knight 2015/02/06 18:41:02 also 80 cols
sra1 2015/02/06 22:45:44 Done.
+ return emitter.Format(
+ "JS('$TYPE', '#', $VALUE)",
+ TYPE=self._DartType(constructor_info.type_name),
+ VALUE=expression)
+
def EmitStaticFactoryOverload(self, constructor_info, name, arguments):
index = len(arguments)
arguments = constructor_info.ParametersAsArgumentList(index)
« no previous file with comments | « tools/dom/scripts/htmldartgenerator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698