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

Unified Diff: runtime/vm/parser.cc

Issue 269253005: Put metadata fields in their owner class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index b019d065d6a9acf7ce4add33abaf9d5895f2e3c6..0620ed154140e43e1805440185768fdf1a3ff66a 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -4047,12 +4047,10 @@ void Parser::ParseClassDefinition(const Class& cls) {
const bool need_implicit_constructor =
!members.has_constructor() && !cls.is_patch();
- Array& array = Array::Handle();
- array = Array::MakeArray(members.fields());
- cls.SetFields(array);
+ cls.AddFields(members.fields());
// Creating a new array for functions marks the class as parsed.
- array = Array::MakeArray(members.functions());
+ const Array& array = Array::Handle(Array::MakeArray(members.functions()));
cls.SetFunctions(array);
// Add an implicit constructor if no explicit constructor is present.
@@ -5260,12 +5258,9 @@ void Parser::ParseTopLevel() {
}
}
if ((top_level.fields.Length() > 0) || (top_level.functions.Length() > 0)) {
- Array& array = Array::Handle();
+ toplevel_class.AddFields(top_level.fields);
- array = Array::MakeArray(top_level.fields);
- toplevel_class.SetFields(array);
-
- array = Array::MakeArray(top_level.functions);
+ const Array& array = Array::Handle(Array::MakeArray(top_level.functions));
toplevel_class.SetFunctions(array);
library_.AddAnonymousClass(toplevel_class);
« runtime/vm/object.cc ('K') | « runtime/vm/object.cc ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698