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

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

Issue 20742002: Clean up error handling. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added documentation guide lines. Created 7 years, 5 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
Index: dart/tests/compiler/dart2js/compiler_test.dart
diff --git a/dart/tests/compiler/dart2js/compiler_test.dart b/dart/tests/compiler/dart2js/compiler_test.dart
index e9ba0249f19babbdf173302c8d4e855f5598b7df..83902ad4f8e77e53c92a77d70247a8620c0ccbfd 100644
--- a/dart/tests/compiler/dart2js/compiler_test.dart
+++ b/dart/tests/compiler/dart2js/compiler_test.dart
@@ -25,9 +25,11 @@ class CallbackMockCompiler extends MockCompiler {
super.reportWarning(node, message);
}
- void reportError(Node node, var message) {
- if (onError != null) onError(this, node, message);
- super.reportError(node, message);
+ void reportError(Spannable node,
+ MessageKind errorCode,
+ [Map arguments = const {}]) {
+ if (onError != null) onError(this, node, errorCode.error(arguments));
+ super.reportError(node, errorCode, arguments);
}
}
@@ -38,7 +40,8 @@ testErrorHandling() {
ResolverVisitor visitor = compiler.resolverVisitor();
compiler.parseScript('NoSuchPrefix.NoSuchType foo() {}');
FunctionElement foo = compiler.mainApp.find(buildSourceString('foo'));
- compiler.setOnWarning((c, n, m) => Expect.equals(foo, compiler.currentElement));
+ compiler.setOnWarning(
+ (c, n, m) => Expect.equals(foo, compiler.currentElement));
foo.computeType(compiler);
Expect.equals(1, compiler.warnings.length);
}

Powered by Google App Engine
This is Rietveld 408576698