| 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 '../elements/elements.dart'; | 7 import '../elements/elements.dart'; |
| 8 import '../dart2jslib.dart'; | 8 import '../dart2jslib.dart'; |
| 9 import '../dart_types.dart'; | 9 import '../dart_types.dart'; |
| 10 import '../types/types.dart'; | 10 import '../types/types.dart'; |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 } else { | 319 } else { |
| 320 return new Selector.call( | 320 return new Selector.call( |
| 321 name, element.library, arity, namedArguments); | 321 name, element.library, arity, namedArguments); |
| 322 } | 322 } |
| 323 } else if (element.isSetter) { | 323 } else if (element.isSetter) { |
| 324 return new Selector.setter(name, element.library); | 324 return new Selector.setter(name, element.library); |
| 325 } else if (element.isGetter) { | 325 } else if (element.isGetter) { |
| 326 return new Selector.getter(name, element.library); | 326 return new Selector.getter(name, element.library); |
| 327 } else if (element.isField) { | 327 } else if (element.isField) { |
| 328 return new Selector.getter(name, element.library); | 328 return new Selector.getter(name, element.library); |
| 329 } else if (element.isConstructor) { |
| 330 return new Selector.callConstructor(name, element.library); |
| 329 } else { | 331 } else { |
| 330 throw new SpannableAssertionFailure( | 332 throw new SpannableAssertionFailure( |
| 331 element, "Can't get selector from $element"); | 333 element, "Can't get selector from $element"); |
| 332 } | 334 } |
| 333 } | 335 } |
| 334 | 336 |
| 335 factory Selector.getter(String name, LibraryElement library) | 337 factory Selector.getter(String name, LibraryElement library) |
| 336 => new Selector(SelectorKind.GETTER, name, library, 0); | 338 => new Selector(SelectorKind.GETTER, name, library, 0); |
| 337 | 339 |
| 338 factory Selector.getterFrom(Selector selector) | 340 factory Selector.getterFrom(Selector selector) |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 factory Selector.callClosureFrom(Selector selector) | 376 factory Selector.callClosureFrom(Selector selector) |
| 375 => new Selector(SelectorKind.CALL, CALL_NAME, null, | 377 => new Selector(SelectorKind.CALL, CALL_NAME, null, |
| 376 selector.argumentCount, selector.namedArguments); | 378 selector.argumentCount, selector.namedArguments); |
| 377 | 379 |
| 378 factory Selector.callConstructor(String name, LibraryElement library, | 380 factory Selector.callConstructor(String name, LibraryElement library, |
| 379 [int arity = 0, | 381 [int arity = 0, |
| 380 List<String> namedArguments]) | 382 List<String> namedArguments]) |
| 381 => new Selector(SelectorKind.CALL, name, library, | 383 => new Selector(SelectorKind.CALL, name, library, |
| 382 arity, namedArguments); | 384 arity, namedArguments); |
| 383 | 385 |
| 384 factory Selector.callDefaultConstructor(LibraryElement library) | 386 factory Selector.callDefaultConstructor() |
| 385 => new Selector(SelectorKind.CALL, "", library, 0); | 387 => new Selector(SelectorKind.CALL, "", null, 0); |
| 386 | 388 |
| 387 bool get isGetter => identical(kind, SelectorKind.GETTER); | 389 bool get isGetter => identical(kind, SelectorKind.GETTER); |
| 388 bool get isSetter => identical(kind, SelectorKind.SETTER); | 390 bool get isSetter => identical(kind, SelectorKind.SETTER); |
| 389 bool get isCall => identical(kind, SelectorKind.CALL); | 391 bool get isCall => identical(kind, SelectorKind.CALL); |
| 390 bool get isClosureCall { | 392 bool get isClosureCall { |
| 391 String callName = Compiler.CALL_OPERATOR_NAME; | 393 String callName = Compiler.CALL_OPERATOR_NAME; |
| 392 return isCall && name == callName; | 394 return isCall && name == callName; |
| 393 } | 395 } |
| 394 | 396 |
| 395 bool get isIndex => identical(kind, SelectorKind.INDEX) && argumentCount == 1; | 397 bool get isIndex => identical(kind, SelectorKind.INDEX) && argumentCount == 1; |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 | 842 |
| 841 Selector extendIfReachesAll(Compiler compiler) { | 843 Selector extendIfReachesAll(Compiler compiler) { |
| 842 bool canReachAll = compiler.enabledInvokeOn | 844 bool canReachAll = compiler.enabledInvokeOn |
| 843 && mask.needsNoSuchMethodHandling(this, compiler.world); | 845 && mask.needsNoSuchMethodHandling(this, compiler.world); |
| 844 return canReachAll | 846 return canReachAll |
| 845 ? new TypedSelector( | 847 ? new TypedSelector( |
| 846 compiler.typesTask.dynamicType, this, compiler.world) | 848 compiler.typesTask.dynamicType, this, compiler.world) |
| 847 : this; | 849 : this; |
| 848 } | 850 } |
| 849 } | 851 } |
| OLD | NEW |