| 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 universe; | 5 library universe; |
| 6 | 6 |
| 7 import '../closure.dart'; | 7 import '../closure.dart'; |
| 8 import '../elements/elements.dart'; | 8 import '../elements/elements.dart'; |
| 9 import '../dart2jslib.dart'; | 9 import '../dart2jslib.dart'; |
| 10 import '../runtime_types.dart'; | 10 import '../runtime_types.dart'; |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 | 216 |
| 217 int get hashCode => argumentCount + 1000 * namedArguments.length; | 217 int get hashCode => argumentCount + 1000 * namedArguments.length; |
| 218 int get namedArgumentCount => namedArguments.length; | 218 int get namedArgumentCount => namedArguments.length; |
| 219 int get positionalArgumentCount => argumentCount - namedArgumentCount; | 219 int get positionalArgumentCount => argumentCount - namedArgumentCount; |
| 220 DartType get receiverType => null; | 220 DartType get receiverType => null; |
| 221 | 221 |
| 222 bool applies(Element element, Compiler compiler) | 222 bool applies(Element element, Compiler compiler) |
| 223 => appliesUntyped(element, compiler); | 223 => appliesUntyped(element, compiler); |
| 224 | 224 |
| 225 bool appliesUntyped(Element element, Compiler compiler) { | 225 bool appliesUntyped(Element element, Compiler compiler) { |
| 226 if (Elements.isUnresolved(element)) return false; |
| 227 if (element.isForeign()) return true; |
| 228 |
| 226 if (element.isSetter()) return isSetter(); | 229 if (element.isSetter()) return isSetter(); |
| 227 if (element.isGetter()) return isGetter() || isCall(); | 230 if (element.isGetter()) return isGetter() || isCall(); |
| 228 if (element.isField()) return isGetter() || isSetter() || isCall(); | 231 if (element.isField()) return isGetter() || isSetter() || isCall(); |
| 229 if (isGetter()) return true; | 232 if (isGetter()) return true; |
| 230 | 233 |
| 231 FunctionElement function = element; | 234 FunctionElement function = element; |
| 232 FunctionSignature parameters = function.computeSignature(compiler); | 235 FunctionSignature parameters = function.computeSignature(compiler); |
| 233 if (argumentCount > parameters.parameterCount) return false; | 236 if (argumentCount > parameters.parameterCount) return false; |
| 234 int requiredParameterCount = parameters.requiredParameterCount; | 237 int requiredParameterCount = parameters.requiredParameterCount; |
| 235 int optionalParameterCount = parameters.optionalParameterCount; | 238 int optionalParameterCount = parameters.optionalParameterCount; |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 | 532 |
| 530 if (!self.isInterface() && self.isSubclassOf(other)) { | 533 if (!self.isInterface() && self.isSubclassOf(other)) { |
| 531 // Resolve an invocation of [element.name] on [self]. If it | 534 // Resolve an invocation of [element.name] on [self]. If it |
| 532 // is found, this selector is a candidate. | 535 // is found, this selector is a candidate. |
| 533 return hasElementIn(self, element) && appliesUntyped(element, compiler); | 536 return hasElementIn(self, element) && appliesUntyped(element, compiler); |
| 534 } | 537 } |
| 535 | 538 |
| 536 return false; | 539 return false; |
| 537 } | 540 } |
| 538 } | 541 } |
| OLD | NEW |