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, ...@@ -626,9 +626,9 @@ Handle<Array> Shell::GetCompletions(Isolate* isolate,
#ifdef ENABLE_DEBUGGER_SUPPORT #ifdef ENABLE_DEBUGGER_SUPPORT
Handle<Object> Shell::DebugMessageDetails(Isolate* isolate, Local<Object> Shell::DebugMessageDetails(Isolate* isolate,
Handle<String> message) { Handle<String> message) {
HandleScope handle_scope(isolate); EscapableHandleScope handle_scope(isolate);
v8::Local<v8::Context> context = v8::Local<v8::Context> context =
v8::Local<v8::Context>::New(isolate, utility_context_); v8::Local<v8::Context>::New(isolate, utility_context_);
v8::Context::Scope context_scope(context); v8::Context::Scope context_scope(context);
...@@ -638,13 +638,13 @@ Handle<Object> Shell::DebugMessageDetails(Isolate* isolate, ...@@ -638,13 +638,13 @@ Handle<Object> Shell::DebugMessageDetails(Isolate* isolate,
static const int kArgc = 1; static const int kArgc = 1;
Handle<Value> argv[kArgc] = { message }; Handle<Value> argv[kArgc] = { message };
Handle<Value> val = Handle<Function>::Cast(fun)->Call(global, kArgc, argv); 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, Local<Value> Shell::DebugCommandToJSONRequest(Isolate* isolate,
Handle<String> command) { Handle<String> command) {
HandleScope handle_scope(isolate); EscapableHandleScope handle_scope(isolate);
v8::Local<v8::Context> context = v8::Local<v8::Context> context =
v8::Local<v8::Context>::New(isolate, utility_context_); v8::Local<v8::Context>::New(isolate, utility_context_);
v8::Context::Scope context_scope(context); v8::Context::Scope context_scope(context);
...@@ -654,7 +654,7 @@ Handle<Value> Shell::DebugCommandToJSONRequest(Isolate* isolate, ...@@ -654,7 +654,7 @@ Handle<Value> Shell::DebugCommandToJSONRequest(Isolate* isolate,
static const int kArgc = 1; static const int kArgc = 1;
Handle<Value> argv[kArgc] = { command }; Handle<Value> argv[kArgc] = { command };
Handle<Value> val = Handle<Function>::Cast(fun)->Call(global, kArgc, argv); 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 { ...@@ -294,10 +294,10 @@ class Shell : public i::AllStatic {
static void MapCounters(const char* name); static void MapCounters(const char* name);
#ifdef ENABLE_DEBUGGER_SUPPORT #ifdef ENABLE_DEBUGGER_SUPPORT
static Handle<Object> DebugMessageDetails(Isolate* isolate, static Local<Object> DebugMessageDetails(Isolate* isolate,
Handle<String> message); Handle<String> message);
static Handle<Value> DebugCommandToJSONRequest(Isolate* isolate, static Local<Value> DebugCommandToJSONRequest(Isolate* isolate,
Handle<String> command); Handle<String> command);
static void DispatchDebugMessages(); static void DispatchDebugMessages();
#endif // ENABLE_DEBUGGER_SUPPORT #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