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

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

Issue 23533040: Check for non-final field in the face of const constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 7 years, 3 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/resolver_test.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/type_checker_test.dart
diff --git a/tests/compiler/dart2js/type_checker_test.dart b/tests/compiler/dart2js/type_checker_test.dart
index e543480a07e257a566731408dc1f5d767582218f..95c0e0d3791988b0cf959a8c9573c7a24cc0776d 100644
--- a/tests/compiler/dart2js/type_checker_test.dart
+++ b/tests/compiler/dart2js/type_checker_test.dart
@@ -150,8 +150,8 @@ testSwitch() {
analyze("switch (1.0) { case 1.0: break; case 1.5: break; }",
[], []);
analyze("switch (null) { case 1.0: break; case 2: break; }",
- [MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL_CASE,
- MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL_CASE],
+ [MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL_CASE,
+ MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL_CASE],
[MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL]);
}
@@ -1497,7 +1497,7 @@ analyzeTopLevel(String text, [expectedWarnings]) {
if (expectedWarnings == null) expectedWarnings = [];
if (expectedWarnings is !List) expectedWarnings = [expectedWarnings];
- compiler.diagnosticHandler = createHandler(text);
+ compiler.diagnosticHandler = createHandler(compiler, text);
LibraryElement library = mockLibrary(compiler, text);
@@ -1536,29 +1536,13 @@ analyzeTopLevel(String text, [expectedWarnings]) {
compiler.diagnosticHandler = null;
}
-api.DiagnosticHandler createHandler(String text) {
- return (uri, int begin, int end, String message, kind) {
- SourceFile sourceFile;
- if (uri == null) {
- sourceFile = new SourceFile('analysis', text);
- } else {
- sourceFile = compiler.sourceFiles[uri.toString()];
- }
- if (sourceFile != null) {
- print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x));
- } else {
- print(message);
- }
- };
-}
-
analyze(String text, [expectedWarnings, expectedErrors]) {
if (expectedWarnings == null) expectedWarnings = [];
if (expectedWarnings is !List) expectedWarnings = [expectedWarnings];
if (expectedErrors == null) expectedErrors = [];
if (expectedErrors is !List) expectedErrors = [expectedErrors];
- compiler.diagnosticHandler = createHandler(text);
+ compiler.diagnosticHandler = createHandler(compiler, text);
Token tokens = scan(text);
NodeListener listener = new NodeListener(compiler, null);
« no previous file with comments | « tests/compiler/dart2js/resolver_test.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698