Chromium Code Reviews| 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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 631 } | 631 } |
| 632 | 632 |
| 633 Element get checkDeferredIsLoaded { | 633 Element get checkDeferredIsLoaded { |
| 634 return _findHelper('checkDeferredIsLoaded'); | 634 return _findHelper('checkDeferredIsLoaded'); |
| 635 } | 635 } |
| 636 | 636 |
| 637 Element get throwNoSuchMethod { | 637 Element get throwNoSuchMethod { |
| 638 return _findHelper('throwNoSuchMethod'); | 638 return _findHelper('throwNoSuchMethod'); |
| 639 } | 639 } |
| 640 | 640 |
| 641 Element get genericNoSuchMethod => | 641 Element get malformedTypeError => _cachedCoreHelper('_malformedTypeError'); |
| 642 _genericNoSuchMethod ??= findCoreHelper('_genericNoSuchMethod'); | 642 Element get genericNoSuchMethod => _cachedCoreHelper('_genericNoSuchMethod'); |
| 643 MethodElement _genericNoSuchMethod; | 643 Element get unresolvedConstructorError => |
| 644 _cachedCoreHelper('_unresolvedConstructorError'); | |
| 645 Element get unresolvedStaticGetterError => | |
| 646 _cachedCoreHelper('_unresolvedStaticGetterError'); | |
| 647 Element get unresolvedStaticSetterError => | |
| 648 _cachedCoreHelper('_unresolvedStaticSetterError'); | |
| 649 Element get unresolvedStaticMethodError => | |
| 650 _cachedCoreHelper('_unresolvedStaticMethodError'); | |
| 651 Element get unresolvedTopLevelGetterError => | |
| 652 _cachedCoreHelper('_unresolvedTopLevelGetterError'); | |
| 653 Element get unresolvedTopLevelSetterError => | |
| 654 _cachedCoreHelper('_unresolvedTopLevelSetterError'); | |
| 655 Element get unresolvedTopLevelMethodError => | |
| 656 _cachedCoreHelper('_unresolvedTopLevelMethodError'); | |
| 644 | 657 |
| 645 Element get unresolvedConstructorError => _unresolvedConstructorError ??= | 658 Map<String, Element> _cachedCoreHelpers = <String, Element>{}; |
| 646 findCoreHelper('_unresolvedConstructorError'); | 659 Element _cachedCoreHelper(String name) => |
| 647 MethodElement _unresolvedConstructorError; | 660 _cachedCoreHelpers[name] ??= findCoreHelper(name); |
|
Siggi Cherem (dart-lang)
2017/01/11 19:08:03
Im ok with either, but any reason to prefer this o
sra1
2017/01/11 19:14:39
putIfAbsent requires a closure argument (hence all
| |
| 648 | |
| 649 Element get malformedTypeError => | |
| 650 _malformedTypeError ??= findCoreHelper('_malformedTypeError'); | |
| 651 MethodElement _malformedTypeError; | |
| 652 | 661 |
| 653 Element get createRuntimeType { | 662 Element get createRuntimeType { |
| 654 return _findHelper('createRuntimeType'); | 663 return _findHelper('createRuntimeType'); |
| 655 } | 664 } |
| 656 | 665 |
| 657 Element get fallThroughError { | 666 Element get fallThroughError { |
| 658 return _findHelper("getFallThroughError"); | 667 return _findHelper("getFallThroughError"); |
| 659 } | 668 } |
| 660 | 669 |
| 661 Element get createInvocationMirror { | 670 Element get createInvocationMirror { |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 866 } | 875 } |
| 867 | 876 |
| 868 MethodElement get toStringForNativeObject { | 877 MethodElement get toStringForNativeObject { |
| 869 return _findHelper('toStringForNativeObject'); | 878 return _findHelper('toStringForNativeObject'); |
| 870 } | 879 } |
| 871 | 880 |
| 872 MethodElement get hashCodeForNativeObject { | 881 MethodElement get hashCodeForNativeObject { |
| 873 return _findHelper('hashCodeForNativeObject'); | 882 return _findHelper('hashCodeForNativeObject'); |
| 874 } | 883 } |
| 875 } | 884 } |
| OLD | NEW |