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

Side by Side Diff: tests/compiler/dart2js/unparser2_test.dart

Issue 11238035: Make isEmpty a getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. Created 8 years, 1 month 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 import "../../../lib/compiler/implementation/scanner/scannerlib.dart"; 5 import "../../../lib/compiler/implementation/scanner/scannerlib.dart";
6 import "../../../lib/compiler/implementation/elements/elements.dart" show Compil ationUnitElement, LibraryElement; 6 import "../../../lib/compiler/implementation/elements/elements.dart" show Compil ationUnitElement, LibraryElement;
7 import "../../../lib/compiler/implementation/tree/tree.dart"; 7 import "../../../lib/compiler/implementation/tree/tree.dart";
8 import "../../../lib/compiler/implementation/dart2jslib.dart" show DiagnosticLis tener, Script; 8 import "../../../lib/compiler/implementation/dart2jslib.dart" show DiagnosticLis tener, Script;
9 9
10 main() { 10 main() {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 MessageCollector diagnosticListener = new MessageCollector(); 48 MessageCollector diagnosticListener = new MessageCollector();
49 Script script = new Script(null, null); 49 Script script = new Script(null, null);
50 LibraryElement lib = new LibraryElement(script); 50 LibraryElement lib = new LibraryElement(script);
51 CompilationUnitElement element = new CompilationUnitElement(script, lib); 51 CompilationUnitElement element = new CompilationUnitElement(script, lib);
52 StringScanner scanner = new StringScanner(source); 52 StringScanner scanner = new StringScanner(source);
53 Token beginToken = scanner.tokenize(); 53 Token beginToken = scanner.tokenize();
54 NodeListener listener = new NodeListener(diagnosticListener, element); 54 NodeListener listener = new NodeListener(diagnosticListener, element);
55 Parser parser = new Parser(listener); 55 Parser parser = new Parser(listener);
56 parser.parseUnit(beginToken); 56 parser.parseUnit(beginToken);
57 Node node = listener.popNode(); 57 Node node = listener.popNode();
58 Expect.isTrue(listener.nodes.isEmpty()); 58 Expect.isTrue(listener.nodes.isEmpty);
59 return unparse(node); 59 return unparse(node);
60 } 60 }
61 61
62 class MessageCollector implements DiagnosticListener { 62 class MessageCollector implements DiagnosticListener {
63 List<String> messages; 63 List<String> messages;
64 MessageCollector() { 64 MessageCollector() {
65 messages = []; 65 messages = [];
66 } 66 }
67 void cancel(String reason, {node, token, instruction, element}) { 67 void cancel(String reason, {node, token, instruction, element}) {
68 messages.add(reason); 68 messages.add(reason);
69 throw reason; 69 throw reason;
70 } 70 }
71 void log(message) { 71 void log(message) {
72 messages.add(message); 72 messages.add(message);
73 } 73 }
74 void internalErrorOnElement(Element element, String message) { 74 void internalErrorOnElement(Element element, String message) {
75 throw message; 75 throw message;
76 } 76 }
77 void internalError(String message, 77 void internalError(String message,
78 {Node node, Token token, dynamic instruction, 78 {Node node, Token token, dynamic instruction,
79 Element element}) { 79 Element element}) {
80 throw message; 80 throw message;
81 } 81 }
82 } 82 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/type_checker_test.dart ('k') | tests/compiler/dart2js_extra/no_such_method_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698