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

Side by Side Diff: runtime/lib/mirrors_impl.dart

Issue 181063025: Match existing expectation that delegate returns unwrapped values. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/lib/mirrors/delegate_function_invocation_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | tests/lib/mirrors/delegate_function_invocation_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698