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

Unified Diff: runtime/vm/object.cc

Issue 217543004: VM: Evaluate metadata on a class in the scope of its library not the scope of the class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix status for dart2js and analyzer Created 6 years, 9 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/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 80b621e15d6a04fe663dad468f2dad4ded9b698e..5f448e39b659cf08e7619c187306948c5a0cc009 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -8033,8 +8033,14 @@ void Library::AddMetadata(const Class& cls,
}
-void Library::AddClassMetadata(const Class& cls, intptr_t token_pos) const {
- AddMetadata(cls, String::Handle(MakeClassMetaName(cls)), token_pos);
+void Library::AddClassMetadata(const Class& cls,
+ const Class& toplevel_class,
+ intptr_t token_pos) const {
+ // We use the toplevel class as the owner of a class's metadata field because
+ // a class's metadata is in scope of the library, not the class.
+ AddMetadata(toplevel_class,
+ String::Handle(MakeClassMetaName(cls)),
+ token_pos);
}

Powered by Google App Engine
This is Rietveld 408576698