OLD | NEW |
---|---|
1 // Copyright (c) 2011, 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 /** A formal parameter to a [Method]. */ | 5 /** A formal parameter to a [Method]. */ |
6 class Parameter { | 6 class Parameter { |
7 FormalNode definition; | 7 FormalNode definition; |
8 Member method; | 8 Member method; |
9 | 9 |
10 String name; | 10 String name; |
11 Type type; | 11 Type type; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 super(name, declaringType); | 91 super(name, declaringType); |
92 | 92 |
93 abstract bool get isStatic(); | 93 abstract bool get isStatic(); |
94 abstract Type get returnType(); | 94 abstract Type get returnType(); |
95 | 95 |
96 abstract bool get canGet(); | 96 abstract bool get canGet(); |
97 abstract bool get canSet(); | 97 abstract bool get canSet(); |
98 | 98 |
99 Library get library() => declaringType.library; | 99 Library get library() => declaringType.library; |
100 | 100 |
101 bool get isPrivate() => name.startsWith('_'); | 101 bool get isPrivate() => name !== null && name.startsWith('_'); |
102 | 102 |
103 bool get isConstructor() => false; | 103 bool get isConstructor() => false; |
104 bool get isField() => false; | 104 bool get isField() => false; |
105 bool get isMethod() => false; | 105 bool get isMethod() => false; |
106 bool get isProperty() => false; | 106 bool get isProperty() => false; |
107 bool get isAbstract() => false; | 107 bool get isAbstract() => false; |
108 | 108 |
109 bool get isFinal() => false; | 109 bool get isFinal() => false; |
110 | 110 |
111 // TODO(jmesserly): these only makes sense on methods, but because of | 111 // TODO(jmesserly): these only makes sense on methods, but because of |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 */ | 220 */ |
221 // TODO(jmesserly): perhaps Type should extend Member, but that can get | 221 // TODO(jmesserly): perhaps Type should extend Member, but that can get |
222 // complicated. | 222 // complicated. |
223 class TypeMember extends Member { | 223 class TypeMember extends Member { |
224 final DefinedType type; | 224 final DefinedType type; |
225 | 225 |
226 TypeMember(DefinedType type) | 226 TypeMember(DefinedType type) |
227 : super(type.name, type.library.topType), | 227 : super(type.name, type.library.topType), |
228 this.type = type; | 228 this.type = type; |
229 | 229 |
230 SourceSpan get span() => type.definition.span; | 230 SourceSpan get span() => type.definition === null ? null : type.definition.spa n; |
Jennifer Messerly
2012/01/12 01:58:33
long line
| |
231 | 231 |
232 bool get isStatic() => true; | 232 bool get isStatic() => true; |
233 | 233 |
234 // If this really becomes first class, this should return typeof(Type) | 234 // If this really becomes first class, this should return typeof(Type) |
235 Type get returnType() => world.varType; | 235 Type get returnType() => world.varType; |
236 | 236 |
237 bool canInvoke(MethodGenerator context, Arguments args) => false; | 237 bool canInvoke(MethodGenerator context, Arguments args) => false; |
238 bool get canGet() => true; | 238 bool get canGet() => true; |
239 bool get canSet() => false; | 239 bool get canSet() => false; |
240 | 240 |
(...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1586 } | 1586 } |
1587 | 1587 |
1588 void forEach(void f(Member member)) { | 1588 void forEach(void f(Member member)) { |
1589 factories.forEach((_, Map constructors) { | 1589 factories.forEach((_, Map constructors) { |
1590 constructors.forEach((_, Member member) { | 1590 constructors.forEach((_, Member member) { |
1591 f(member); | 1591 f(member); |
1592 }); | 1592 }); |
1593 }); | 1593 }); |
1594 } | 1594 } |
1595 } | 1595 } |
OLD | NEW |