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

Unified Diff: runtime/vm/parser.cc

Issue 752123003: Support enum keys in maps in messages. (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
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 41925)
+++ runtime/vm/parser.cc (working copy)
@@ -4456,6 +4456,14 @@
to_string_func.set_is_visible(false);
enum_members.AddFunction(to_string_func);
+ // Clone the hashCode getter function from the helper class.
+ Function& hash_code_func = Function::Handle(I,
+ helper_class.LookupDynamicFunctionAllowPrivate(Symbols::hashCode()));
+ ASSERT(!hash_code_func.IsNull());
+ hash_code_func = hash_code_func.Clone(cls);
+ hash_code_func.set_is_visible(false);
+ enum_members.AddFunction(hash_code_func);
+
cls.AddFields(enum_members.fields());
const Array& functions =
Array::Handle(I, Array::MakeArray(enum_members.functions()));

Powered by Google App Engine
This is Rietveld 408576698