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

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

Issue 1383483006: Extract DiagnosticReporter implementation from Compiler. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixes after rebase. Created 5 years, 2 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // Unit test of the [NativeBehavior.processSpecString] method. 5 // Unit test of the [NativeBehavior.processSpecString] method.
6 6
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 import 'package:compiler/src/native/native.dart'; 8 import 'package:compiler/src/native/native.dart';
9 import 'package:compiler/src/diagnostics/diagnostic_listener.dart'; 9 import 'package:compiler/src/diagnostics/diagnostic_listener.dart';
10 import 'package:compiler/src/diagnostics/messages.dart'; 10 import 'package:compiler/src/diagnostics/messages.dart';
11 import 'package:compiler/src/universe/side_effects.dart' 11 import 'package:compiler/src/universe/side_effects.dart'
12 show SideEffects; 12 show SideEffects;
13 13
14 const OBJECT = 'Object'; 14 const OBJECT = 'Object';
15 const NULL = 'Null'; 15 const NULL = 'Null';
16 16
17 class Listener extends DiagnosticListener { 17 class Listener extends DiagnosticReporter {
18 String errorMessage; 18 String errorMessage;
19 internalError(spannable, message) { 19 internalError(spannable, message) {
20 errorMessage = message; 20 errorMessage = message;
21 throw "error"; 21 throw "error";
22 } 22 }
23 reportError(message, [infos]) { 23 reportError(message, [infos]) {
24 24
25 errorMessage = 25 errorMessage =
26 '${message.message.arguments}'; // E.g. "{text: Duplicate tag 'new'.}" 26 '${message.message.arguments}'; // E.g. "{text: Duplicate tag 'new'.}"
27 throw "error"; 27 throw "error";
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 test('gvn:false', expectedGvn: false); 284 test('gvn:false', expectedGvn: false);
285 test('returns:A;gvn:true', returns: ['A'], expectedGvn: true); 285 test('returns:A;gvn:true', returns: ['A'], expectedGvn: true);
286 test(' gvn : true ; returns:A;', returns: ['A'], expectedGvn: true); 286 test(' gvn : true ; returns:A;', returns: ['A'], expectedGvn: true);
287 test('gvn:true;returns:A;gvn:true', expectError: true); 287 test('gvn:true;returns:A;gvn:true', expectError: true);
288 288
289 test('gvn: true; new: true', expectError: true); 289 test('gvn: true; new: true', expectError: true);
290 test('gvn: true; new: false', expectedGvn: true, expectedNew: false); 290 test('gvn: true; new: false', expectedGvn: true, expectedNew: false);
291 test('gvn: false; new: true', expectedGvn: false, expectedNew: true); 291 test('gvn: false; new: true', expectedGvn: false, expectedNew: true);
292 test('gvn: false; new: false', expectedGvn: false, expectedNew: false); 292 test('gvn: false; new: false', expectedGvn: false, expectedNew: false);
293 } 293 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/exit_code_test.dart ('k') | tests/compiler/dart2js/message_kind_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698