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

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

Issue 27226003: Do not hide membership of implementation classes in dart:core. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 import "dart:nativewrappers"; 5 import "dart:nativewrappers";
6 // TODO(ahe): Move _symbol_dev.Symbol to its own "private" library? 6 // TODO(ahe): Move _symbol_dev.Symbol to its own "private" library?
7 import "dart:_collection-dev" as _symbol_dev; 7 import "dart:_collection-dev" as _symbol_dev;
8 8
9 /** 9 /**
10 * Returns a [MirrorSystem] for the current isolate. 10 * Returns a [MirrorSystem] for the current isolate.
(...skipping 25 matching lines...) Expand all
36 * Type object. 36 * Type object.
37 * 37 *
38 * This only works with objects local to the current isolate. 38 * This only works with objects local to the current isolate.
39 */ 39 */
40 patch ClassMirror reflectClass(Type key) { 40 patch ClassMirror reflectClass(Type key) {
41 return _Mirrors.reflectClass(key); 41 return _Mirrors.reflectClass(key);
42 } 42 }
43 43
44 patch class MirrorSystem { 44 patch class MirrorSystem {
45 /* patch */ static String getName(Symbol symbol) { 45 /* patch */ static String getName(Symbol symbol) {
46 return _unmangleName(_symbol_dev.Symbol.getName(symbol)); 46 String string = _symbol_dev.Symbol.getName(symbol);
47 if (string.contains(' with ')) return string;
48 return _unmangleName(string);
47 } 49 }
48 /* patch */ static Symbol getSymbol(String name, [LibraryMirror library]) { 50 /* patch */ static Symbol getSymbol(String name, [LibraryMirror library]) {
49 if (library is! LibraryMirror || 51 if (library is! LibraryMirror ||
50 ((name[0] == '_') && (library == null))) { 52 ((name[0] == '_') && (library == null))) {
51 throw new ArgumentError(library); 53 throw new ArgumentError(library);
52 } 54 }
53 if (library != null) name = _mangleName(name, library._reflectee); 55 if (library != null) name = _mangleName(name, library._reflectee);
54 return new _symbol_dev.Symbol.unvalidated(name); 56 return new _symbol_dev.Symbol.unvalidated(name);
55 } 57 }
56 58
57 static _unmangleName(String name) 59 static _unmangleName(String name)
58 native "Mirrors_unmangleName"; 60 native "Mirrors_unmangleName";
59 static _mangleName(String name, _MirrorReference lib) 61 static _mangleName(String name, _MirrorReference lib)
60 native "Mirrors_mangleName"; 62 native "Mirrors_mangleName";
61 } 63 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698