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 // TODO(kasperl): This actually holds getters and setters just fine | 5 // TODO(kasperl): This actually holds getters and setters just fine |
6 // too and stricly they aren't functions. Maybe this needs a better | 6 // too and stricly they aren't functions. Maybe this needs a better |
7 // name -- something like ElementSet seems a bit too generic. | 7 // name -- something like ElementSet seems a bit too generic. |
8 class FunctionSet extends PartialTypeTree { | 8 class FunctionSet extends PartialTypeTree { |
9 | 9 |
10 FunctionSet(Compiler compiler) : super(compiler); | 10 FunctionSet(Compiler compiler) : super(compiler); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 return true; | 116 return true; |
117 }); | 117 }); |
118 return result; | 118 return result; |
119 } | 119 } |
120 | 120 |
121 void forEach(Function f) { | 121 void forEach(Function f) { |
122 if (root === null) return; | 122 if (root === null) return; |
123 root.visitRecursively((FunctionSetNode node) { | 123 root.visitRecursively((FunctionSetNode node) { |
124 node.membersByName.forEach( | 124 node.membersByName.forEach( |
125 (SourceString _, Element element) => f(element)); | 125 (SourceString _, Element element) => f(element)); |
126 return true; | 126 return true; |
127 }); | 127 }); |
128 } | 128 } |
129 } | 129 } |
130 | 130 |
131 class FunctionSetNode extends PartialTypeTreeNode { | 131 class FunctionSetNode extends PartialTypeTreeNode { |
132 | 132 |
133 final Map<SourceString, Element> membersByName; | 133 final Map<SourceString, Element> membersByName; |
134 | 134 |
135 FunctionSetNode(ClassElement type) : super(type), | 135 FunctionSetNode(ClassElement type) : super(type), |
136 membersByName = new Map<SourceString, Element>(); | 136 membersByName = new Map<SourceString, Element>(); |
137 | 137 |
138 } | 138 } |
OLD | NEW |