OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 js_backend.backend; | 5 library js_backend.backend; |
6 | 6 |
7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
8 | 8 |
9 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; | 9 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; |
10 | 10 |
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 } | 974 } |
975 | 975 |
976 bool operatorEqHandlesNullArgument(FunctionElement operatorEqfunction) { | 976 bool operatorEqHandlesNullArgument(FunctionElement operatorEqfunction) { |
977 return specialOperatorEqClasses.contains(operatorEqfunction.enclosingClass); | 977 return specialOperatorEqClasses.contains(operatorEqfunction.enclosingClass); |
978 } | 978 } |
979 | 979 |
980 void validateInterceptorImplementsAllObjectMethods( | 980 void validateInterceptorImplementsAllObjectMethods( |
981 ClassElement interceptorClass) { | 981 ClassElement interceptorClass) { |
982 if (interceptorClass == null) return; | 982 if (interceptorClass == null) return; |
983 interceptorClass.ensureResolved(resolution); | 983 interceptorClass.ensureResolved(resolution); |
984 commonElements.objectClass.forEachMember((_, Element member) { | 984 ClassElement objectClass = commonElements.objectClass; |
| 985 objectClass.forEachMember((_, Element member) { |
985 if (member.isGenerativeConstructor) return; | 986 if (member.isGenerativeConstructor) return; |
986 Element interceptorMember = interceptorClass.lookupMember(member.name); | 987 Element interceptorMember = interceptorClass.lookupMember(member.name); |
987 // Interceptors must override all Object methods due to calling convention | 988 // Interceptors must override all Object methods due to calling convention |
988 // differences. | 989 // differences. |
989 assert(invariant(interceptorMember, | 990 assert(invariant(interceptorMember, |
990 interceptorMember.enclosingClass == interceptorClass, | 991 interceptorMember.enclosingClass == interceptorClass, |
991 message: | 992 message: |
992 "Member ${member.name} not overridden in ${interceptorClass}. " | 993 "Member ${member.name} not overridden in ${interceptorClass}. " |
993 "Found $interceptorMember from " | 994 "Found $interceptorMember from " |
994 "${interceptorMember.enclosingClass}.")); | 995 "${interceptorMember.enclosingClass}.")); |
(...skipping 2305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3300 @override | 3301 @override |
3301 bool isNativeClass(ClassElement element) { | 3302 bool isNativeClass(ClassElement element) { |
3302 return helpers.backend.isNative(element); | 3303 return helpers.backend.isNative(element); |
3303 } | 3304 } |
3304 | 3305 |
3305 @override | 3306 @override |
3306 bool isNativeMember(MemberElement element) { | 3307 bool isNativeMember(MemberElement element) { |
3307 return helpers.backend.isNative(element); | 3308 return helpers.backend.isNative(element); |
3308 } | 3309 } |
3309 } | 3310 } |
OLD | NEW |