Chromium Code Reviews| Index: runtime/vm/service.cc |
| =================================================================== |
| --- runtime/vm/service.cc (revision 36381) |
| +++ runtime/vm/service.cc (working copy) |
| @@ -851,6 +851,23 @@ |
| } |
| +static bool IsInternal(const Object& obj) { |
|
turnidge
2014/05/20 23:21:34
The name is a bit vague. Not sure what to suggest
koda
2014/05/21 15:49:23
Done.
|
| + if (obj.IsArray()) { |
|
turnidge
2014/05/20 23:21:34
Do you need to add a case for obj.IsGrowableArray
koda
2014/05/21 15:49:23
Good point. Done.
|
| + const Array& array = Array::Cast(obj); |
| + Object& element = Object::Handle(); |
| + for (intptr_t i = 0; i < array.Length(); ++i) { |
| + element = array.At(i); |
| + if (!element.IsInstance()) { |
| + return true; |
| + } |
| + } |
| + return false; |
| + } else { |
| + return !obj.IsInstance(); |
| + } |
| +} |
| + |
| + |
| static bool HandleInstanceCommands(Isolate* isolate, |
| const Object& obj, |
| JSONStream* js, |
| @@ -876,6 +893,10 @@ |
| js->num_arguments()); |
| return true; |
| } |
| + if (IsInternal(obj)) { |
| + PrintError(js, "attempt to evaluate against internal VM object\n"); |
| + return true; |
| + } |
| const char* expr = js->LookupOption("expr"); |
| if (expr == NULL) { |
| PrintError(js, "eval expects an 'expr' option\n", |