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

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

Issue 2615943004: Reapply "reflectType() dynamic type arguments support (#26012)" (Closed)
Patch Set: Add a test. Created 3 years, 11 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
« no previous file with comments | « runtime/lib/mirrors_impl.dart ('k') | runtime/vm/bootstrap_natives.h » ('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 import "dart:async" show Future; 5 import "dart:async" show Future;
6 import "dart:collection" show UnmodifiableListView, UnmodifiableMapView; 6 import "dart:collection" show UnmodifiableListView, UnmodifiableMapView;
7 import "dart:_internal" as internal; 7 import "dart:_internal" as internal;
8 8
9 /** 9 /**
10 * Returns a [MirrorSystem] for the current isolate. 10 * Returns a [MirrorSystem] for the current isolate.
(...skipping 15 matching lines...) Expand all
26 /** 26 /**
27 * Returns a [ClassMirror] for the class represented by a Dart 27 * Returns a [ClassMirror] for the class represented by a Dart
28 * Type object. 28 * Type object.
29 * 29 *
30 * This only works with objects local to the current isolate. 30 * This only works with objects local to the current isolate.
31 */ 31 */
32 @patch ClassMirror reflectClass(Type key) { 32 @patch ClassMirror reflectClass(Type key) {
33 return _Mirrors.reflectClass(key); 33 return _Mirrors.reflectClass(key);
34 } 34 }
35 35
36 @patch TypeMirror reflectType(Type key) { 36 @patch TypeMirror reflectType(Type key, [List<Type> typeArguments]) {
37 return _Mirrors.reflectType(key); 37 return _Mirrors.reflectType(key, typeArguments);
38 } 38 }
39 39
40 @patch class MirrorSystem { 40 @patch class MirrorSystem {
41 @patch LibraryMirror findLibrary(Symbol libraryName) { 41 @patch LibraryMirror findLibrary(Symbol libraryName) {
42 var candidates = 42 var candidates =
43 libraries.values.where((lib) => lib.simpleName == libraryName); 43 libraries.values.where((lib) => lib.simpleName == libraryName);
44 if (candidates.length == 1) { 44 if (candidates.length == 1) {
45 return candidates.single; 45 return candidates.single;
46 } 46 }
47 if (candidates.length > 1) { 47 if (candidates.length > 1) {
(...skipping 13 matching lines...) Expand all
61 ((name.length > 0) && (name[0] == '_') && (library == null))) { 61 ((name.length > 0) && (name[0] == '_') && (library == null))) {
62 throw new ArgumentError(library); 62 throw new ArgumentError(library);
63 } 63 }
64 if (library != null) name = _mangleName(name, library._reflectee); 64 if (library != null) name = _mangleName(name, library._reflectee);
65 return new internal.Symbol.unvalidated(name); 65 return new internal.Symbol.unvalidated(name);
66 } 66 }
67 67
68 static _mangleName(String name, _MirrorReference lib) 68 static _mangleName(String name, _MirrorReference lib)
69 native "Mirrors_mangleName"; 69 native "Mirrors_mangleName";
70 } 70 }
OLDNEW
« no previous file with comments | « runtime/lib/mirrors_impl.dart ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698