| OLD | NEW |
| 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 dart2js.js_backend.helpers; | 5 library dart2js.js_backend.helpers; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/names.dart' show Identifiers, Uris; | 8 import '../common/names.dart' show Identifiers, Uris; |
| 9 import '../common_elements.dart' show CommonElements, ElementEnvironment; | 9 import '../common_elements.dart' show CommonElements, ElementEnvironment; |
| 10 import '../elements/elements.dart' show PublicName; | 10 import '../elements/elements.dart' show PublicName; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 FunctionEntity findCoreHelper(String name) => _env | 87 FunctionEntity findCoreHelper(String name) => _env |
| 88 .lookupLibraryMember(commonElements.coreLibrary, name, required: true); | 88 .lookupLibraryMember(commonElements.coreLibrary, name, required: true); |
| 89 | 89 |
| 90 ConstructorEntity _findConstructor(ClassEntity cls, String name) => | 90 ConstructorEntity _findConstructor(ClassEntity cls, String name) => |
| 91 _env.lookupConstructor(cls, name, required: true); | 91 _env.lookupConstructor(cls, name, required: true); |
| 92 | 92 |
| 93 void onLibrariesLoaded(LoadedLibraries loadedLibraries) { | 93 void onLibrariesLoaded(LoadedLibraries loadedLibraries) { |
| 94 assert(loadedLibraries.containsLibrary(Uris.dart_core)); | 94 assert(loadedLibraries.containsLibrary(Uris.dart_core)); |
| 95 assert(loadedLibraries.containsLibrary(DART_INTERCEPTORS)); | 95 assert(loadedLibraries.containsLibrary(DART_INTERCEPTORS)); |
| 96 assert(loadedLibraries.containsLibrary(DART_JS_HELPER)); | 96 assert(loadedLibraries.containsLibrary(DART_JS_HELPER)); |
| 97 } |
| 97 | 98 |
| 99 void onResolutionStart() { |
| 98 // TODO(johnniwinther): Avoid these. Currently needed to ensure resolution | 100 // TODO(johnniwinther): Avoid these. Currently needed to ensure resolution |
| 99 // of the classes for various queries in native behavior computation, | 101 // of the classes for various queries in native behavior computation, |
| 100 // inference and codegen. | 102 // inference and codegen. |
| 101 _env.getThisType(jsArrayClass); | 103 _env.getThisType(jsArrayClass); |
| 102 _env.getThisType(jsExtendableArrayClass); | 104 _env.getThisType(jsExtendableArrayClass); |
| 103 } | 105 } |
| 104 | 106 |
| 105 LibraryEntity _jsHelperLibrary; | 107 LibraryEntity _jsHelperLibrary; |
| 106 LibraryEntity get jsHelperLibrary => | 108 LibraryEntity get jsHelperLibrary => |
| 107 _jsHelperLibrary ??= _env.lookupLibrary(DART_JS_HELPER); | 109 _jsHelperLibrary ??= _env.lookupLibrary(DART_JS_HELPER); |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 /// The class for patch annotations defined in dart:_js_helper. | 807 /// The class for patch annotations defined in dart:_js_helper. |
| 806 ClassEntity get patchAnnotationClass => | 808 ClassEntity get patchAnnotationClass => |
| 807 _patchAnnotationClass ??= _findHelperClass('_Patch'); | 809 _patchAnnotationClass ??= _findHelperClass('_Patch'); |
| 808 | 810 |
| 809 ClassEntity _nativeAnnotationClass; | 811 ClassEntity _nativeAnnotationClass; |
| 810 | 812 |
| 811 /// The class for native annotations defined in dart:_js_helper. | 813 /// The class for native annotations defined in dart:_js_helper. |
| 812 ClassEntity get nativeAnnotationClass => | 814 ClassEntity get nativeAnnotationClass => |
| 813 _nativeAnnotationClass ??= _findHelperClass('Native'); | 815 _nativeAnnotationClass ??= _findHelperClass('Native'); |
| 814 } | 816 } |
| OLD | NEW |