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

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

Issue 13084013: Handle assignability for Send and SendSet (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix dart2dart bugs. Created 7 years, 7 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 | « tests/compiler/dart2js/analyze_api_test.dart ('k') | tests/compiler/dart2js/parser_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/mock_compiler.dart
diff --git a/tests/compiler/dart2js/mock_compiler.dart b/tests/compiler/dart2js/mock_compiler.dart
index 8e95867081a25bc7f38e3aee28840184f843ed5a..9129573db63d7384eb5ad4d70de648b81f3c8e8e 100644
--- a/tests/compiler/dart2js/mock_compiler.dart
+++ b/tests/compiler/dart2js/mock_compiler.dart
@@ -173,6 +173,7 @@ const String DEFAULT_ISOLATE_HELPERLIB = r'''
class _WorkerBase {}''';
class MockCompiler extends Compiler {
+ api.DiagnosticHandler diagnosticHandler;
List<WarningMessage> warnings;
List<WarningMessage> errors;
final Map<String, SourceFile> sourceFiles;
@@ -256,6 +257,8 @@ class MockCompiler extends Compiler {
void reportWarning(Node node, var message) {
if (message is! Message) message = message.message;
warnings.add(new WarningMessage(node, message));
+ reportDiagnostic(spanFromNode(node),
+ 'Warning: $message', api.Diagnostic.WARNING);
}
void reportError(Node node, var message) {
@@ -265,6 +268,8 @@ class MockCompiler extends Compiler {
}
if (message is! Message) message = message.message;
errors.add(new WarningMessage(node, message));
+ reportDiagnostic(spanFromNode(node),
+ 'Error: $message', api.Diagnostic.ERROR);
}
void reportMessage(SourceSpan span, var message, api.Diagnostic kind) {
@@ -274,10 +279,17 @@ class MockCompiler extends Compiler {
} else {
warnings.add(diagnostic);
}
+ reportDiagnostic(span, "$message", kind);
}
- void reportDiagnostic(SourceSpan span, String message, var kind) {
- print(message);
+ void reportDiagnostic(SourceSpan span, String message, api.Diagnostic kind) {
+ if (diagnosticHandler != null) {
+ if (span != null) {
+ diagnosticHandler(span.uri, span.begin, span.end, message, kind);
+ } else {
+ diagnosticHandler(null, null, null, message, kind);
+ }
+ }
}
bool get compilationFailed => !errors.isEmpty;
@@ -319,7 +331,7 @@ class MockCompiler extends Compiler {
parseScript(String text, [LibraryElement library]) {
if (library == null) library = mainApp;
- parseUnit(text, this, library);
+ parseUnit(text, this, library, registerSource);
}
void scanBuiltinLibraries() {
« no previous file with comments | « tests/compiler/dart2js/analyze_api_test.dart ('k') | tests/compiler/dart2js/parser_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698