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

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

Issue 2935663002: Remove Compiler.commonElements (Closed)
Patch Set: Remove Compiler._commonElements 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
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 ]; // The (getter) name of Foo.field. 82 ]; // The (getter) name of Foo.field.
83 // TODO(ahe): Check for the following names, currently they are not being 83 // TODO(ahe): Check for the following names, currently they are not being
84 // recorded correctly, but are being emitted. 84 // recorded correctly, but are being emitted.
85 [ 85 [
86 'Foo_staticMethod', // The name of Foo.staticMethod. 86 'Foo_staticMethod', // The name of Foo.staticMethod.
87 r'instanceMethod$0' 87 r'instanceMethod$0'
88 ]; // The name of Foo.instanceMethod. 88 ]; // The name of Foo.instanceMethod.
89 89
90 // We always include the names of some native classes. 90 // We always include the names of some native classes.
91 List<ClassElement> nativeClasses = [ 91 List<ClassElement> nativeClasses = [
92 compiler.commonElements.intClass, 92 compiler.resolution.commonElements.intClass,
93 compiler.commonElements.doubleClass, 93 compiler.resolution.commonElements.doubleClass,
94 compiler.commonElements.numClass, 94 compiler.resolution.commonElements.numClass,
95 compiler.commonElements.stringClass, 95 compiler.resolution.commonElements.stringClass,
96 compiler.commonElements.boolClass, 96 compiler.resolution.commonElements.boolClass,
97 compiler.commonElements.nullClass, 97 compiler.resolution.commonElements.nullClass,
98 compiler.commonElements.listClass 98 compiler.resolution.commonElements.listClass
99 ]; 99 ];
100 Iterable<String> nativeNames = nativeClasses.map(backend.namer.className); 100 Iterable<String> nativeNames = nativeClasses.map(backend.namer.className);
101 expectedNames = expectedNames.map(backend.namer.asName).toList(); 101 expectedNames = expectedNames.map(backend.namer.asName).toList();
102 expectedNames.addAll(nativeNames); 102 expectedNames.addAll(nativeNames);
103 103
104 // Mirrors only work in the full emitter. We can thus be certain that the 104 // Mirrors only work in the full emitter. We can thus be certain that the
105 // emitter is the full emitter. 105 // emitter is the full emitter.
106 full.Emitter fullEmitter = backend.emitter.emitter; 106 full.Emitter fullEmitter = backend.emitter.emitter;
107 Set recordedNames = new Set() 107 Set recordedNames = new Set()
108 ..addAll(fullEmitter.recordedMangledNames) 108 ..addAll(fullEmitter.recordedMangledNames)
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 library lib; 205 library lib;
206 206
207 import 'dart:mirrors'; 207 import 'dart:mirrors';
208 208
209 useReflect(type) { 209 useReflect(type) {
210 print(new Symbol('Foo')); 210 print(new Symbol('Foo'));
211 print(MirrorSystem.getName(reflectClass(type).owner.qualifiedName)); 211 print(MirrorSystem.getName(reflectClass(type).owner.qualifiedName));
212 } 212 }
213 """, 213 """,
214 }; 214 };
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/minimal_resolution_test.dart ('k') | tests/compiler/dart2js/mock_compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698