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

Unified Diff: runtime/vm/service_test.cc

Issue 294473006: Disallow eval on lists containing non-instances. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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
« runtime/vm/service.cc ('K') | « runtime/vm/service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service_test.cc
===================================================================
--- runtime/vm/service_test.cc (revision 36381)
+++ runtime/vm/service_test.cc (working copy)
@@ -562,6 +562,20 @@
ExpectSubstringF(handler.msg(),
"\"id\":\"objects\\/int-%" Pd "\"",
arr.raw()->Size() + arr.At(0)->Size());
+
+ // eval against list containing an internal object.
+ Object& internal_object = Object::Handle();
+ internal_object = LiteralToken::New();
+ arr.SetAt(0, internal_object);
+ service_msg = Eval(lib,
+ "[port, ['objects', '$validId', 'eval'], "
+ "['expr'], ['toString()']]");
+ Service::HandleIsolateMessage(isolate, service_msg);
+ handler.HandleNextMessage();
+ ExpectSubstringF(handler.msg(), "\"type\":\"Error\"");
+ ExpectSubstringF(
+ handler.msg(),
+ "\"message\":\"attempt to evaluate against internal VM object\\n\"");
}
« runtime/vm/service.cc ('K') | « runtime/vm/service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698