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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 _findHelperFunction('convertRtiToRuntimeType'); | 738 _findHelperFunction('convertRtiToRuntimeType'); |
739 | 739 |
740 ClassEntity get stackTraceClass => _findHelperClass('_StackTrace'); | 740 ClassEntity get stackTraceClass => _findHelperClass('_StackTrace'); |
741 | 741 |
742 FunctionEntity _objectNoSuchMethod; | 742 FunctionEntity _objectNoSuchMethod; |
743 FunctionEntity get objectNoSuchMethod { | 743 FunctionEntity get objectNoSuchMethod { |
744 return _objectNoSuchMethod ??= _env.lookupClassMember( | 744 return _objectNoSuchMethod ??= _env.lookupClassMember( |
745 commonElements.objectClass, Identifiers.noSuchMethod_); | 745 commonElements.objectClass, Identifiers.noSuchMethod_); |
746 } | 746 } |
747 | 747 |
| 748 bool isDefaultNoSuchMethodImplementation(FunctionEntity element) { |
| 749 ClassEntity classElement = element.enclosingClass; |
| 750 return classElement == commonElements.objectClass || |
| 751 classElement == jsInterceptorClass || |
| 752 classElement == jsNullClass; |
| 753 } |
| 754 |
748 ClassEntity get constantMapClass => | 755 ClassEntity get constantMapClass => |
749 _findHelperClass(JavaScriptMapConstant.DART_CLASS); | 756 _findHelperClass(JavaScriptMapConstant.DART_CLASS); |
750 ClassEntity get constantStringMapClass => | 757 ClassEntity get constantStringMapClass => |
751 _findHelperClass(JavaScriptMapConstant.DART_STRING_CLASS); | 758 _findHelperClass(JavaScriptMapConstant.DART_STRING_CLASS); |
752 ClassEntity get constantProtoMapClass => | 759 ClassEntity get constantProtoMapClass => |
753 _findHelperClass(JavaScriptMapConstant.DART_PROTO_CLASS); | 760 _findHelperClass(JavaScriptMapConstant.DART_PROTO_CLASS); |
754 ClassEntity get generalConstantMapClass => | 761 ClassEntity get generalConstantMapClass => |
755 _findHelperClass(JavaScriptMapConstant.DART_GENERAL_CLASS); | 762 _findHelperClass(JavaScriptMapConstant.DART_GENERAL_CLASS); |
756 | 763 |
757 ClassEntity get annotationCreatesClass => _findHelperClass('Creates'); | 764 ClassEntity get annotationCreatesClass => _findHelperClass('Creates'); |
(...skipping 13 matching lines...) Expand all Loading... |
771 /// The class for patch annotations defined in dart:_js_helper. | 778 /// The class for patch annotations defined in dart:_js_helper. |
772 ClassEntity get patchAnnotationClass => | 779 ClassEntity get patchAnnotationClass => |
773 _patchAnnotationClass ??= _findHelperClass('_Patch'); | 780 _patchAnnotationClass ??= _findHelperClass('_Patch'); |
774 | 781 |
775 ClassEntity _nativeAnnotationClass; | 782 ClassEntity _nativeAnnotationClass; |
776 | 783 |
777 /// The class for native annotations defined in dart:_js_helper. | 784 /// The class for native annotations defined in dart:_js_helper. |
778 ClassEntity get nativeAnnotationClass => | 785 ClassEntity get nativeAnnotationClass => |
779 _nativeAnnotationClass ??= _findHelperClass('Native'); | 786 _nativeAnnotationClass ??= _findHelperClass('Native'); |
780 } | 787 } |
OLD | NEW |