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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 : this(SelectorKind.CALL, const SourceString(""), library, 0, const []); | 208 : this(SelectorKind.CALL, const SourceString(""), library, 0, const []); |
209 | 209 |
210 // TODO(kasperl): This belongs somewhere else. | 210 // TODO(kasperl): This belongs somewhere else. |
211 Selector.noSuchMethod() | 211 Selector.noSuchMethod() |
212 : this(SelectorKind.CALL, Compiler.NO_SUCH_METHOD, null, | 212 : this(SelectorKind.CALL, Compiler.NO_SUCH_METHOD, null, |
213 Compiler.NO_SUCH_METHOD_ARG_COUNT); | 213 Compiler.NO_SUCH_METHOD_ARG_COUNT); |
214 | 214 |
215 bool isGetter() => identical(kind, SelectorKind.GETTER); | 215 bool isGetter() => identical(kind, SelectorKind.GETTER); |
216 bool isSetter() => identical(kind, SelectorKind.SETTER); | 216 bool isSetter() => identical(kind, SelectorKind.SETTER); |
217 bool isCall() => identical(kind, SelectorKind.CALL); | 217 bool isCall() => identical(kind, SelectorKind.CALL); |
| 218 bool isClosureCall() { |
| 219 SourceString callName = Compiler.CALL_OPERATOR_NAME; |
| 220 return isCall() && name == callName; |
| 221 } |
218 | 222 |
219 bool isIndex() => identical(kind, SelectorKind.INDEX) && argumentCount == 1; | 223 bool isIndex() => identical(kind, SelectorKind.INDEX) && argumentCount == 1; |
220 bool isIndexSet() => identical(kind, SelectorKind.INDEX) && argumentCount == 2
; | 224 bool isIndexSet() => identical(kind, SelectorKind.INDEX) && argumentCount == 2
; |
221 | 225 |
222 bool isOperator() => identical(kind, SelectorKind.OPERATOR); | 226 bool isOperator() => identical(kind, SelectorKind.OPERATOR); |
223 bool isUnaryOperator() => isOperator() && argumentCount == 0; | 227 bool isUnaryOperator() => isOperator() && argumentCount == 0; |
224 bool isBinaryOperator() => isOperator() && argumentCount == 1; | 228 bool isBinaryOperator() => isOperator() && argumentCount == 1; |
225 | 229 |
226 /** Check whether this is a call to 'assert'. */ | 230 /** Check whether this is a call to 'assert'. */ |
227 bool isAssert() => isCall() && identical(name.stringValue, "assert"); | 231 bool isAssert() => isCall() && identical(name.stringValue, "assert"); |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 ClassElement cls = self; | 479 ClassElement cls = self; |
476 if (cls.isSubclassOf(other)) { | 480 if (cls.isSubclassOf(other)) { |
477 // Resolve an invocation of [element.name] on [self]. If it | 481 // Resolve an invocation of [element.name] on [self]. If it |
478 // is found, this selector is a candidate. | 482 // is found, this selector is a candidate. |
479 return hasElementIn(self, element) && appliesUntyped(element, compiler); | 483 return hasElementIn(self, element) && appliesUntyped(element, compiler); |
480 } | 484 } |
481 | 485 |
482 return false; | 486 return false; |
483 } | 487 } |
484 } | 488 } |
OLD | NEW |