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

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

Issue 963063003: DDC fixes on DDC (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 unified diff | Download patch
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | lib/src/js/template.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1278 * Returns true, if the given node must be wrapped into braces when used 1278 * Returns true, if the given node must be wrapped into braces when used
1279 * as then-statement in an [If] that has an else branch. 1279 * as then-statement in an [If] that has an else branch.
1280 */ 1280 */
1281 class DanglingElseVisitor extends BaseVisitor<bool> { 1281 class DanglingElseVisitor extends BaseVisitor<bool> {
1282 JavaScriptPrintingContext context; 1282 JavaScriptPrintingContext context;
1283 1283
1284 DanglingElseVisitor(this.context); 1284 DanglingElseVisitor(this.context);
1285 1285
1286 bool visitProgram(Program node) => false; 1286 bool visitProgram(Program node) => false;
1287 1287
1288 bool visitNode(Statement node) { 1288 bool visitNode(Node node) {
1289 context.error("Forgot node: $node"); 1289 context.error("Forgot node: $node");
1290 return null; 1290 return null;
1291 } 1291 }
1292 1292
1293 bool visitBlock(Block node) => false; 1293 bool visitBlock(Block node) => false;
1294 bool visitExpressionStatement(ExpressionStatement node) => false; 1294 bool visitExpressionStatement(ExpressionStatement node) => false;
1295 bool visitEmptyStatement(EmptyStatement node) => false; 1295 bool visitEmptyStatement(EmptyStatement node) => false;
1296 bool visitIf(If node) { 1296 bool visitIf(If node) {
1297 if (!node.hasElse) return true; 1297 if (!node.hasElse) return true;
1298 return node.otherwise.accept(this); 1298 return node.otherwise.accept(this);
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1458 codes.add(nthLetter((n ~/ nameSpaceSize) % LETTERS)); 1458 codes.add(nthLetter((n ~/ nameSpaceSize) % LETTERS));
1459 } 1459 }
1460 codes.add(charCodes.$0 + digit); 1460 codes.add(charCodes.$0 + digit);
1461 newName = new String.fromCharCodes(codes); 1461 newName = new String.fromCharCodes(codes);
1462 } 1462 }
1463 assert(new RegExp(r'[a-zA-Z][a-zA-Z0-9]*').hasMatch(newName)); 1463 assert(new RegExp(r'[a-zA-Z][a-zA-Z0-9]*').hasMatch(newName));
1464 maps.last[oldName] = newName; 1464 maps.last[oldName] = newName;
1465 return newName; 1465 return newName;
1466 } 1466 }
1467 } 1467 }
OLDNEW
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | lib/src/js/template.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698