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

Unified Diff: dart/tests/compiler/dart2js/parser_helper.dart

Issue 11367007: Tests owed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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
« no previous file with comments | « no previous file | dart/tests/compiler/dart2js/parser_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/compiler/dart2js/parser_helper.dart
diff --git a/dart/tests/compiler/dart2js/parser_helper.dart b/dart/tests/compiler/dart2js/parser_helper.dart
index dca44baca613efcaac263c21254d1d57e575fa2c..fee2dd8703c7698e72cc76da24e2c0126f9ed124 100644
--- a/dart/tests/compiler/dart2js/parser_helper.dart
+++ b/dart/tests/compiler/dart2js/parser_helper.dart
@@ -8,11 +8,16 @@ import "dart:uri";
import "../../../lib/compiler/implementation/elements/elements.dart";
import "../../../lib/compiler/implementation/tree/tree.dart";
-import '../../../lib/compiler/implementation/scanner/scannerlib.dart';
+import "../../../lib/compiler/implementation/scanner/scannerlib.dart";
import "../../../lib/compiler/implementation/dart2jslib.dart" hide SourceString;
import "../../../lib/compiler/implementation/source_file.dart";
import "../../../lib/compiler/implementation/util/util.dart";
+export "../../../lib/compiler/implementation/dart2jslib.dart"
+ show DiagnosticListener;
+// TODO(ahe): We should have token library to export instead.
+export "../../../lib/compiler/implementation/scanner/scannerlib.dart";
+
class LoggerCanceler implements DiagnosticListener {
void cancel(String reason, {node, token, instruction, element}) {
throw new CompilerCancelledException(reason);
@@ -25,9 +30,9 @@ class LoggerCanceler implements DiagnosticListener {
Token scan(String text) => new StringScanner(text).tokenize();
-Node parseBodyCode(String text, Function parseMethod) {
+Node parseBodyCode(String text, Function parseMethod, {DiagnosticListener lc}) {
Johnni Winther 2012/10/31 12:24:22 Bad name. I can see from the code that it is an ab
ahe 2012/10/31 14:00:09 Done.
Token tokens = scan(text);
- LoggerCanceler lc = new LoggerCanceler();
+ if (lc == null) lc = new LoggerCanceler();
Script script =
new Script(
new Uri.fromComponents(scheme: "source"),
@@ -54,8 +59,8 @@ Node parseFunction(String text, Compiler compiler) {
return element.parseNode(compiler);
}
-Node parseMember(String text) =>
- parseBodyCode(text, (parser, tokens) => parser.parseMember(tokens));
+Node parseMember(String text, {DiagnosticListener lc}) =>
Johnni Winther 2012/10/31 12:24:22 Also bad name here.
ahe 2012/10/31 14:00:09 Done.
+ parseBodyCode(text, (parser, tokens) => parser.parseMember(tokens), lc: lc);
class MockFile extends SourceFile {
MockFile(text)
« no previous file with comments | « no previous file | dart/tests/compiler/dart2js/parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698