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 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1329 if (_constructorName == null) { | 1329 if (_constructorName == null) { |
1330 if (!isConstructor) { | 1330 if (!isConstructor) { |
1331 _constructorName = _s(''); | 1331 _constructorName = _s(''); |
1332 } else { | 1332 } else { |
1333 var parts = MirrorSystem.getName(simpleName).split('.'); | 1333 var parts = MirrorSystem.getName(simpleName).split('.'); |
1334 if (parts.length > 2) { | 1334 if (parts.length > 2) { |
1335 throw new MirrorException( | 1335 throw new MirrorException( |
1336 'Internal error in MethodMirror.constructorName: ' | 1336 'Internal error in MethodMirror.constructorName: ' |
1337 'malformed name <$simpleName>'); | 1337 'malformed name <$simpleName>'); |
1338 } else if (parts.length == 2) { | 1338 } else if (parts.length == 2) { |
1339 _constructorName = _s(parts[1]); | 1339 LibraryMirror definingLibrary = owner.owner; |
| 1340 _constructorName = MirrorSystem.getSymbol(parts[1], definingLibrary); |
1340 } else { | 1341 } else { |
1341 _constructorName = _s(''); | 1342 _constructorName = _s(''); |
1342 } | 1343 } |
1343 } | 1344 } |
1344 } | 1345 } |
1345 return _constructorName; | 1346 return _constructorName; |
1346 } | 1347 } |
1347 | 1348 |
1348 String _source = null; | 1349 String _source = null; |
1349 String get source { | 1350 String get source { |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1575 if (typeMirror == null) { | 1576 if (typeMirror == null) { |
1576 typeMirror = makeLocalTypeMirror(key); | 1577 typeMirror = makeLocalTypeMirror(key); |
1577 _instanitationCache[key] = typeMirror; | 1578 _instanitationCache[key] = typeMirror; |
1578 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { | 1579 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { |
1579 _declarationCache[key] = typeMirror; | 1580 _declarationCache[key] = typeMirror; |
1580 } | 1581 } |
1581 } | 1582 } |
1582 return typeMirror; | 1583 return typeMirror; |
1583 } | 1584 } |
1584 } | 1585 } |
OLD | NEW |