| 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; |
| 11 import '../core_types.dart' show CoreClasses; | 11 import '../core_types.dart' show CommonElements; |
| 12 import '../elements/elements.dart' | 12 import '../elements/elements.dart' |
| 13 show | 13 show |
| 14 AbstractFieldElement, | 14 AbstractFieldElement, |
| 15 ClassElement, | 15 ClassElement, |
| 16 ConstructorElement, | 16 ConstructorElement, |
| 17 Element, | 17 Element, |
| 18 EnumClassElement, | 18 EnumClassElement, |
| 19 FieldElement, | |
| 20 FunctionElement, | 19 FunctionElement, |
| 21 LibraryElement, | 20 LibraryElement, |
| 22 MemberElement, | 21 MemberElement, |
| 23 MethodElement, | 22 MethodElement, |
| 24 Name, | 23 Name, |
| 25 PublicName; | 24 PublicName; |
| 26 import '../library_loader.dart' show LoadedLibraries; | 25 import '../library_loader.dart' show LoadedLibraries; |
| 27 import '../universe/call_structure.dart' show CallStructure; | 26 import '../universe/call_structure.dart' show CallStructure; |
| 28 import '../universe/selector.dart' show Selector; | 27 import '../universe/selector.dart' show Selector; |
| 29 import 'js_backend.dart'; | 28 import 'js_backend.dart'; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 55 final Compiler compiler; | 54 final Compiler compiler; |
| 56 | 55 |
| 57 Element cachedCheckConcurrentModificationError; | 56 Element cachedCheckConcurrentModificationError; |
| 58 | 57 |
| 59 BackendHelpers(this.compiler); | 58 BackendHelpers(this.compiler); |
| 60 | 59 |
| 61 JavaScriptBackend get backend => compiler.backend; | 60 JavaScriptBackend get backend => compiler.backend; |
| 62 | 61 |
| 63 Resolution get resolution => backend.resolution; | 62 Resolution get resolution => backend.resolution; |
| 64 | 63 |
| 65 CoreClasses get coreClasses => compiler.coreClasses; | 64 CommonElements get commonElements => compiler.commonElements; |
| 66 | 65 |
| 67 DiagnosticReporter get reporter => compiler.reporter; | 66 DiagnosticReporter get reporter => compiler.reporter; |
| 68 | 67 |
| 69 MethodElement assertTest; | 68 MethodElement assertTest; |
| 70 MethodElement assertThrow; | 69 MethodElement assertThrow; |
| 71 MethodElement assertHelper; | 70 MethodElement assertHelper; |
| 72 | 71 |
| 73 LibraryElement jsHelperLibrary; | 72 LibraryElement jsHelperLibrary; |
| 74 LibraryElement asyncLibrary; | 73 LibraryElement asyncLibrary; |
| 75 LibraryElement interceptorsLibrary; | 74 LibraryElement interceptorsLibrary; |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 jsArrayClass.ensureResolved(resolution); | 385 jsArrayClass.ensureResolved(resolution); |
| 387 jsArrayTypedConstructor = compiler.lookupElementIn(jsArrayClass, 'typed'); | 386 jsArrayTypedConstructor = compiler.lookupElementIn(jsArrayClass, 'typed'); |
| 388 jsArrayRemoveLast = compiler.lookupElementIn(jsArrayClass, 'removeLast'); | 387 jsArrayRemoveLast = compiler.lookupElementIn(jsArrayClass, 'removeLast'); |
| 389 jsArrayAdd = compiler.lookupElementIn(jsArrayClass, 'add'); | 388 jsArrayAdd = compiler.lookupElementIn(jsArrayClass, 'add'); |
| 390 | 389 |
| 391 jsStringClass.ensureResolved(resolution); | 390 jsStringClass.ensureResolved(resolution); |
| 392 jsStringSplit = compiler.lookupElementIn(jsStringClass, 'split'); | 391 jsStringSplit = compiler.lookupElementIn(jsStringClass, 'split'); |
| 393 jsStringOperatorAdd = compiler.lookupElementIn(jsStringClass, '+'); | 392 jsStringOperatorAdd = compiler.lookupElementIn(jsStringClass, '+'); |
| 394 jsStringToString = compiler.lookupElementIn(jsStringClass, 'toString'); | 393 jsStringToString = compiler.lookupElementIn(jsStringClass, 'toString'); |
| 395 | 394 |
| 396 objectEquals = compiler.lookupElementIn(coreClasses.objectClass, '=='); | 395 objectEquals = compiler.lookupElementIn(commonElements.objectClass, '=='); |
| 397 } | 396 } |
| 398 | 397 |
| 399 ConstructorElement _mapLiteralConstructor; | 398 ConstructorElement _mapLiteralConstructor; |
| 400 ConstructorElement _mapLiteralConstructorEmpty; | 399 ConstructorElement _mapLiteralConstructorEmpty; |
| 401 Element _mapLiteralUntypedMaker; | 400 Element _mapLiteralUntypedMaker; |
| 402 Element _mapLiteralUntypedEmptyMaker; | 401 Element _mapLiteralUntypedEmptyMaker; |
| 403 | 402 |
| 404 ConstructorElement get mapLiteralConstructor { | 403 ConstructorElement get mapLiteralConstructor { |
| 405 _ensureMapLiteralHelpers(); | 404 _ensureMapLiteralHelpers(); |
| 406 return _mapLiteralConstructor; | 405 return _mapLiteralConstructor; |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 } | 803 } |
| 805 | 804 |
| 806 ClassElement get stackTraceClass { | 805 ClassElement get stackTraceClass { |
| 807 return findHelper('_StackTrace'); | 806 return findHelper('_StackTrace'); |
| 808 } | 807 } |
| 809 | 808 |
| 810 MethodElement _objectNoSuchMethod; | 809 MethodElement _objectNoSuchMethod; |
| 811 | 810 |
| 812 MethodElement get objectNoSuchMethod { | 811 MethodElement get objectNoSuchMethod { |
| 813 if (_objectNoSuchMethod == null) { | 812 if (_objectNoSuchMethod == null) { |
| 814 _objectNoSuchMethod = | 813 _objectNoSuchMethod = commonElements.objectClass |
| 815 coreClasses.objectClass.lookupLocalMember(Identifiers.noSuchMethod_); | 814 .lookupLocalMember(Identifiers.noSuchMethod_); |
| 816 } | 815 } |
| 817 return _objectNoSuchMethod; | 816 return _objectNoSuchMethod; |
| 818 } | 817 } |
| 819 } | 818 } |
| OLD | NEW |