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

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

Issue 23983026: Fill in type arguments when creating an object from the mirrors or embedding API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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
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 // These values are allowed to be passed directly over the wire. 9 // These values are allowed to be passed directly over the wire.
10 bool _isSimpleValue(var value) { 10 bool _isSimpleValue(var value) {
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 int argumentIndex = numPositionalArguments; 676 int argumentIndex = numPositionalArguments;
677 int nameIndex = 0; 677 int nameIndex = 0;
678 if (numNamedArguments > 0) { 678 if (numNamedArguments > 0) {
679 namedArguments.forEach((name, value) { 679 namedArguments.forEach((name, value) {
680 arguments[argumentIndex++] = value; 680 arguments[argumentIndex++] = value;
681 names[nameIndex++] = _n(name); 681 names[nameIndex++] = _n(name);
682 }); 682 });
683 } 683 }
684 684
685 return reflect(_invokeConstructor(_reflectee, 685 return reflect(_invokeConstructor(_reflectee,
686 _reflectedType,
686 _n(constructorName), 687 _n(constructorName),
687 arguments, 688 arguments,
688 names)); 689 names));
689 } 690 }
690 691
691 Future<InstanceMirror> newInstanceAsync(Symbol constructorName, 692 Future<InstanceMirror> newInstanceAsync(Symbol constructorName,
692 List positionalArguments, 693 List positionalArguments,
693 [Map<Symbol, dynamic> namedArguments]) { 694 [Map<Symbol, dynamic> namedArguments]) {
694 return new Future(() { 695 return new Future(() {
695 return this.newInstance(constructorName, 696 return this.newInstance(constructorName,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 733
733 _invoke(reflectee, memberName, arguments, argumentNames) 734 _invoke(reflectee, memberName, arguments, argumentNames)
734 native 'ClassMirror_invoke'; 735 native 'ClassMirror_invoke';
735 736
736 _invokeGetter(reflectee, getterName) 737 _invokeGetter(reflectee, getterName)
737 native 'ClassMirror_invokeGetter'; 738 native 'ClassMirror_invokeGetter';
738 739
739 _invokeSetter(reflectee, setterName, value) 740 _invokeSetter(reflectee, setterName, value)
740 native 'ClassMirror_invokeSetter'; 741 native 'ClassMirror_invokeSetter';
741 742
742 static _invokeConstructor(reflectee, constructorName, arguments, argumentNames ) 743 static _invokeConstructor(reflectee, type, constructorName, arguments, argumen tNames)
743 native 'ClassMirror_invokeConstructor'; 744 native 'ClassMirror_invokeConstructor';
744 745
745 static _ClassMirror_type_variables(reflectee) 746 static _ClassMirror_type_variables(reflectee)
746 native "ClassMirror_type_variables"; 747 native "ClassMirror_type_variables";
747 748
748 static _computeTypeArguments(reflectee) 749 static _computeTypeArguments(reflectee)
749 native "ClassMirror_type_arguments"; 750 native "ClassMirror_type_arguments";
750 } 751 }
751 752
752 class _LocalFunctionTypeMirrorImpl extends _LocalClassMirrorImpl 753 class _LocalFunctionTypeMirrorImpl extends _LocalClassMirrorImpl
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
1372 if (typeMirror == null) { 1373 if (typeMirror == null) {
1373 typeMirror = makeLocalTypeMirror(key); 1374 typeMirror = makeLocalTypeMirror(key);
1374 _instanitationCache[key] = typeMirror; 1375 _instanitationCache[key] = typeMirror;
1375 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { 1376 if (typeMirror is ClassMirror && !typeMirror._isGeneric) {
1376 _declarationCache[key] = typeMirror; 1377 _declarationCache[key] = typeMirror;
1377 } 1378 }
1378 } 1379 }
1379 return typeMirror; 1380 return typeMirror;
1380 } 1381 }
1381 } 1382 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698