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

Side by Side Diff: tests/compiler/dart2js/mirrors_used_test.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
« no previous file with comments | « tests/compiler/dart2js/message_kind_test.dart ('k') | no next file » | 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) 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 /// Test that the @MirrorsUsed annotation suppress hints and that only 5 /// Test that the @MirrorsUsed annotation suppress hints and that only
6 /// requested elements are retained for reflection. 6 /// requested elements are retained for reflection.
7 library dart2js.test.mirrors_used_test; 7 library dart2js.test.mirrors_used_test;
8 8
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 import "package:async_helper/async_helper.dart"; 10 import "package:async_helper/async_helper.dart";
(...skipping 27 matching lines...) Expand all
38 if (kind.name == 'info') return; 38 if (kind.name == 'info') return;
39 39
40 // TODO(aprelev@gmail.com): Remove once dartbug.com/13907 is fixed. 40 // TODO(aprelev@gmail.com): Remove once dartbug.com/13907 is fixed.
41 if (message.contains("Warning: 'typedef' not allowed here")) return; 41 if (message.contains("Warning: 'typedef' not allowed here")) return;
42 42
43 throw '$uri:$begin:$end: $kind: $message'; 43 throw '$uri:$begin:$end: $kind: $message';
44 } 44 }
45 45
46 void main() { 46 void main() {
47 Compiler compiler = compilerFor( 47 Compiler compiler = compilerFor(
48 MEMORY_SOURCE_FILES, diagnosticHandler: expectOnlyVerboseInfo, 48 MEMORY_SOURCE_FILES, diagnosticHandler: expectOnlyVerboseInfo);
49 options: ['--enable-experimental-mirrors']);
50 asyncTest(() => compiler.runCompiler(Uri.parse('memory:main.dart')).then((_) { 49 asyncTest(() => compiler.runCompiler(Uri.parse('memory:main.dart')).then((_) {
51 print(''); 50 print('');
52 List generatedCode = 51 List generatedCode =
53 Elements.sortedByPosition(compiler.enqueuer.codegen.generatedCode.keys); 52 Elements.sortedByPosition(compiler.enqueuer.codegen.generatedCode.keys);
54 for (var element in generatedCode) { 53 for (var element in generatedCode) {
55 print(element); 54 print(element);
56 } 55 }
57 print(''); 56 print('');
58 57
59 // This assertion can fail for two reasons: 58 // This assertion can fail for two reasons:
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 library lib; 165 library lib;
167 166
168 import 'dart:mirrors'; 167 import 'dart:mirrors';
169 168
170 useReflect(type) { 169 useReflect(type) {
171 print(new Symbol('Foo')); 170 print(new Symbol('Foo'));
172 print(MirrorSystem.getName(reflectClass(type).owner.qualifiedName)); 171 print(MirrorSystem.getName(reflectClass(type).owner.qualifiedName));
173 } 172 }
174 """, 173 """,
175 }; 174 };
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/message_kind_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698