| 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);
|
| }
|
|
|
|
|
|
|