| 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/resolution.dart' show Resolution; | 9 import '../common/resolution.dart' show Resolution; |
| 10 import '../compiler.dart' show Compiler; | 10 import '../compiler.dart' show Compiler; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 } | 196 } |
| 197 return false; | 197 return false; |
| 198 } | 198 } |
| 199 | 199 |
| 200 ConstructorElement get symbolValidatedConstructor { | 200 ConstructorElement get symbolValidatedConstructor { |
| 201 return _symbolValidatedConstructor ??= _findConstructor( | 201 return _symbolValidatedConstructor ??= _findConstructor( |
| 202 symbolImplementationClass, symbolValidatedConstructorSelector.name); | 202 symbolImplementationClass, symbolValidatedConstructorSelector.name); |
| 203 } | 203 } |
| 204 | 204 |
| 205 // TODO(johnniwinther): Make these private. | 205 // TODO(johnniwinther): Make these private. |
| 206 // TODO(johnniwinther): Split into _findHelperFunction and _findHelperClass an
d | 206 // TODO(johnniwinther): Split into _findHelperFunction and _findHelperClass |
| 207 // add a check that the element has the expected kind. | 207 // and add a check that the element has the expected kind. |
| 208 Element _findHelper(String name) => _find(jsHelperLibrary, name); | 208 Element _findHelper(String name) => _find(jsHelperLibrary, name); |
| 209 FunctionElement _findHelperFunction(String name) => | 209 FunctionElement _findHelperFunction(String name) => |
| 210 _find(jsHelperLibrary, name); | 210 _find(jsHelperLibrary, name); |
| 211 Element _findAsyncHelper(String name) => _find(asyncLibrary, name); | 211 Element _findAsyncHelper(String name) => _find(asyncLibrary, name); |
| 212 Element _findInterceptor(String name) => _find(interceptorsLibrary, name); | 212 Element _findInterceptor(String name) => _find(interceptorsLibrary, name); |
| 213 Element _find(LibraryElement library, String name) { | 213 Element _find(LibraryElement library, String name) { |
| 214 Element element = library.implementation.findLocal(name); | 214 Element element = library.implementation.findLocal(name); |
| 215 assert(invariant(library, element != null, | 215 assert(invariant(library, element != null, |
| 216 message: "Element '$name' not found in '${library.canonicalUri}'.")); | 216 message: "Element '$name' not found in '${library.canonicalUri}'.")); |
| 217 return element; | 217 return element; |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 } | 866 } |
| 867 | 867 |
| 868 MethodElement get toStringForNativeObject { | 868 MethodElement get toStringForNativeObject { |
| 869 return _findHelper('toStringForNativeObject'); | 869 return _findHelper('toStringForNativeObject'); |
| 870 } | 870 } |
| 871 | 871 |
| 872 MethodElement get hashCodeForNativeObject { | 872 MethodElement get hashCodeForNativeObject { |
| 873 return _findHelper('hashCodeForNativeObject'); | 873 return _findHelper('hashCodeForNativeObject'); |
| 874 } | 874 } |
| 875 } | 875 } |
| OLD | NEW |