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

Unified Diff: runtime/lib/mirrors_patch.dart

Issue 1107613002: Move symbol demangling to dart:_internal to remove dart:core dependency on dart:mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/mirrors_impl.dart ('k') | runtime/lib/symbol_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors_patch.dart
diff --git a/runtime/lib/mirrors_patch.dart b/runtime/lib/mirrors_patch.dart
index 962a1c73abfdd70dbd29af3592ca855605d5f0a2..e80dd47d94a74c06ff5b99d19f23e861e9463418 100644
--- a/runtime/lib/mirrors_patch.dart
+++ b/runtime/lib/mirrors_patch.dart
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import "dart:_internal" as _symbol_dev;
+import "dart:_internal" as internal;
/**
* Returns a [MirrorSystem] for the current isolate.
@@ -51,42 +51,7 @@ patch class MirrorSystem {
}
/* patch */ static String getName(Symbol symbol) {
- String string = _symbol_dev.Symbol.getName(symbol);
-
- // get:foo -> foo
- // set:foo -> foo=
- // get:_foo@xxx -> _foo
- // set:_foo@xxx -> _foo=
- // Class._constructor@xxx -> Class._constructor
- // _Class@xxx._constructor@xxx -> _Class._constructor
- // lib._S@xxx with lib._M1@xxx, lib._M2@xxx -> lib._S with lib._M1, lib._M2
- StringBuffer result = new StringBuffer();
- bool add_setter_suffix = false;
- var pos = 0;
- if (string.length >= 4 && string[3] == ':') {
- // Drop 'get:' or 'set:' prefix.
- pos = 4;
- if (string[0] == 's') {
- add_setter_suffix = true;
- }
- }
- // Skip everything between AT and PERIOD, SPACE, COMMA or END
- bool skip = false;
- for (; pos < string.length; pos++) {
- var char = string[pos];
- if (char == '@') {
- skip = true;
- } else if (char == '.' || char == ' ' || char == ',') {
- skip = false;
- }
- if (!skip) {
- result.write(char);
- }
- }
- if (add_setter_suffix) {
- result.write('=');
- }
- return result.toString();
+ return internal.Symbol.getUnmangledName(symbol);
}
/* patch */ static Symbol getSymbol(String name, [LibraryMirror library]) {
@@ -95,7 +60,7 @@ patch class MirrorSystem {
throw new ArgumentError(library);
}
if (library != null) name = _mangleName(name, library._reflectee);
- return new _symbol_dev.Symbol.unvalidated(name);
+ return new internal.Symbol.unvalidated(name);
}
static _mangleName(String name, _MirrorReference lib)
« no previous file with comments | « runtime/lib/mirrors_impl.dart ('k') | runtime/lib/symbol_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698