OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/object.h" | 5 #include "vm/object.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 13013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13024 AddCommonObjectProperties(&jsobj, "Context", ref); | 13024 AddCommonObjectProperties(&jsobj, "Context", ref); |
13025 jsobj.AddServiceId(*this); | 13025 jsobj.AddServiceId(*this); |
13026 | 13026 |
13027 jsobj.AddProperty("length", num_variables()); | 13027 jsobj.AddProperty("length", num_variables()); |
13028 | 13028 |
13029 if (ref) { | 13029 if (ref) { |
13030 return; | 13030 return; |
13031 } | 13031 } |
13032 | 13032 |
13033 const Context& parent_context = Context::Handle(parent()); | 13033 const Context& parent_context = Context::Handle(parent()); |
13034 jsobj.AddProperty("parent", parent_context); | 13034 if (!parent_context.IsNull()) { |
| 13035 jsobj.AddProperty("parent", parent_context); |
| 13036 } |
13035 | 13037 |
13036 JSONArray jsarr(&jsobj, "variables"); | 13038 JSONArray jsarr(&jsobj, "variables"); |
13037 Object& var = Object::Handle(); | 13039 Object& var = Object::Handle(); |
13038 for (intptr_t index = 0; index < num_variables(); index++) { | 13040 for (intptr_t index = 0; index < num_variables(); index++) { |
13039 var = At(index); | 13041 var = At(index); |
13040 JSONObject jselement(&jsarr); | 13042 JSONObject jselement(&jsarr); |
13041 jselement.AddProperty("value", var); | 13043 jselement.AddProperty("value", var); |
13042 } | 13044 } |
13043 } | 13045 } |
13044 | 13046 |
(...skipping 7763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20808 return tag_label.ToCString(); | 20810 return tag_label.ToCString(); |
20809 } | 20811 } |
20810 | 20812 |
20811 | 20813 |
20812 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 20814 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
20813 Instance::PrintJSONImpl(stream, ref); | 20815 Instance::PrintJSONImpl(stream, ref); |
20814 } | 20816 } |
20815 | 20817 |
20816 | 20818 |
20817 } // namespace dart | 20819 } // namespace dart |
OLD | NEW |