Commit 499b248c authored by Jeremy Roman's avatar Jeremy Roman Committed by Commit Bot

Simplify V8ErrorHandler::CallListenerFunction.

The branches of this if statement are identical.

Change-Id: Icc61de50c3bf18d0df2e5cc616aecef0a38e51b8
Reviewed-on: https://chromium-review.googlesource.com/598998Reviewed-by: default avatarAdithya Srinivasan <adithyas@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491586}
parent c5b3034e
...@@ -78,16 +78,10 @@ v8::Local<v8::Value> V8ErrorHandler::CallListenerFunction( ...@@ -78,16 +78,10 @@ v8::Local<v8::Value> V8ErrorHandler::CallListenerFunction(
v8::Integer::New(GetIsolate(), error_event->colno()), error}; v8::Integer::New(GetIsolate(), error_event->colno()), error};
v8::TryCatch try_catch(GetIsolate()); v8::TryCatch try_catch(GetIsolate());
try_catch.SetVerbose(true); try_catch.SetVerbose(true);
v8::MaybeLocal<v8::Value> result;
if (ExecutionContext::From(script_state)->IsWorkerGlobalScope()) { v8::MaybeLocal<v8::Value> result = V8ScriptRunner::CallFunction(
result = V8ScriptRunner::CallFunction( call_function, ExecutionContext::From(script_state), this_value,
call_function, ExecutionContext::From(script_state), this_value, WTF_ARRAY_LENGTH(parameters), parameters, GetIsolate());
WTF_ARRAY_LENGTH(parameters), parameters, GetIsolate());
} else {
result = V8ScriptRunner::CallFunction(
call_function, ExecutionContext::From(script_state), this_value,
WTF_ARRAY_LENGTH(parameters), parameters, GetIsolate());
}
v8::Local<v8::Value> return_value; v8::Local<v8::Value> return_value;
if (!result.ToLocal(&return_value)) if (!result.ToLocal(&return_value))
return v8::Null(GetIsolate()); return v8::Null(GetIsolate());
......
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