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

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

Issue 588183002: Emit warning on import of dart:mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments 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 /// 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']);
49 asyncTest(() => compiler.runCompiler(Uri.parse('memory:main.dart')).then((_) { 50 asyncTest(() => compiler.runCompiler(Uri.parse('memory:main.dart')).then((_) {
50 print(''); 51 print('');
51 List generatedCode = 52 List generatedCode =
52 Elements.sortedByPosition(compiler.enqueuer.codegen.generatedCode.keys); 53 Elements.sortedByPosition(compiler.enqueuer.codegen.generatedCode.keys);
53 for (var element in generatedCode) { 54 for (var element in generatedCode) {
54 print(element); 55 print(element);
55 } 56 }
56 print(''); 57 print('');
57 58
58 // This assertion can fail for two reasons: 59 // This assertion can fail for two reasons:
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 library lib; 166 library lib;
166 167
167 import 'dart:mirrors'; 168 import 'dart:mirrors';
168 169
169 useReflect(type) { 170 useReflect(type) {
170 print(new Symbol('Foo')); 171 print(new Symbol('Foo'));
171 print(MirrorSystem.getName(reflectClass(type).owner.qualifiedName)); 172 print(MirrorSystem.getName(reflectClass(type).owner.qualifiedName));
172 } 173 }
173 """, 174 """,
174 }; 175 };
OLDNEW
« pkg/compiler/lib/src/apiimpl.dart ('K') | « 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