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

Unified Diff: sdk/lib/_internal/lib/mirror_helper.dart

Issue 22791002: Add renames in output when using the mirror helper library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added an assert. Created 7 years, 4 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
Index: sdk/lib/_internal/lib/mirror_helper.dart
diff --git a/sdk/lib/_internal/lib/mirror_helper.dart b/sdk/lib/_internal/lib/mirror_helper.dart
new file mode 100644
index 0000000000000000000000000000000000000000..ea2649ee349c18d63d6a452875e64b1a3b635cb4
--- /dev/null
+++ b/sdk/lib/_internal/lib/mirror_helper.dart
@@ -0,0 +1,25 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// 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.
+/**
+ * Helps dealing with reflection in the case that the source code has been
+ * changed as a result of compiling with dart2dart.
+ */
+library _mirror_helper;
+
+import 'dart:mirrors';
+
+/// The compiler will replace this variable with a map containing all the
+/// renames made in dart2dart.
+const Map _SYMBOLS = null;
+
+/// This method is a wrapper for MirrorSystem.getName() and will be inlined and
+/// called in the generated output Dart code.
+String helperGetName(Symbol sym) {
+ var name = MirrorSystem.getName(sym);
+ if (_SYMBOLS.containsKey(name)) {
+ return _SYMBOLS[name].stringValue;
+ } else {
+ return name;
+ }
+}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/scanner/scanner_task.dart ('k') | sdk/lib/_internal/libraries.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698