| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // TODO(sigmund): rename and move to common/elements.dart | 5 // TODO(sigmund): rename and move to common/elements.dart |
| 6 library dart2js.type_system; | 6 library dart2js.type_system; |
| 7 | 7 |
| 8 import 'common.dart'; | 8 import 'common.dart'; |
| 9 import 'elements/types.dart'; | 9 import 'elements/types.dart'; |
| 10 import 'elements/entities.dart'; | 10 import 'elements/entities.dart'; |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 204 |
| 205 /// Returns `true` if [element] is a superclass of `List`. | 205 /// Returns `true` if [element] is a superclass of `List`. |
| 206 bool isListSupertype(ClassEntity element); | 206 bool isListSupertype(ClassEntity element); |
| 207 } | 207 } |
| 208 | 208 |
| 209 /// Interface for accessing libraries, classes and members. | 209 /// Interface for accessing libraries, classes and members. |
| 210 /// | 210 /// |
| 211 /// The environment makes private and injected members directly available and | 211 /// The environment makes private and injected members directly available and |
| 212 /// should therefore not be used to determine scopes. | 212 /// should therefore not be used to determine scopes. |
| 213 abstract class ElementEnvironment { | 213 abstract class ElementEnvironment { |
| 214 /// Returns the main library for the compilation. |
| 215 LibraryEntity get mainLibrary; |
| 216 |
| 217 /// Returns the main method for the compilation. |
| 218 FunctionEntity get mainFunction; |
| 219 |
| 220 /// Lookup the library with the canonical [uri], fail if the library is |
| 221 /// missing and [required]; |
| 214 LibraryEntity lookupLibrary(Uri uri, {bool required: false}); | 222 LibraryEntity lookupLibrary(Uri uri, {bool required: false}); |
| 215 | 223 |
| 216 /// Lookup the class [name] in [library], fail if the class is missing and | 224 /// Lookup the class [name] in [library], fail if the class is missing and |
| 217 /// [required]. | 225 /// [required]. |
| 218 ClassEntity lookupClass(LibraryEntity library, String name, | 226 ClassEntity lookupClass(LibraryEntity library, String name, |
| 219 {bool required: false}); | 227 {bool required: false}); |
| 220 | 228 |
| 221 /// Lookup the member [name] in [library], fail if the class is missing and | 229 /// Lookup the member [name] in [library], fail if the class is missing and |
| 222 /// [required]. | 230 /// [required]. |
| 223 MemberEntity lookupLibraryMember(LibraryEntity library, String name, | 231 MemberEntity lookupLibraryMember(LibraryEntity library, String name, |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 } | 500 } |
| 493 | 501 |
| 494 @override | 502 @override |
| 495 InterfaceType streamType([DartType elementType]) { | 503 InterfaceType streamType([DartType elementType]) { |
| 496 if (elementType == null) { | 504 if (elementType == null) { |
| 497 return getRawType(streamClass); | 505 return getRawType(streamClass); |
| 498 } | 506 } |
| 499 return createInterfaceType(streamClass, [elementType]); | 507 return createInterfaceType(streamClass, [elementType]); |
| 500 } | 508 } |
| 501 } | 509 } |
| OLD | NEW |