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

Side by Side Diff: tests/compiler/dart2js/minimal_resolution_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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 elements are not needlessly required by dart2js. 5 // Test that elements are not needlessly required by dart2js.
6 6
7 import 'package:async_helper/async_helper.dart'; 7 import 'package:async_helper/async_helper.dart';
8 import 'package:compiler/src/common/names.dart'; 8 import 'package:compiler/src/common/names.dart';
9 import 'package:compiler/src/compiler.dart'; 9 import 'package:compiler/src/compiler.dart';
10 import 'package:compiler/src/elements/elements.dart'; 10 import 'package:compiler/src/elements/elements.dart';
(...skipping 27 matching lines...) Expand all
38 {bool proxyConstantComputed: false, bool deprecatedClass: false}) async { 38 {bool proxyConstantComputed: false, bool deprecatedClass: false}) async {
39 CompilationResult result = await runCompiler( 39 CompilationResult result = await runCompiler(
40 memorySourceFiles: {'main.dart': code}, options: ['--analyze-only']); 40 memorySourceFiles: {'main.dart': code}, options: ['--analyze-only']);
41 Expect.isTrue(result.isSuccess); 41 Expect.isTrue(result.isSuccess);
42 Compiler compiler = result.compiler; 42 Compiler compiler = result.compiler;
43 Expect.equals( 43 Expect.equals(
44 proxyConstantComputed, 44 proxyConstantComputed,
45 compiler.resolution.wasProxyConstantComputedTestingOnly, 45 compiler.resolution.wasProxyConstantComputedTestingOnly,
46 "Unexpected computation of proxy constant."); 46 "Unexpected computation of proxy constant.");
47 47
48 LibraryElement coreLibrary = compiler.commonElements.coreLibrary; 48 LibraryElement coreLibrary =
49 compiler.frontendStrategy.commonElements.coreLibrary;
49 checkInstantiated( 50 checkInstantiated(
50 compiler, coreLibrary.find('_Proxy'), proxyConstantComputed); 51 compiler, coreLibrary.find('_Proxy'), proxyConstantComputed);
51 checkInstantiated(compiler, coreLibrary.find('Deprecated'), deprecatedClass); 52 checkInstantiated(compiler, coreLibrary.find('Deprecated'), deprecatedClass);
52 53
53 LibraryElement jsHelperLibrary = 54 LibraryElement jsHelperLibrary =
54 compiler.libraryLoader.lookupLibrary(Uris.dart__js_helper); 55 compiler.libraryLoader.lookupLibrary(Uris.dart__js_helper);
55 jsHelperLibrary.forEachLocalMember((Element element) { 56 jsHelperLibrary.forEachLocalMember((Element element) {
56 Uri uri = element.compilationUnit.script.resourceUri; 57 Uri uri = element.compilationUnit.script.resourceUri;
57 if (element.isClass && uri.path.endsWith('annotations.dart')) { 58 if (element.isClass && uri.path.endsWith('annotations.dart')) {
58 checkInstantiated(compiler, element, false); 59 checkInstantiated(compiler, element, false);
59 } 60 }
60 }); 61 });
61 } 62 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/kernel/closed_world_test.dart ('k') | tests/compiler/dart2js/mirrors_used_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698