| 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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 if (_function == null) { | 472 if (_function == null) { |
| 473 _function = _computeFunction(reflectee); | 473 _function = _computeFunction(reflectee); |
| 474 } | 474 } |
| 475 return _function; | 475 return _function; |
| 476 } | 476 } |
| 477 | 477 |
| 478 // TODO(12602): Remove this special case. | 478 // TODO(12602): Remove this special case. |
| 479 delegate(Invocation invocation) { | 479 delegate(Invocation invocation) { |
| 480 if (invocation.isMethod && (invocation.memberName == #call)) { | 480 if (invocation.isMethod && (invocation.memberName == #call)) { |
| 481 return this.apply(invocation.positionalArguments, | 481 return this.apply(invocation.positionalArguments, |
| 482 invocation.namedArguments); | 482 invocation.namedArguments).reflectee; |
| 483 } | 483 } |
| 484 return super.delegate(invocation); | 484 return super.delegate(invocation); |
| 485 } | 485 } |
| 486 | 486 |
| 487 InstanceMirror apply(List<Object> positionalArguments, | 487 InstanceMirror apply(List<Object> positionalArguments, |
| 488 [Map<Symbol, Object> namedArguments]) { | 488 [Map<Symbol, Object> namedArguments]) { |
| 489 // TODO(12602): When closures get an ordinary call method, this can be | 489 // TODO(12602): When closures get an ordinary call method, this can be |
| 490 // replaced with | 490 // replaced with |
| 491 // return this.invoke(#call, positionalArguments, namedArguments); | 491 // return this.invoke(#call, positionalArguments, namedArguments); |
| 492 // and the native ClosureMirror_apply can be removed. | 492 // and the native ClosureMirror_apply can be removed. |
| (...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1645 if (typeMirror == null) { | 1645 if (typeMirror == null) { |
| 1646 typeMirror = makeLocalTypeMirror(key); | 1646 typeMirror = makeLocalTypeMirror(key); |
| 1647 _instanitationCache[key] = typeMirror; | 1647 _instanitationCache[key] = typeMirror; |
| 1648 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { | 1648 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { |
| 1649 _declarationCache[key] = typeMirror; | 1649 _declarationCache[key] = typeMirror; |
| 1650 } | 1650 } |
| 1651 } | 1651 } |
| 1652 return typeMirror; | 1652 return typeMirror; |
| 1653 } | 1653 } |
| 1654 } | 1654 } |
| OLD | NEW |