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

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

Issue 2936233003: Remove Compiler.mainApp and Compiler.mainFunction (Closed)
Patch Set: 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/patch_test.dart ('k') | tests/compiler/dart2js/related_types_test.dart » ('j') | 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) 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 library related_types; 5 library related_types;
6 6
7 import 'package:compiler/src/commandline_options.dart'; 7 import 'package:compiler/src/commandline_options.dart';
8 import 'package:compiler/src/compiler.dart'; 8 import 'package:compiler/src/compiler.dart';
9 import 'package:compiler/src/common_elements.dart'; 9 import 'package:compiler/src/common_elements.dart';
10 import 'package:compiler/src/elements/resolution_types.dart'; 10 import 'package:compiler/src/elements/resolution_types.dart';
(...skipping 18 matching lines...) Expand all
29 if (result.isSuccess) { 29 if (result.isSuccess) {
30 checkRelatedTypes(result.compiler); 30 checkRelatedTypes(result.compiler);
31 } 31 }
32 } else { 32 } else {
33 print('Usage dart related_types.dart <entry-point>'); 33 print('Usage dart related_types.dart <entry-point>');
34 } 34 }
35 } 35 }
36 36
37 /// Check all loaded libraries in [compiler] for unrelated types. 37 /// Check all loaded libraries in [compiler] for unrelated types.
38 void checkRelatedTypes(Compiler compiler) { 38 void checkRelatedTypes(Compiler compiler) {
39 compiler.closeResolution(); 39 compiler.closeResolution(
40 compiler.frontendStrategy.elementEnvironment.mainFunction);
40 for (LibraryElement library in compiler.libraryLoader.libraries) { 41 for (LibraryElement library in compiler.libraryLoader.libraries) {
41 checkLibraryElement(compiler, library); 42 checkLibraryElement(compiler, library);
42 } 43 }
43 } 44 }
44 45
45 /// Check [library] for unrelated types. 46 /// Check [library] for unrelated types.
46 void checkLibraryElement(Compiler compiler, LibraryElement library) { 47 void checkLibraryElement(Compiler compiler, LibraryElement library) {
47 library.forEachLocalMember((Element element) { 48 library.forEachLocalMember((Element element) {
48 if (element.isClass) { 49 if (element.isClass) {
49 ClassElement cls = element; 50 ClassElement cls = element;
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 ClassElement findClass(ResolutionDartType type) => type.accept(this, null); 431 ClassElement findClass(ResolutionDartType type) => type.accept(this, null);
431 432
432 @override 433 @override
433 ClassElement visitType(ResolutionDartType type, _) => null; 434 ClassElement visitType(ResolutionDartType type, _) => null;
434 435
435 @override 436 @override
436 ClassElement visitInterfaceType(ResolutionInterfaceType type, _) { 437 ClassElement visitInterfaceType(ResolutionInterfaceType type, _) {
437 return type.element; 438 return type.element;
438 } 439 }
439 } 440 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/patch_test.dart ('k') | tests/compiler/dart2js/related_types_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698