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

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

Issue 2908153003: It's alive! (Closed)
Patch Set: Updated cf. comments Created 3 years, 6 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 | « tests/compiler/dart2js/find_my_name_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";
11 11
12 import 'memory_compiler.dart' show runCompiler; 12 import 'memory_compiler.dart' show runCompiler;
13 13
14 import 'package:compiler/src/apiimpl.dart' show CompilerImpl; 14 import 'package:compiler/src/apiimpl.dart' show CompilerImpl;
15 15
16 import 'package:compiler/src/constants/values.dart' 16 import 'package:compiler/src/constants/values.dart'
17 show ConstantValue, TypeConstantValue; 17 show ConstantValue, TypeConstantValue;
18 18
19 import 'package:compiler/src/elements/elements.dart' show Element, Elements; 19 import 'package:compiler/src/elements/elements.dart'
20 show ClassElement, Elements;
20 21
21 import 'package:compiler/src/js_backend/js_backend.dart' show JavaScriptBackend; 22 import 'package:compiler/src/js_backend/js_backend.dart' show JavaScriptBackend;
22 import 'package:compiler/src/js_backend/mirrors_analysis.dart'; 23 import 'package:compiler/src/js_backend/mirrors_analysis.dart';
23 24
24 import 'package:compiler/src/js_emitter/full_emitter/emitter.dart' as full 25 import 'package:compiler/src/js_emitter/full_emitter/emitter.dart' as full
25 show Emitter; 26 show Emitter;
26 27
27 import 'package:compiler/src/old_to_new_api.dart' 28 import 'package:compiler/src/old_to_new_api.dart'
28 show LegacyCompilerDiagnostics; 29 show LegacyCompilerDiagnostics;
29 30
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 r'get$field' 79 r'get$field'
79 ]; // The (getter) name of Foo.field. 80 ]; // The (getter) name of Foo.field.
80 // TODO(ahe): Check for the following names, currently they are not being 81 // TODO(ahe): Check for the following names, currently they are not being
81 // recorded correctly, but are being emitted. 82 // recorded correctly, but are being emitted.
82 [ 83 [
83 'Foo_staticMethod', // The name of Foo.staticMethod. 84 'Foo_staticMethod', // The name of Foo.staticMethod.
84 r'instanceMethod$0' 85 r'instanceMethod$0'
85 ]; // The name of Foo.instanceMethod. 86 ]; // The name of Foo.instanceMethod.
86 87
87 // We always include the names of some native classes. 88 // We always include the names of some native classes.
88 List<Element> nativeClasses = [ 89 List<ClassElement> nativeClasses = [
89 compiler.commonElements.intClass, 90 compiler.commonElements.intClass,
90 compiler.commonElements.doubleClass, 91 compiler.commonElements.doubleClass,
91 compiler.commonElements.numClass, 92 compiler.commonElements.numClass,
92 compiler.commonElements.stringClass, 93 compiler.commonElements.stringClass,
93 compiler.commonElements.boolClass, 94 compiler.commonElements.boolClass,
94 compiler.commonElements.nullClass, 95 compiler.commonElements.nullClass,
95 compiler.commonElements.listClass 96 compiler.commonElements.listClass
96 ]; 97 ];
97 Iterable<String> nativeNames = nativeClasses.map(backend.namer.className); 98 Iterable<String> nativeNames = nativeClasses.map(backend.namer.className);
98 expectedNames = expectedNames.map(backend.namer.asName).toList(); 99 expectedNames = expectedNames.map(backend.namer.asName).toList();
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 library lib; 201 library lib;
201 202
202 import 'dart:mirrors'; 203 import 'dart:mirrors';
203 204
204 useReflect(type) { 205 useReflect(type) {
205 print(new Symbol('Foo')); 206 print(new Symbol('Foo'));
206 print(MirrorSystem.getName(reflectClass(type).owner.qualifiedName)); 207 print(MirrorSystem.getName(reflectClass(type).owner.qualifiedName));
207 } 208 }
208 """, 209 """,
209 }; 210 };
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/find_my_name_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698