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 '../tree/tree.dart'; | 10 import '../tree/tree.dart'; |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 bool isIndex() => identical(kind, SelectorKind.INDEX) && argumentCount == 1; | 219 bool isIndex() => identical(kind, SelectorKind.INDEX) && argumentCount == 1; |
220 bool isIndexSet() => identical(kind, SelectorKind.INDEX) && argumentCount == 2
; | 220 bool isIndexSet() => identical(kind, SelectorKind.INDEX) && argumentCount == 2
; |
221 | 221 |
222 bool isOperator() => identical(kind, SelectorKind.OPERATOR); | 222 bool isOperator() => identical(kind, SelectorKind.OPERATOR); |
223 bool isUnaryOperator() => isOperator() && argumentCount == 0; | 223 bool isUnaryOperator() => isOperator() && argumentCount == 0; |
224 bool isBinaryOperator() => isOperator() && argumentCount == 1; | 224 bool isBinaryOperator() => isOperator() && argumentCount == 1; |
225 | 225 |
226 /** Check whether this is a call to 'assert'. */ | 226 /** Check whether this is a call to 'assert'. */ |
227 bool isAssert() => isCall() && identical(name.stringValue, "assert"); | 227 bool isAssert() => isCall() && identical(name.stringValue, "assert"); |
228 | 228 |
229 /** Check whether this is a closure invocation call. */ | |
230 bool isClosureCall() => | |
231 isCall() && identical(name.stringValue, Compiler.CALL_OPERATOR_NAME); | |
232 | |
233 int get hashCode => argumentCount + 1000 * namedArguments.length; | 229 int get hashCode => argumentCount + 1000 * namedArguments.length; |
234 int get namedArgumentCount => namedArguments.length; | 230 int get namedArgumentCount => namedArguments.length; |
235 int get positionalArgumentCount => argumentCount - namedArgumentCount; | 231 int get positionalArgumentCount => argumentCount - namedArgumentCount; |
236 DartType get receiverType => null; | 232 DartType get receiverType => null; |
237 | 233 |
238 /** | 234 /** |
239 * The member name for invocation mirrors created from this selector. | 235 * The member name for invocation mirrors created from this selector. |
240 */ | 236 */ |
241 String get invocationMirrorMemberName => | 237 String get invocationMirrorMemberName => |
242 isSetter() ? '${name.slowToString()}=' : name.slowToString(); | 238 isSetter() ? '${name.slowToString()}=' : name.slowToString(); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 ClassElement cls = self; | 475 ClassElement cls = self; |
480 if (cls.isSubclassOf(other)) { | 476 if (cls.isSubclassOf(other)) { |
481 // Resolve an invocation of [element.name] on [self]. If it | 477 // Resolve an invocation of [element.name] on [self]. If it |
482 // is found, this selector is a candidate. | 478 // is found, this selector is a candidate. |
483 return hasElementIn(self, element) && appliesUntyped(element, compiler); | 479 return hasElementIn(self, element) && appliesUntyped(element, compiler); |
484 } | 480 } |
485 | 481 |
486 return false; | 482 return false; |
487 } | 483 } |
488 } | 484 } |
OLD | NEW |