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

Side by Side Diff: tests/compiler/dart2js/diagnostic_helper.dart

Issue 1914973002: Reinsert (and test) handling of exceptions from user code. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/library_loader.dart ('k') | tests/compiler/dart2js/user_crash_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart2js.test.diagnostic_helper; 5 library dart2js.test.diagnostic_helper;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:compiler/compiler_new.dart' show 9 import 'package:compiler/compiler_new.dart' show
10 CompilerDiagnostics, 10 CompilerDiagnostics,
(...skipping 18 matching lines...) Expand all
29 29
30 String toString() { 30 String toString() {
31 return '${message != null ? message.kind : ''}' 31 return '${message != null ? message.kind : ''}'
32 ':$uri:$begin:$end:$text:$kind'; 32 ':$uri:$begin:$end:$text:$kind';
33 } 33 }
34 } 34 }
35 35
36 class DiagnosticCollector implements CompilerDiagnostics { 36 class DiagnosticCollector implements CompilerDiagnostics {
37 List<CollectedMessage> messages = <CollectedMessage>[]; 37 List<CollectedMessage> messages = <CollectedMessage>[];
38 38
39 void call(Uri uri, int begin, int end, String message, Diagnostic kind) {
40 throw '';
41 report(null, uri, begin, end, message, kind);
42 }
43
44 @override 39 @override
45 void report(Message message, 40 void report(Message message,
46 Uri uri, int begin, int end, String text, Diagnostic kind) { 41 Uri uri, int begin, int end, String text, Diagnostic kind) {
47 messages.add(new CollectedMessage(message, uri, begin, end, text, kind)); 42 messages.add(new CollectedMessage(message, uri, begin, end, text, kind));
48 } 43 }
49 44
50 Iterable<CollectedMessage> filterMessagesByKinds(List<Diagnostic> kinds) { 45 Iterable<CollectedMessage> filterMessagesByKinds(List<Diagnostic> kinds) {
51 return messages.where( 46 return messages.where(
52 (CollectedMessage message) => kinds.contains(message.kind)); 47 (CollectedMessage message) => kinds.contains(message.kind));
53 } 48 }
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 String expectedValue = '${arguments[key]}'; 180 String expectedValue = '${arguments[key]}';
186 String foundValue = '${message.arguments[key]}'; 181 String foundValue = '${message.arguments[key]}';
187 if (expectedValue != foundValue) { 182 if (expectedValue != foundValue) {
188 return 'Expected argument $key with value $expectedValue, ' 183 return 'Expected argument $key with value $expectedValue, '
189 'found $foundValue.'; 184 'found $foundValue.';
190 } 185 }
191 } 186 }
192 return null; 187 return null;
193 }; 188 };
194 } 189 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/library_loader.dart ('k') | tests/compiler/dart2js/user_crash_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698