Index: tests/compiler/dart2js/parser_helper.dart |
diff --git a/tests/compiler/dart2js/parser_helper.dart b/tests/compiler/dart2js/parser_helper.dart |
index ff603cd61e46749c575c43ca4a8ce7a8ddafc7f7..572a082ffaa0ddbd823ac9908f43115085623c58 100644 |
--- a/tests/compiler/dart2js/parser_helper.dart |
+++ b/tests/compiler/dart2js/parser_helper.dart |
@@ -37,7 +37,7 @@ export 'package:compiler/src/parser/partial_elements.dart'; |
export "package:compiler/src/tokens/token.dart"; |
export "package:compiler/src/tokens/token_constants.dart"; |
-class LoggerCanceler extends DiagnosticListener { |
+class LoggerCanceler extends DiagnosticReporter { |
void log(message) { |
print(message); |
} |
@@ -93,15 +93,15 @@ Token scan(String text) => |
.tokenize(); |
Node parseBodyCode(String text, Function parseMethod, |
- {DiagnosticListener diagnosticHandler}) { |
+ {DiagnosticReporter reporter}) { |
Token tokens = scan(text); |
- if (diagnosticHandler == null) diagnosticHandler = new LoggerCanceler(); |
+ if (reporter == null) reporter = new LoggerCanceler(); |
Uri uri = new Uri(scheme: "source"); |
Script script = new Script(uri, uri,new MockFile(text)); |
LibraryElement library = new LibraryElementX(script); |
library.canUseNative = true; |
NodeListener listener = |
- new NodeListener(diagnosticHandler, library.entryCompilationUnit); |
+ new NodeListener(reporter, library.entryCompilationUnit); |
Parser parser = new Parser(listener); |
Token endToken = parseMethod(parser, tokens); |
assert(endToken.kind == EOF_TOKEN); |
@@ -121,9 +121,11 @@ Node parseFunction(String text, Compiler compiler) { |
return element.parseNode(compiler.parsing); |
} |
-Node parseMember(String text, {DiagnosticListener diagnosticHandler}) { |
- return parseBodyCode(text, (parser, tokens) => parser.parseMember(tokens), |
- diagnosticHandler: diagnosticHandler); |
+Node parseMember(String text, {DiagnosticReporter reporter}) { |
+ return parseBodyCode( |
+ text, |
+ (parser, tokens) => parser.parseMember(tokens), |
+ reporter: reporter); |
} |
class MockFile extends StringSourceFile { |
@@ -144,13 +146,16 @@ Link<Element> parseUnit(String text, Compiler compiler, |
var script = new Script(uri, uri, new MockFile(text)); |
var unit = new CompilationUnitElementX(script, library); |
int id = 0; |
- ElementListener listener = new ElementListener(compiler, unit, () => id++); |
+ DiagnosticReporter reporter = compiler.reporter; |
+ ElementListener listener = new ElementListener(reporter, unit, () => id++); |
PartialParser parser = new PartialParser(listener); |
- compiler.withCurrentElement(unit, () => parser.parseUnit(tokens)); |
+ reporter.withCurrentElement(unit, () => parser.parseUnit(tokens)); |
return unit.localMembers; |
} |
-NodeList fullParseUnit(String source, {DiagnosticListener diagnosticHandler}) { |
- return parseBodyCode(source, (parser, tokens) => parser.parseUnit(tokens), |
- diagnosticHandler: diagnosticHandler); |
+NodeList fullParseUnit(String source, {DiagnosticReporter reporter}) { |
+ return parseBodyCode( |
+ source, |
+ (parser, tokens) => parser.parseUnit(tokens), |
+ reporter: reporter); |
} |