| Index: Source/bindings/core/v8/ScriptDebugServer.cpp
|
| diff --git a/Source/bindings/core/v8/ScriptDebugServer.cpp b/Source/bindings/core/v8/ScriptDebugServer.cpp
|
| index b3216357a0b38304408919a6b39ce53a7967c4f8..586a748b2fe914f52a23aa60b27a357024735583 100644
|
| --- a/Source/bindings/core/v8/ScriptDebugServer.cpp
|
| +++ b/Source/bindings/core/v8/ScriptDebugServer.cpp
|
| @@ -614,8 +614,7 @@ void ScriptDebugServer::ensureDebuggerScriptCompiled()
|
| v8::Context::Scope contextScope(v8::Debug::GetDebugContext());
|
| const blink::WebData& debuggerScriptSourceResource = blink::Platform::current()->loadResource("DebuggerScriptSource.js");
|
| v8::Handle<v8::String> source = v8String(m_isolate, String(debuggerScriptSourceResource.data(), debuggerScriptSourceResource.size()));
|
| - v8::Local<v8::Value> value = V8ScriptRunner::compileAndRunInternalScript(source, m_isolate);
|
| - ASSERT(!value.IsEmpty());
|
| + v8::Local<v8::Value> value = V8ScriptRunner::compileAndRunInternalScript(source, m_isolate).ToLocalChecked();
|
| ASSERT(value->IsObject());
|
| m_debuggerScript.Reset(m_isolate, v8::Handle<v8::Object>::Cast(value));
|
| }
|
| @@ -697,8 +696,8 @@ void ScriptDebugServer::compileScript(ScriptState* scriptState, const String& ex
|
|
|
| v8::Handle<v8::String> source = v8String(m_isolate, expression);
|
| v8::TryCatch tryCatch;
|
| - v8::Local<v8::Script> script = V8ScriptRunner::compileScript(source, sourceURL, String(), TextPosition(), m_isolate);
|
| - if (tryCatch.HasCaught()) {
|
| + v8::Local<v8::Script> script;
|
| + if (!v8Call(V8ScriptRunner::compileScript(source, sourceURL, String(), TextPosition(), m_isolate), script, tryCatch)) {
|
| v8::Local<v8::Message> message = tryCatch.Message();
|
| if (!message.IsEmpty()) {
|
| *exceptionDetailsText = toCoreStringWithUndefinedOrNullCheck(message->Get());
|
| @@ -710,7 +709,7 @@ void ScriptDebugServer::compileScript(ScriptState* scriptState, const String& ex
|
| }
|
| return;
|
| }
|
| - if (script.IsEmpty() || !persistScript)
|
| + if (!persistScript)
|
| return;
|
|
|
| *scriptId = String::number(script->GetUnboundScript()->GetId());
|
| @@ -735,9 +734,13 @@ void ScriptDebugServer::runScript(ScriptState* scriptState, const String& script
|
| return;
|
| ScriptState::Scope scope(scriptState);
|
| v8::TryCatch tryCatch;
|
| - v8::Local<v8::Value> value = V8ScriptRunner::runCompiledScript(m_isolate, script, scriptState->executionContext());
|
| + v8::Local<v8::Value> value;
|
| *wasThrown = false;
|
| - if (tryCatch.HasCaught()) {
|
| + if (!V8ScriptRunner::runCompiledScript(m_isolate, script, scriptState->executionContext()).ToLocal(&value)) {
|
| + *result = ScriptValue(scriptState, value);
|
| + } else {
|
| + if (!tryCatch.HasCaught())
|
| + return;
|
| *wasThrown = true;
|
| *result = ScriptValue(scriptState, tryCatch.Exception());
|
| v8::Local<v8::Message> message = tryCatch.Message();
|
| @@ -749,8 +752,6 @@ void ScriptDebugServer::runScript(ScriptState* scriptState, const String& script
|
| if (!messageStackTrace.IsEmpty() && messageStackTrace->GetFrameCount() > 0)
|
| *stackTrace = createScriptCallStack(m_isolate, messageStackTrace, messageStackTrace->GetFrameCount());
|
| }
|
| - } else {
|
| - *result = ScriptValue(scriptState, value);
|
| }
|
| }
|
|
|
|
|