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

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

Issue 717103004: Revert "Emit warning on import of dart:mirrors." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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.message_kind_helper; 5 library dart2js.test.message_kind_helper;
6 6
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 import 'dart:async'; 8 import 'dart:async';
9 9
10 import 'package:compiler/src/dart2jslib.dart' show 10 import 'package:compiler/src/dart2jslib.dart' show
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 void collect(Uri uri, int begin, int end, String message, kind) { 76 void collect(Uri uri, int begin, int end, String message, kind) {
77 if (kind.name == 'verbose info' || kind.name == 'info') { 77 if (kind.name == 'verbose info' || kind.name == 'info') {
78 return; 78 return;
79 } 79 }
80 messages.add(message); 80 messages.add(message);
81 } 81 }
82 82
83 Compiler compiler = compilerFor( 83 Compiler compiler = compilerFor(
84 example, 84 example,
85 diagnosticHandler: collect, 85 diagnosticHandler: collect,
86 options: ['--analyze-only', 86 options: ['--analyze-only']..addAll(kind.options),
87 '--enable-experimental-mirrors']..addAll(kind.options),
88 cachedCompiler: cachedCompiler); 87 cachedCompiler: cachedCompiler);
89 88
90 return compiler.run(Uri.parse('memory:main.dart')).then((_) { 89 return compiler.run(Uri.parse('memory:main.dart')).then((_) {
91 90
92 Expect.isFalse(messages.isEmpty, 'No messages in """$example"""'); 91 Expect.isFalse(messages.isEmpty, 'No messages in """$example"""');
93 92
94 String expectedText = !kind.hasHowToFix 93 String expectedText = !kind.hasHowToFix
95 ? kind.template : '${kind.template}\n${kind.howToFix}'; 94 ? kind.template : '${kind.template}\n${kind.howToFix}';
96 String pattern = expectedText.replaceAllMapped( 95 String pattern = expectedText.replaceAllMapped(
97 new RegExp(ESCAPE_REGEXP), (m) => '\\${m[0]}'); 96 new RegExp(ESCAPE_REGEXP), (m) => '\\${m[0]}');
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 Expect.isTrue(!pendingStuff || kindsWithPendingClasses.contains(kind)); 138 Expect.isTrue(!pendingStuff || kindsWithPendingClasses.contains(kind));
140 139
141 if (!pendingStuff && !compiler.compilerWasCancelled) { 140 if (!pendingStuff && !compiler.compilerWasCancelled) {
142 // If there is pending stuff, or the compiler was cancelled, we 141 // If there is pending stuff, or the compiler was cancelled, we
143 // shouldn't reuse the compiler. 142 // shouldn't reuse the compiler.
144 cachedCompiler = compiler; 143 cachedCompiler = compiler;
145 } 144 }
146 }); 145 });
147 }).then((_) => cachedCompiler); 146 }).then((_) => cachedCompiler);
148 } 147 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/memory_compiler.dart ('k') | tests/compiler/dart2js/message_kind_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698