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 // VM-specific implementation of the dart:mirrors library. | 5 // VM-specific implementation of the dart:mirrors library. |
6 | 6 |
7 import "dart:collection" show UnmodifiableListView, UnmodifiableMapView; | 7 import "dart:collection" show UnmodifiableListView, UnmodifiableMapView; |
8 import "dart:async" show Future; | 8 import "dart:async" show Future; |
9 | 9 |
10 var dirty = false; | 10 var dirty = false; |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 ClassMirror get type { | 385 ClassMirror get type { |
386 if (_type == null) { | 386 if (_type == null) { |
387 // Note it not safe to use reflectee.runtimeType because runtimeType may | 387 // Note it not safe to use reflectee.runtimeType because runtimeType may |
388 // be overridden. | 388 // be overridden. |
389 _type = reflectType(_computeType(reflectee)); | 389 _type = reflectType(_computeType(reflectee)); |
390 } | 390 } |
391 return _type; | 391 return _type; |
392 } | 392 } |
393 | 393 |
394 // LocalInstanceMirrors always reflect local instances | 394 // LocalInstanceMirrors always reflect local instances |
395 bool hasReflectee = true; | 395 bool get hasReflectee => true; |
396 | 396 |
397 get reflectee => _reflectee; | 397 get reflectee => _reflectee; |
398 | 398 |
399 delegate(Invocation invocation) { | 399 delegate(Invocation invocation) { |
400 if (invocation.isMethod) { | 400 if (invocation.isMethod) { |
401 return this.invoke(invocation.memberName, | 401 return this.invoke(invocation.memberName, |
402 invocation.positionalArguments, | 402 invocation.positionalArguments, |
403 invocation.namedArguments).reflectee; | 403 invocation.namedArguments).reflectee; |
404 } | 404 } |
405 if (invocation.isGetter) { | 405 if (invocation.isGetter) { |
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1662 if (typeMirror == null) { | 1662 if (typeMirror == null) { |
1663 typeMirror = makeLocalTypeMirror(key); | 1663 typeMirror = makeLocalTypeMirror(key); |
1664 _instanitationCache[key] = typeMirror; | 1664 _instanitationCache[key] = typeMirror; |
1665 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { | 1665 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { |
1666 _declarationCache[key] = typeMirror; | 1666 _declarationCache[key] = typeMirror; |
1667 } | 1667 } |
1668 } | 1668 } |
1669 return typeMirror; | 1669 return typeMirror; |
1670 } | 1670 } |
1671 } | 1671 } |
OLD | NEW |