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 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import '../common/names.dart' show | 9 import '../common/names.dart' show |
10 Identifiers, | 10 Identifiers, |
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 throw new SpannableAssertionFailure( | 759 throw new SpannableAssertionFailure( |
760 element, "Can't get selector from $element"); | 760 element, "Can't get selector from $element"); |
761 } | 761 } |
762 } | 762 } |
763 | 763 |
764 factory Selector.getter(Name name) | 764 factory Selector.getter(Name name) |
765 => new Selector(SelectorKind.GETTER, | 765 => new Selector(SelectorKind.GETTER, |
766 name.getter, | 766 name.getter, |
767 CallStructure.NO_ARGS); | 767 CallStructure.NO_ARGS); |
768 | 768 |
769 factory Selector.getterFrom(Selector selector) | |
770 => new Selector(SelectorKind.GETTER, | |
771 selector.memberName.getter, | |
772 CallStructure.NO_ARGS); | |
773 | |
774 factory Selector.setter(Name name) | 769 factory Selector.setter(Name name) |
775 => new Selector(SelectorKind.SETTER, | 770 => new Selector(SelectorKind.SETTER, |
776 name.setter, | 771 name.setter, |
777 CallStructure.ONE_ARG); | 772 CallStructure.ONE_ARG); |
778 | 773 |
779 factory Selector.unaryOperator(String name) => new Selector( | 774 factory Selector.unaryOperator(String name) => new Selector( |
780 SelectorKind.OPERATOR, | 775 SelectorKind.OPERATOR, |
781 new PublicName(Elements.constructOperatorName(name, true)), | 776 new PublicName(Elements.constructOperatorName(name, true)), |
782 CallStructure.NO_ARGS); | 777 CallStructure.NO_ARGS); |
783 | 778 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 // Add bits from the call structure. | 906 // Add bits from the call structure. |
912 return Hashing.mixHashCodeBits(hash, callStructure.hashCode); | 907 return Hashing.mixHashCodeBits(hash, callStructure.hashCode); |
913 } | 908 } |
914 | 909 |
915 String toString() { | 910 String toString() { |
916 return 'Selector($kind, $name, ${callStructure.structureToString()})'; | 911 return 'Selector($kind, $name, ${callStructure.structureToString()})'; |
917 } | 912 } |
918 | 913 |
919 Selector toCallSelector() => new Selector.callClosureFrom(this); | 914 Selector toCallSelector() => new Selector.callClosureFrom(this); |
920 } | 915 } |
OLD | NEW |