| Index: Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp
|
| diff --git a/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp b/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp
|
| index c169b37bca1197a1324d0529837def04cd6c4c7a..8802fc0fb0e33cc816045571390e8763006e9c21 100644
|
| --- a/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp
|
| +++ b/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp
|
| @@ -378,9 +378,10 @@ void V8InjectedScriptHost::evalMethodCustom(const v8::FunctionCallbackInfo<v8::V
|
|
|
| ASSERT(isolate->InContext());
|
| v8::TryCatch tryCatch;
|
| - v8::Handle<v8::Value> result = V8ScriptRunner::compileAndRunInternalScript(expression, info.GetIsolate());
|
| - if (tryCatch.HasCaught()) {
|
| - v8SetReturnValue(info, tryCatch.ReThrow());
|
| + v8::Local<v8::Value> result;
|
| + if (!V8ScriptRunner::compileAndRunInternalScript(expression, info.GetIsolate()).ToLocal(&result)) {
|
| + if (tryCatch.HasCaught())
|
| + v8SetReturnValue(info, tryCatch.ReThrow());
|
| return;
|
| }
|
| v8SetReturnValue(info, result);
|
| @@ -402,15 +403,20 @@ void V8InjectedScriptHost::evaluateWithExceptionDetailsMethodCustom(const v8::Fu
|
|
|
| ASSERT(isolate->InContext());
|
| v8::TryCatch tryCatch;
|
| - v8::Handle<v8::Script> script = V8ScriptRunner::compileScript(expression, String(), String(), TextPosition(), isolate);
|
| - v8::Handle<v8::Value> result = V8ScriptRunner::runCompiledScript(isolate, script, currentExecutionContext(isolate));
|
| + v8::Local<v8::Script> script;
|
| + v8::MaybeLocal<v8::Value> result;
|
| + if (v8Call(V8ScriptRunner::compileScript(expression, String(), String(), TextPosition(), isolate), script, tryCatch))
|
| + result = V8ScriptRunner::runCompiledScript(isolate, script, currentExecutionContext(isolate));
|
|
|
| + if (!tryCatch.CanContinue())
|
| + return;
|
| v8::Local<v8::Object> wrappedResult = v8::Object::New(isolate);
|
| if (tryCatch.HasCaught()) {
|
| wrappedResult->Set(v8::String::NewFromUtf8(isolate, "result"), tryCatch.Exception());
|
| wrappedResult->Set(v8::String::NewFromUtf8(isolate, "exceptionDetails"), JavaScriptCallFrame::createExceptionDetails(isolate, tryCatch.Message()));
|
| } else {
|
| - wrappedResult->Set(v8::String::NewFromUtf8(isolate, "result"), result);
|
| + ASSERT(!result.IsEmpty());
|
| + wrappedResult->Set(v8::String::NewFromUtf8(isolate, "result"), result.ToLocalChecked());
|
| wrappedResult->Set(v8::String::NewFromUtf8(isolate, "exceptionDetails"), v8::Undefined(isolate));
|
| }
|
| v8SetReturnValue(info, wrappedResult);
|
|
|