| 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"; | 7 import "dart:collection"; |
| 8 | 8 |
| 9 final emptyList = new UnmodifiableListView([]); | 9 final emptyList = new UnmodifiableListView([]); |
| 10 final emptyMap = new _UnmodifiableMapView({}); | 10 final emptyMap = new _UnmodifiableMapView({}); |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 } | 560 } |
| 561 } | 561 } |
| 562 return _mixin; | 562 return _mixin; |
| 563 } | 563 } |
| 564 | 564 |
| 565 var _cachedStaticMembers; | 565 var _cachedStaticMembers; |
| 566 Map<Symbol, MethodMirror> get staticMembers { | 566 Map<Symbol, MethodMirror> get staticMembers { |
| 567 if (_cachedStaticMembers == null) { | 567 if (_cachedStaticMembers == null) { |
| 568 var result = new Map<Symbol, MethodMirror>(); | 568 var result = new Map<Symbol, MethodMirror>(); |
| 569 declarations.values.forEach((decl) { | 569 declarations.values.forEach((decl) { |
| 570 if (decl is MethodMirror && decl.isStatic && | 570 if (decl is MethodMirror && decl.isStatic && !decl.isConstructor) { |
| 571 !decl.isConstructor && !decl.isAbstract) { | |
| 572 result[decl.simpleName] = decl; | 571 result[decl.simpleName] = decl; |
| 573 } | 572 } |
| 574 if (decl is VariableMirror && decl.isStatic) { | 573 if (decl is VariableMirror && decl.isStatic) { |
| 575 var getterName = decl.simpleName; | 574 var getterName = decl.simpleName; |
| 576 result[getterName] = | 575 result[getterName] = |
| 577 new _SyntheticAccessor(this, getterName, true, true, false, decl); | 576 new _SyntheticAccessor(this, getterName, true, true, false, decl); |
| 578 if (!decl.isFinal) { | 577 if (!decl.isFinal) { |
| 579 var setterName = _asSetter(decl.simpleName, this.owner); | 578 var setterName = _asSetter(decl.simpleName, this.owner); |
| 580 result[setterName] = new _SyntheticAccessor( | 579 result[setterName] = new _SyntheticAccessor( |
| 581 this, setterName, false, true, false, decl); | 580 this, setterName, false, true, false, decl); |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 return _declarations = | 1078 return _declarations = |
| 1080 new _UnmodifiableMapView<Symbol, DeclarationMirror>(_members); | 1079 new _UnmodifiableMapView<Symbol, DeclarationMirror>(_members); |
| 1081 } | 1080 } |
| 1082 | 1081 |
| 1083 | 1082 |
| 1084 var _cachedTopLevelMembers; | 1083 var _cachedTopLevelMembers; |
| 1085 Map<Symbol, MethodMirror> get topLevelMembers { | 1084 Map<Symbol, MethodMirror> get topLevelMembers { |
| 1086 if (_cachedTopLevelMembers == null) { | 1085 if (_cachedTopLevelMembers == null) { |
| 1087 var result = new Map<Symbol, MethodMirror>(); | 1086 var result = new Map<Symbol, MethodMirror>(); |
| 1088 declarations.values.forEach((decl) { | 1087 declarations.values.forEach((decl) { |
| 1089 if (decl is MethodMirror && !decl.isAbstract) { | 1088 if (decl is MethodMirror) { |
| 1090 result[decl.simpleName] = decl; | 1089 result[decl.simpleName] = decl; |
| 1091 } | 1090 } |
| 1092 if (decl is VariableMirror) { | 1091 if (decl is VariableMirror) { |
| 1093 var getterName = decl.simpleName; | 1092 var getterName = decl.simpleName; |
| 1094 result[getterName] = | 1093 result[getterName] = |
| 1095 new _SyntheticAccessor(this, getterName, true, true, true, decl); | 1094 new _SyntheticAccessor(this, getterName, true, true, true, decl); |
| 1096 if (!decl.isFinal) { | 1095 if (!decl.isFinal) { |
| 1097 var setterName = _asSetter(decl.simpleName, this); | 1096 var setterName = _asSetter(decl.simpleName, this); |
| 1098 result[setterName] = new _SyntheticAccessor( | 1097 result[setterName] = new _SyntheticAccessor( |
| 1099 this, setterName, false, true, true, decl); | 1098 this, setterName, false, true, true, decl); |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1490 if (typeMirror == null) { | 1489 if (typeMirror == null) { |
| 1491 typeMirror = makeLocalTypeMirror(key); | 1490 typeMirror = makeLocalTypeMirror(key); |
| 1492 _instanitationCache[key] = typeMirror; | 1491 _instanitationCache[key] = typeMirror; |
| 1493 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { | 1492 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { |
| 1494 _declarationCache[key] = typeMirror; | 1493 _declarationCache[key] = typeMirror; |
| 1495 } | 1494 } |
| 1496 } | 1495 } |
| 1497 return typeMirror; | 1496 return typeMirror; |
| 1498 } | 1497 } |
| 1499 } | 1498 } |
| OLD | NEW |