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

Side by Side Diff: dart/sdk/lib/_internal/compiler/implementation/tree/unparser.dart

Issue 11788016: Update dart2js unit tests to new library API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: No need to implement Iterable Created 7 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 unified diff | Download patch | Annotate | Revision Log
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 tree; 5 part of tree;
6 6
7 String unparse(Node node) { 7 String unparse(Node node) {
8 Unparser unparser = new Unparser(); 8 Unparser unparser = new Unparser();
9 unparser.unparse(node); 9 unparser.unparse(node);
10 return unparser.result; 10 return unparser.result;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 sb.add(' '); 131 sb.add(' ');
132 } 132 }
133 } 133 }
134 visit(send.selector); 134 visit(send.selector);
135 } else { 135 } else {
136 visit(name); 136 visit(name);
137 } 137 }
138 } 138 }
139 139
140 visitFunctionExpression(FunctionExpression node) { 140 visitFunctionExpression(FunctionExpression node) {
141 // Check length to not print unnecessary whitespace. 141 if (!node.modifiers.nodes.isEmpty) {
142 if (node.modifiers.nodes.length > 0) {
143 visit(node.modifiers); 142 visit(node.modifiers);
144 sb.add(' '); 143 sb.add(' ');
145 } 144 }
146 if (node.returnType != null) { 145 if (node.returnType != null) {
147 visit(node.returnType); 146 visit(node.returnType);
148 sb.add(' '); 147 sb.add(' ');
149 } 148 }
150 if (node.getOrSet != null) { 149 if (node.getOrSet != null) {
151 add(node.getOrSet.value); 150 add(node.getOrSet.value);
152 sb.add(' '); 151 sb.add(' ');
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 visitTypeVariable(TypeVariable node) { 326 visitTypeVariable(TypeVariable node) {
328 visit(node.name); 327 visit(node.name);
329 if (node.bound != null) { 328 if (node.bound != null) {
330 sb.add(' extends '); 329 sb.add(' extends ');
331 visit(node.bound); 330 visit(node.bound);
332 } 331 }
333 } 332 }
334 333
335 visitVariableDefinitions(VariableDefinitions node) { 334 visitVariableDefinitions(VariableDefinitions node) {
336 visit(node.modifiers); 335 visit(node.modifiers);
337 if (node.modifiers.nodes.length > 0) { 336 if (!node.modifiers.nodes.isEmpty) {
338 sb.add(' '); 337 sb.add(' ');
339 } 338 }
340 if (node.type != null) { 339 if (node.type != null) {
341 visit(node.type); 340 visit(node.type);
342 sb.add(' '); 341 sb.add(' ');
343 } 342 }
344 visit(node.definitions); 343 visit(node.definitions);
345 if (node.endToken.value == const SourceString(';')) { 344 if (node.endToken.value == const SourceString(';')) {
346 add(node.endToken.value); 345 add(node.endToken.value);
347 } 346 }
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 } 596 }
598 597
599 visitStatement(Statement node) { 598 visitStatement(Statement node) {
600 throw 'internal error'; // Should not be called. 599 throw 'internal error'; // Should not be called.
601 } 600 }
602 601
603 visitStringNode(StringNode node) { 602 visitStringNode(StringNode node) {
604 throw 'internal error'; // Should not be called. 603 throw 'internal error'; // Should not be called.
605 } 604 }
606 } 605 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698