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

Unified Diff: runtime/lib/core_patch.dart

Issue 735723003: Implement enum types in VM (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 1 month 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 | « no previous file | runtime/vm/class_finalizer.h » ('j') | runtime/vm/method_recognizer.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/core_patch.dart
===================================================================
--- runtime/lib/core_patch.dart (revision 41810)
+++ runtime/lib/core_patch.dart (working copy)
@@ -10,3 +10,14 @@
void _asyncCatchHelper(catchFunction, continuation) {
catchFunction((e) => continuation(null, e));
}
+
+// The members of this class are cloned and added to each class that
+// represents an enum type.
+class _EnumHelper {
+ // Declare the list of enum value names private. When this field is
+ // cloned into a user-defined enum class, the field will be inaccessible
+ // because of the library-specific name suffix. The toString() function
+ // below can access it because it uses the same name suffix.
+ static const List<String> _enum_names = null;
+ String toString() => _enum_names[index];
+}
« no previous file with comments | « no previous file | runtime/vm/class_finalizer.h » ('j') | runtime/vm/method_recognizer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698