Commit 6cdcc43a authored by jochen@chromium.org's avatar jochen@chromium.org

Fix d8 DebugMessageDetails and DebugCommandToJSONRequest

They both returned zapped handles. Use an EscapableHandleScope and
properly return handles

BUG=none
R=jkummerow@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/131443005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18517 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent f754bce1
......@@ -626,9 +626,9 @@ Handle<Array> Shell::GetCompletions(Isolate* isolate,
#ifdef ENABLE_DEBUGGER_SUPPORT
Handle<Object> Shell::DebugMessageDetails(Isolate* isolate,
Handle<String> message) {
HandleScope handle_scope(isolate);
Local<Object> Shell::DebugMessageDetails(Isolate* isolate,
Handle<String> message) {
EscapableHandleScope handle_scope(isolate);
v8::Local<v8::Context> context =
v8::Local<v8::Context>::New(isolate, utility_context_);
v8::Context::Scope context_scope(context);
......@@ -638,13 +638,13 @@ Handle<Object> Shell::DebugMessageDetails(Isolate* isolate,
static const int kArgc = 1;
Handle<Value> argv[kArgc] = { message };
Handle<Value> val = Handle<Function>::Cast(fun)->Call(global, kArgc, argv);
return Handle<Object>::Cast(val);
return handle_scope.Escape(Local<Object>(Handle<Object>::Cast(val)));
}
Handle<Value> Shell::DebugCommandToJSONRequest(Isolate* isolate,
Handle<String> command) {
HandleScope handle_scope(isolate);
Local<Value> Shell::DebugCommandToJSONRequest(Isolate* isolate,
Handle<String> command) {
EscapableHandleScope handle_scope(isolate);
v8::Local<v8::Context> context =
v8::Local<v8::Context>::New(isolate, utility_context_);
v8::Context::Scope context_scope(context);
......@@ -654,7 +654,7 @@ Handle<Value> Shell::DebugCommandToJSONRequest(Isolate* isolate,
static const int kArgc = 1;
Handle<Value> argv[kArgc] = { command };
Handle<Value> val = Handle<Function>::Cast(fun)->Call(global, kArgc, argv);
return val;
return handle_scope.Escape(Local<Value>(val));
}
......
......@@ -294,10 +294,10 @@ class Shell : public i::AllStatic {
static void MapCounters(const char* name);
#ifdef ENABLE_DEBUGGER_SUPPORT
static Handle<Object> DebugMessageDetails(Isolate* isolate,
Handle<String> message);
static Handle<Value> DebugCommandToJSONRequest(Isolate* isolate,
Handle<String> command);
static Local<Object> DebugMessageDetails(Isolate* isolate,
Handle<String> message);
static Local<Value> DebugCommandToJSONRequest(Isolate* isolate,
Handle<String> command);
static void DispatchDebugMessages();
#endif // ENABLE_DEBUGGER_SUPPORT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment