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