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

Unified Diff: Source/core/inspector/JavaScriptCallFrame.cpp

Issue 416363002: DevTools: Fix Crash Report - v8::Value::IsInt32. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: enter debugger context Created 6 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/JavaScriptCallFrame.cpp
diff --git a/Source/core/inspector/JavaScriptCallFrame.cpp b/Source/core/inspector/JavaScriptCallFrame.cpp
index e997c2b051eb4246e7324a605b4ce3cfe3cbb3d1..9347da687fce04e015f32f51851a527f80721299 100644
--- a/Source/core/inspector/JavaScriptCallFrame.cpp
+++ b/Source/core/inspector/JavaScriptCallFrame.cpp
@@ -56,7 +56,7 @@ JavaScriptCallFrame* JavaScriptCallFrame::caller()
v8::Handle<v8::Context> debuggerContext = m_debuggerContext.newLocal(m_isolate);
v8::Context::Scope contextScope(debuggerContext);
v8::Handle<v8::Value> callerFrame = m_callFrame.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "caller"));
- if (!callerFrame->IsObject())
+ if (callerFrame.IsEmpty() || !callerFrame->IsObject())
return 0;
m_caller = JavaScriptCallFrame::create(debuggerContext, v8::Handle<v8::Object>::Cast(callerFrame));
}
@@ -66,17 +66,19 @@ JavaScriptCallFrame* JavaScriptCallFrame::caller()
int JavaScriptCallFrame::callV8FunctionReturnInt(const char* name) const
{
v8::HandleScope handleScope(m_isolate);
+ v8::Context::Scope contextScope(m_debuggerContext.newLocal(m_isolate));
v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate);
v8::Handle<v8::Function> func = v8::Handle<v8::Function>::Cast(callFrame->Get(v8AtomicString(m_isolate, name)));
v8::Handle<v8::Value> result = func->Call(callFrame, 0, 0);
- if (result->IsInt32())
- return result->Int32Value();
- return 0;
+ if (result.IsEmpty() || !result->IsInt32())
+ return 0;
+ return result->Int32Value();
}
String JavaScriptCallFrame::callV8FunctionReturnString(const char* name) const
{
v8::HandleScope handleScope(m_isolate);
+ v8::Context::Scope contextScope(m_debuggerContext.newLocal(m_isolate));
v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate);
v8::Handle<v8::Function> func = v8::Handle<v8::Function>::Cast(callFrame->Get(v8AtomicString(m_isolate, name)));
v8::Handle<v8::Value> result = func->Call(callFrame, 0, 0);
@@ -140,9 +142,9 @@ bool JavaScriptCallFrame::isAtReturn() const
v8::HandleScope handleScope(m_isolate);
v8::Context::Scope contextScope(m_debuggerContext.newLocal(m_isolate));
v8::Handle<v8::Value> result = m_callFrame.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "isAtReturn"));
- if (result->IsBoolean())
- return result->BooleanValue();
- return false;
+ if (result.IsEmpty() || !result->IsBoolean())
+ return false;
+ return result->BooleanValue();
}
v8::Handle<v8::Value> JavaScriptCallFrame::returnValue() const
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698