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

Unified Diff: lib/src/codegen/js_codegen.dart

Issue 997143003: Fix for conditional expressions (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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/src/codegen/js_codegen.dart
diff --git a/lib/src/codegen/js_codegen.dart b/lib/src/codegen/js_codegen.dart
index 6f135f0d21cad9d566835518470bb9e35b167124..ef686a81d5a87c6111c369e5b9bb63977e245185 100644
--- a/lib/src/codegen/js_codegen.dart
+++ b/lib/src/codegen/js_codegen.dart
@@ -960,8 +960,9 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
new JS.VariableDeclaration(last.name.name),
_visit(lastInitializer.target)));
- var result =
- <JS.Expression>[new JS.VariableDeclarationList('let', variables)];
+ var result = <JS.Expression>[
Siggi Cherem (dart-lang) 2015/03/16 15:11:40 I think you might have an older version of the for
vsm 2015/03/16 15:30:38 You are right. Upgrading and rerunning. We proba
+ new JS.VariableDeclarationList('let', variables)
+ ];
result.addAll(_visitList(lastInitializer.cascadeSections));
_cascadeTarget = savedCascadeTemp;
return _statement(result.map((e) => new JS.ExpressionStatement(e)));
@@ -1016,8 +1017,9 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
void _flushLibraryProperties(List<JS.Statement> body) {
if (_properties.isEmpty) return;
- body.add(js.statement('dart.copyProperties($_EXPORTS, { # });',
- [_properties.map(_emitTopLevelProperty)]));
+ body.add(js.statement('dart.copyProperties($_EXPORTS, { # });', [
+ _properties.map(_emitTopLevelProperty)
+ ]));
_properties.clear();
}
@@ -1609,8 +1611,9 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
@override
visitListLiteral(ListLiteral node) {
// TODO(jmesserly): make this faster. We're wasting an array.
- var list = js.call('new List.from(#)',
- [new JS.ArrayInitializer(_visitList(node.elements))]);
+ var list = js.call('new List.from(#)', [
+ new JS.ArrayInitializer(_visitList(node.elements))
+ ]);
if (node.constKeyword != null) {
list = js.commentExpression('Unimplemented const', list);
}
@@ -1936,9 +1939,8 @@ class JSGenerator extends CodeGenerator {
if (options.emitSourceMaps) {
var outFilename = path.basename(outputPath);
var printer = new srcmaps.Printer(outFilename);
- _writeNode(
- new SourceMapPrintingContext(printer, path.dirname(outputPath)),
- jsTree);
+ _writeNode(new SourceMapPrintingContext(
+ printer, path.dirname(outputPath)), jsTree);
printer.add('//# sourceMappingURL=$outFilename.map');
// Write output file and source map
var text = printer.text;

Powered by Google App Engine
This is Rietveld 408576698