Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(529)

Side by Side Diff: reflectable/lib/src/mirrors_unimpl.dart

Issue 1181993003: Add support for getters, setters and constructors in declarations of classMirrors. (Closed) Base URL: https://github.com/dart-lang/reflectable.git@master
Patch Set: Reintroduce abstract members in declarations Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart Team. All rights reserved. Use of this 1 // Copyright (c) 2015, the Dart Team. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in 2 // source code is governed by a BSD-style license that can be found in
3 // the LICENSE file. 3 // the LICENSE file.
4 4
5 import '../mirrors.dart'; 5 import '../mirrors.dart';
6 import 'encoding_constants.dart' as constants; 6 import 'encoding_constants.dart' as constants;
7 export 'dart:collection' show UnmodifiableMapView; 7 export 'dart:collection' show UnmodifiableMapView;
8 export '../capability.dart'; 8 export '../capability.dart';
9 export '../static_reflectable.dart'; 9 export '../static_reflectable.dart';
10 10
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 @override 175 @override
176 String get constructorName => name; 176 String get constructorName => name;
177 177
178 @override 178 @override
179 bool get isAbstract => 0 != descriptor & constants.abstractAttribute; 179 bool get isAbstract => 0 != descriptor & constants.abstractAttribute;
180 180
181 @override 181 @override
182 bool get isConstConstructor => 0 != descriptor & constants.constAttribute; 182 bool get isConstConstructor => 0 != descriptor & constants.constAttribute;
183 183
184 @override 184 @override
185 bool get isConstructor => isGenerativeConstructor || 185 bool get isConstructor => isFactoryConstructor || isGenerativeConstructor;
186 isFactoryConstructor ||
187 isRedirectingConstructor;
188 186
189 @override 187 @override
190 bool get isFactoryConstructor => kind == constants.factoryConstructor; 188 bool get isFactoryConstructor => kind == constants.factoryConstructor;
191 189
192 @override 190 @override
193 bool get isGenerativeConstructor => kind == constants.generativeConstructor; 191 bool get isGenerativeConstructor => kind == constants.generativeConstructor;
194 192
195 @override 193 @override
196 bool get isGetter => kind == constants.getter; 194 bool get isGetter => kind == constants.getter;
197 195
198 @override 196 @override
199 bool get isOperator => isRegularMethod && 197 bool get isOperator => isRegularMethod &&
200 ["+", "-", "*", "/", "[", "<", ">", "=", "~", "%"].contains(name[0]); 198 ["+", "-", "*", "/", "[", "<", ">", "=", "~", "%"].contains(name[0]);
201 199
202 @override 200 @override
203 bool get isPrivate => 0 != descriptor & constants.privateAttribute; 201 bool get isPrivate => 0 != descriptor & constants.privateAttribute;
204 202
205 @override 203 @override
206 bool get isRedirectingConstructor => kind == constants.redirectingConstructor; 204 bool get isRedirectingConstructor =>
205 0 != descriptor & constants.redirectingConstructor;
207 206
208 @override 207 @override
209 bool get isRegularMethod => kind == constants.method; 208 bool get isRegularMethod => kind == constants.method;
210 209
211 @override 210 @override
212 bool get isSetter => kind == constants.setter; 211 bool get isSetter => kind == constants.setter;
213 212
214 @override 213 @override
215 bool get isStatic => 0 != descriptor & constants.staticAttribute; 214 bool get isStatic => 0 != descriptor & constants.staticAttribute;
216 215
(...skipping 17 matching lines...) Expand all
234 233
235 @override 234 @override
236 String get qualifiedName => "${owner.qualifiedName}.$name"; 235 String get qualifiedName => "${owner.qualifiedName}.$name";
237 236
238 // TODO(sigurdm, eernst): implement returnType 237 // TODO(sigurdm, eernst): implement returnType
239 @override 238 @override
240 TypeMirror get returnType => throw new UnimplementedError(); 239 TypeMirror get returnType => throw new UnimplementedError();
241 240
242 @override 241 @override
243 String get simpleName => isConstructor 242 String get simpleName => isConstructor
244 ? (name == '' ? "$owner.simpleName" : "${owner.simpleName}.$name") 243 ? (name == '' ? "${owner.simpleName}" : "${owner.simpleName}.$name")
245 : name; 244 : name;
246 245
247 @override 246 @override
248 String get source => null; 247 String get source => null;
249 } 248 }
250 249
251 abstract class VariableMirrorUnimpl extends DeclarationMirrorUnimpl 250 abstract class VariableMirrorUnimpl extends DeclarationMirrorUnimpl
252 implements VariableMirror { 251 implements VariableMirror {
253 TypeMirror get type => _unsupported(); 252 TypeMirror get type => _unsupported();
254 bool get isStatic => _unsupported(); 253 bool get isStatic => _unsupported();
(...skipping 10 matching lines...) Expand all
265 bool get isNamed => _unsupported(); 264 bool get isNamed => _unsupported();
266 bool get hasDefaultValue => _unsupported(); 265 bool get hasDefaultValue => _unsupported();
267 Object get defaultValue => _unsupported(); 266 Object get defaultValue => _unsupported();
268 } 267 }
269 268
270 abstract class SourceLocationUnimpl { 269 abstract class SourceLocationUnimpl {
271 int get line => _unsupported(); 270 int get line => _unsupported();
272 int get column => _unsupported(); 271 int get column => _unsupported();
273 Uri get sourceUri => _unsupported(); 272 Uri get sourceUri => _unsupported();
274 } 273 }
OLDNEW
« no previous file with comments | « reflectable/lib/src/encoding_constants.dart ('k') | reflectable/lib/src/transformer_implementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698