| 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 '../compiler.dart' show Compiler; | 9 import '../compiler.dart' show Compiler; |
| 10 import '../core_types.dart' show CommonElements, ElementEnvironment; | 10 import '../core_types.dart' show CommonElements, ElementEnvironment; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 static const String INVOKE_ON = '_getCachedInvocation'; | 35 static const String INVOKE_ON = '_getCachedInvocation'; |
| 36 static const String START_ROOT_ISOLATE = 'startRootIsolate'; | 36 static const String START_ROOT_ISOLATE = 'startRootIsolate'; |
| 37 | 37 |
| 38 static const String JS = 'JS'; | 38 static const String JS = 'JS'; |
| 39 static const String JS_BUILTIN = 'JS_BUILTIN'; | 39 static const String JS_BUILTIN = 'JS_BUILTIN'; |
| 40 static const String JS_EMBEDDED_GLOBAL = 'JS_EMBEDDED_GLOBAL'; | 40 static const String JS_EMBEDDED_GLOBAL = 'JS_EMBEDDED_GLOBAL'; |
| 41 static const String JS_INTERCEPTOR_CONSTANT = 'JS_INTERCEPTOR_CONSTANT'; | 41 static const String JS_INTERCEPTOR_CONSTANT = 'JS_INTERCEPTOR_CONSTANT'; |
| 42 | 42 |
| 43 final ElementEnvironment _env; | 43 final ElementEnvironment _env; |
| 44 | 44 |
| 45 // TODO(johnniwinther): Remove this. | |
| 46 final JavaScriptBackend _backend; | |
| 47 | |
| 48 final CommonElements commonElements; | 45 final CommonElements commonElements; |
| 49 | 46 |
| 50 BackendHelpers(this._env, this._backend, this.commonElements); | 47 BackendHelpers(this._env, this.commonElements); |
| 51 | 48 |
| 52 ClassEntity _findInterceptorsClass(String name) => | 49 ClassEntity _findInterceptorsClass(String name) => |
| 53 _findClass(interceptorsLibrary, name); | 50 _findClass(interceptorsLibrary, name); |
| 54 | 51 |
| 55 FunctionEntity _findInterceptorsFunction(String name) => | 52 FunctionEntity _findInterceptorsFunction(String name) => |
| 56 _findLibraryMember(interceptorsLibrary, name); | 53 _findLibraryMember(interceptorsLibrary, name); |
| 57 | 54 |
| 58 ClassEntity _findHelperClass(String name) => | 55 ClassEntity _findHelperClass(String name) => |
| 59 _findClass(jsHelperLibrary, name); | 56 _findClass(jsHelperLibrary, name); |
| 60 | 57 |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 | 784 |
| 788 ClassEntity get annotationReturnsClass => _findHelperClass('Returns'); | 785 ClassEntity get annotationReturnsClass => _findHelperClass('Returns'); |
| 789 | 786 |
| 790 ClassEntity get annotationJSNameClass => _findHelperClass('JSName'); | 787 ClassEntity get annotationJSNameClass => _findHelperClass('JSName'); |
| 791 | 788 |
| 792 FunctionEntity get toStringForNativeObject => | 789 FunctionEntity get toStringForNativeObject => |
| 793 _findHelperFunction('toStringForNativeObject'); | 790 _findHelperFunction('toStringForNativeObject'); |
| 794 | 791 |
| 795 FunctionEntity get hashCodeForNativeObject => | 792 FunctionEntity get hashCodeForNativeObject => |
| 796 _findHelperFunction('hashCodeForNativeObject'); | 793 _findHelperFunction('hashCodeForNativeObject'); |
| 794 |
| 795 ClassEntity _patchAnnotationClass; |
| 796 |
| 797 /// The class for patch annotations defined in dart:_js_helper. |
| 798 ClassEntity get patchAnnotationClass => |
| 799 _patchAnnotationClass ??= _findHelperClass('_Patch'); |
| 800 |
| 801 ClassEntity _nativeAnnotationClass; |
| 802 |
| 803 /// The class for native annotations defined in dart:_js_helper. |
| 804 ClassEntity get nativeAnnotationClass => |
| 805 _nativeAnnotationClass ??= _findHelperClass('Native'); |
| 797 } | 806 } |
| OLD | NEW |