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

Unified Diff: runtime/vm/service.cc

Issue 466183002: Use function names as service IDs, rather than indices. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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/vm/object.cc ('k') | runtime/vm/service_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service.cc
===================================================================
--- runtime/vm/service.cc (revision 39196)
+++ runtime/vm/service.cc (working copy)
@@ -1139,19 +1139,20 @@
static bool HandleClassesFunctions(Isolate* isolate, const Class& cls,
JSONStream* js) {
- intptr_t id;
- if (js->num_arguments() > 5) {
- PrintError(js, "Command too long");
+ if (js->num_arguments() != 4 && js->num_arguments() != 5) {
+ PrintError(js, "Command should have 4 or 5 arguments");
return true;
}
- if (!GetIntegerId(js->GetArgument(3), &id)) {
- PrintError(js, "Must specify collection object id: functions/id");
+ const char* encoded_id = js->GetArgument(3);
+ String& id = String::Handle(isolate, String::New(encoded_id));
+ id = String::DecodeIRI(id);
+ if (id.IsNull()) {
+ PrintError(js, "Function id %s is malformed", encoded_id);
return true;
}
- Function& func = Function::Handle();
- func ^= cls.FunctionFromIndex(id);
+ Function& func = Function::Handle(cls.LookupFunction(id));
if (func.IsNull()) {
- PrintError(js, "Function %" Pd " not found", id);
+ PrintError(js, "Function %s not found", encoded_id);
return true;
}
if (js->num_arguments() == 4) {
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/service_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698