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

Unified Diff: runtime/vm/kernel_reader.cc

Issue 2519133004: Use field.RawOwner() for initializer to keep correct script. (Closed)
Patch Set: Created 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel_reader.cc
diff --git a/runtime/vm/kernel_reader.cc b/runtime/vm/kernel_reader.cc
index 22f5568ec1b516f836ad9793a1ea1625bbccf8bc..d585521dea3372c292f666facaae015516862658 100644
--- a/runtime/vm/kernel_reader.cc
+++ b/runtime/vm/kernel_reader.cc
@@ -706,7 +706,10 @@ ParsedFunction* ParseStaticFieldInitializer(Zone* zone,
init_name = Symbols::FromConcat(thread, Symbols::InitPrefix(), init_name);
// Create a static initializer.
- const dart::Class& owner = dart::Class::Handle(zone, field.Owner());
+
+ // Use RawOwner: We also want PatchClass (created by ClassForScriptAt)
Kevin Millikin (Google) 2016/11/23 10:40:45 The comment wording is strange, but I'm not sure t
jensj 2016/11/23 11:39:27 I'll remove it.
+ // so the initializer function gets the same script as the field.
+ const Object& owner = Object::Handle(field.RawOwner());
const Function& initializer_fun = Function::ZoneHandle(
zone,
dart::Function::New(init_name, RawFunction::kImplicitStaticFinalGetter,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698