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

Side by Side Diff: pkg/compiler/lib/src/compiler.dart

Issue 2659883002: Use entities in BackendClasses (Closed)
Patch Set: Updated cf. comments. Created 3 years, 10 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 dart2js.compiler_base; 5 library dart2js.compiler_base;
6 6
7 import 'dart:async' show EventSink, Future; 7 import 'dart:async' show EventSink, Future;
8 8
9 import '../compiler_new.dart' as api; 9 import '../compiler_new.dart' as api;
10 import 'cache_strategy.dart' show CacheStrategy; 10 import 'cache_strategy.dart' show CacheStrategy;
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1181 1181
1182 @override 1182 @override
1183 MemberElement findClassMember(ClassElement cls, String name, 1183 MemberElement findClassMember(ClassElement cls, String name,
1184 {bool required: true}) { 1184 {bool required: true}) {
1185 cls.ensureResolved(resolution); 1185 cls.ensureResolved(resolution);
1186 MemberElement member = cls.lookupLocalMember(name); 1186 MemberElement member = cls.lookupLocalMember(name);
1187 if (member == null && required) { 1187 if (member == null && required) {
1188 reporter.internalError( 1188 reporter.internalError(
1189 cls, 1189 cls,
1190 "The class '${cls}' in '${cls.library.canonicalUri}' does not " 1190 "The class '${cls}' in '${cls.library.canonicalUri}' does not "
1191 "contain required member: '$name'."); 1191 "contain required member: '$name'.");
1192 } 1192 }
1193 return member; 1193 return member;
1194 } 1194 }
1195 1195
1196 @override 1196 @override
1197 ConstructorElement findConstructor(ClassElement cls, String name, 1197 ConstructorElement findConstructor(ClassElement cls, String name,
1198 {bool required: true}) { 1198 {bool required: true}) {
1199 cls.ensureResolved(resolution); 1199 cls.ensureResolved(resolution);
1200 ConstructorElement constructor = cls.lookupConstructor(name); 1200 ConstructorElement constructor = cls.lookupConstructor(name);
1201 if (constructor == null && required) { 1201 if (constructor == null && required) {
1202 reporter.internalError( 1202 reporter.internalError(
1203 cls, 1203 cls,
1204 "The class '${cls}' in '${cls.library.canonicalUri}' does not " 1204 "The class '${cls}' in '${cls.library.canonicalUri}' does not "
1205 "contain required constructor: '$name'."); 1205 "contain required constructor: '$name'.");
1206 } 1206 }
1207 return constructor; 1207 return constructor;
1208 } 1208 }
1209 1209
1210 @override 1210 @override
1211 ClassElement findClass(LibraryElement library, String name, 1211 ClassElement findClass(LibraryElement library, String name,
1212 {bool required: true}) { 1212 {bool required: true}) {
1213 return _findLibraryMember(library, name, required: required); 1213 return _findLibraryMember(library, name, required: required);
1214 } 1214 }
1215 1215
1216 Element _findRequired(LibraryElement library, String name) => _findLibraryMemb er(library, name); 1216 Element _findRequired(LibraryElement library, String name) =>
1217 _findLibraryMember(library, name);
1217 1218
1218 Element _findLibraryMember(LibraryElement library, String name, 1219 Element _findLibraryMember(LibraryElement library, String name,
1219 {bool required: true}) { 1220 {bool required: true}) {
1220 // If the script of the library is synthesized, the library does not exist 1221 // If the script of the library is synthesized, the library does not exist
1221 // and we do not try to load the helpers. 1222 // and we do not try to load the helpers.
1222 // 1223 //
1223 // This could for example happen if dart:async is disabled, then loading it 1224 // This could for example happen if dart:async is disabled, then loading it
1224 // should not try to find the given element. 1225 // should not try to find the given element.
1225 if (library == null || library.isSynthesized) return null; 1226 if (library == null || library.isSynthesized) return null;
1226 1227
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
1985 _ElementScanner(this.scanner); 1986 _ElementScanner(this.scanner);
1986 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); 1987 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library);
1987 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); 1988 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit);
1988 } 1989 }
1989 1990
1990 class _EmptyEnvironment implements Environment { 1991 class _EmptyEnvironment implements Environment {
1991 const _EmptyEnvironment(); 1992 const _EmptyEnvironment();
1992 1993
1993 String valueOf(String key) => null; 1994 String valueOf(String key) => null;
1994 } 1995 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/common/backend_api.dart ('k') | pkg/compiler/lib/src/constant_system_dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698