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

Unified Diff: runtime/vm/object.cc

Issue 215213003: Rework the <field-view> page. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « runtime/bin/vmservice/client/resources.sh ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index d628e5e42385d3c2d0ea2d3786e8f5939f2336d2..80b621e15d6a04fe663dad468f2dad4ded9b698e 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -6389,7 +6389,12 @@ void Function::PrintToJSONStream(JSONStream* stream, bool ref) const {
}
jsobj.AddProperty("name", internal_name);
jsobj.AddProperty("user_name", user_name);
- jsobj.AddProperty("class", cls);
+ if (cls.IsTopLevel()) {
+ const Library& library = Library::Handle(cls.library());
+ jsobj.AddProperty("owner", library);
+ } else {
+ jsobj.AddProperty("owner", cls);
+ }
const Function& parent = Function::Handle(parent_function());
if (!parent.IsNull()) {
jsobj.AddProperty("parent", parent);
@@ -6712,7 +6717,12 @@ void Field::PrintToJSONStream(JSONStream* stream, bool ref) const {
jsobj.AddProperty("value", valueObj);
}
- jsobj.AddProperty("owner", cls);
+ if (cls.IsTopLevel()) {
+ const Library& library = Library::Handle(cls.library());
+ jsobj.AddProperty("owner", library);
+ } else {
+ jsobj.AddProperty("owner", cls);
+ }
AbstractType& declared_type = AbstractType::Handle(type());
jsobj.AddProperty("declared_type", declared_type);
@@ -6740,6 +6750,12 @@ void Field::PrintToJSONStream(JSONStream* stream, bool ref) const {
} else {
jsobj.AddProperty("guard_length", guarded_list_length());
}
+ const Class& origin_cls = Class::Handle(origin());
+ const Script& script = Script::Handle(origin_cls.script());
+ if (!script.IsNull()) {
+ jsobj.AddProperty("script", script);
+ jsobj.AddProperty("token_pos", token_pos());
+ }
}
« no previous file with comments | « runtime/bin/vmservice/client/resources.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698