| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/service.h" | 5 #include "vm/service.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
| 9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
| 10 | 10 |
| (...skipping 2132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2143 const Object& result = Object::Handle(zone, | 2143 const Object& result = Object::Handle(zone, |
| 2144 cls.Evaluate(expr_str, Array::empty_array(), Array::empty_array())); | 2144 cls.Evaluate(expr_str, Array::empty_array(), Array::empty_array())); |
| 2145 result.PrintJSON(js, true); | 2145 result.PrintJSON(js, true); |
| 2146 return true; | 2146 return true; |
| 2147 } | 2147 } |
| 2148 if ((obj.IsInstance() || obj.IsNull()) && | 2148 if ((obj.IsInstance() || obj.IsNull()) && |
| 2149 !ContainsNonInstance(obj)) { | 2149 !ContainsNonInstance(obj)) { |
| 2150 // We don't use Instance::Cast here because it doesn't allow null. | 2150 // We don't use Instance::Cast here because it doesn't allow null. |
| 2151 Instance& instance = Instance::Handle(zone); | 2151 Instance& instance = Instance::Handle(zone); |
| 2152 instance ^= obj.raw(); | 2152 instance ^= obj.raw(); |
| 2153 const Class& receiver_cls = Class::Handle(zone, instance.clazz()); |
| 2153 const Object& result = | 2154 const Object& result = |
| 2154 Object::Handle(zone, instance.Evaluate(expr_str, | 2155 Object::Handle(zone, instance.Evaluate(receiver_cls, |
| 2156 expr_str, |
| 2155 Array::empty_array(), | 2157 Array::empty_array(), |
| 2156 Array::empty_array())); | 2158 Array::empty_array())); |
| 2157 result.PrintJSON(js, true); | 2159 result.PrintJSON(js, true); |
| 2158 return true; | 2160 return true; |
| 2159 } | 2161 } |
| 2160 js->PrintError(kInvalidParams, | 2162 js->PrintError(kInvalidParams, |
| 2161 "%s: invalid 'targetId' parameter: " | 2163 "%s: invalid 'targetId' parameter: " |
| 2162 "Cannot evaluate against a VM-internal object", js->method()); | 2164 "Cannot evaluate against a VM-internal object", js->method()); |
| 2163 return true; | 2165 return true; |
| 2164 } | 2166 } |
| (...skipping 1941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4106 if (strcmp(method_name, method.name) == 0) { | 4108 if (strcmp(method_name, method.name) == 0) { |
| 4107 return &method; | 4109 return &method; |
| 4108 } | 4110 } |
| 4109 } | 4111 } |
| 4110 return NULL; | 4112 return NULL; |
| 4111 } | 4113 } |
| 4112 | 4114 |
| 4113 #endif // !PRODUCT | 4115 #endif // !PRODUCT |
| 4114 | 4116 |
| 4115 } // namespace dart | 4117 } // namespace dart |
| OLD | NEW |