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

Side by Side Diff: lib/src/js/printer.dart

Issue 1069493002: implement opassign, fix bugs in pre/postfix, introduce a let* helper (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of js_ast; 5 part of js_ast;
6 6
7 7
8 class JavaScriptPrintingOptions { 8 class JavaScriptPrintingOptions {
9 final bool shouldCompressOutput; 9 final bool shouldCompressOutput;
10 final bool minifyLocalVariables; 10 final bool minifyLocalVariables;
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 out("("); 831 out("(");
832 if (fun.params != null) { 832 if (fun.params != null) {
833 visitCommaSeparated(fun.params, PRIMARY, 833 visitCommaSeparated(fun.params, PRIMARY,
834 newInForInit: false, newAtStatementBegin: false); 834 newInForInit: false, newAtStatementBegin: false);
835 } 835 }
836 out(")"); 836 out(")");
837 spaceOut(); 837 spaceOut();
838 out("=>"); 838 out("=>");
839 if (fun.body is Expression) { 839 if (fun.body is Expression) {
840 spaceOut(); 840 spaceOut();
841 fun.body.accept(this); 841 visitNestedExpression(fun.body, ASSIGNMENT,
842 newInForInit: false, newAtStatementBegin: false);
842 } else { 843 } else {
843 blockBody(fun.body, needsSeparation: false, needsNewline: false); 844 blockBody(fun.body, needsSeparation: false, needsNewline: false);
844 } 845 }
845 localNamer.leaveScope(); 846 localNamer.leaveScope();
846 if (fun.bindThisWorkaround) { 847 if (fun.bindThisWorkaround) {
847 out(").bind(this)"); 848 out(").bind(this)");
848 } 849 }
849 } 850 }
850 851
851 visitLiteralBool(LiteralBool node) { 852 visitLiteralBool(LiteralBool node) {
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1375 codes.add(nthLetter((n ~/ nameSpaceSize) % LETTERS)); 1376 codes.add(nthLetter((n ~/ nameSpaceSize) % LETTERS));
1376 } 1377 }
1377 codes.add(charCodes.$0 + digit); 1378 codes.add(charCodes.$0 + digit);
1378 newName = new String.fromCharCodes(codes); 1379 newName = new String.fromCharCodes(codes);
1379 } 1380 }
1380 assert(new RegExp(r'[a-zA-Z][a-zA-Z0-9]*').hasMatch(newName)); 1381 assert(new RegExp(r'[a-zA-Z][a-zA-Z0-9]*').hasMatch(newName));
1381 maps.last[oldName] = newName; 1382 maps.last[oldName] = newName;
1382 return newName; 1383 return newName;
1383 } 1384 }
1384 } 1385 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698