| Index: third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp b/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
|
| index 4fe69ae33aec6740a9344a7d556208a63bd7966a..00f83bcad9df9220aa401d035fdbcea6992a3b8a 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
|
| @@ -308,11 +308,13 @@ bool WorkerOrWorkletScriptController::evaluate(
|
| return false;
|
| }
|
| if (m_globalScope->shouldSanitizeScriptError(state.m_location->url(),
|
| - NotSharableCrossOrigin))
|
| + NotSharableCrossOrigin)) {
|
| *errorEvent = ErrorEvent::createSanitizedError(m_world.get());
|
| - else
|
| - *errorEvent = ErrorEvent::create(
|
| - state.errorMessage, state.m_location->clone(), m_world.get());
|
| + } else {
|
| + *errorEvent =
|
| + ErrorEvent::create(state.errorMessage, state.m_location->clone(),
|
| + m_world.get(), state.exception);
|
| + }
|
| V8ErrorHandler::storeExceptionOnErrorEventWrapper(
|
| m_scriptState.get(), *errorEvent, state.exception.v8Value(),
|
| m_scriptState->context()->Global());
|
| @@ -320,11 +322,13 @@ bool WorkerOrWorkletScriptController::evaluate(
|
| DCHECK(!m_globalScope->shouldSanitizeScriptError(state.m_location->url(),
|
| NotSharableCrossOrigin));
|
| ErrorEvent* event = nullptr;
|
| - if (state.m_errorEventFromImportedScript)
|
| + if (state.m_errorEventFromImportedScript) {
|
| event = state.m_errorEventFromImportedScript.release();
|
| - else
|
| - event = ErrorEvent::create(state.errorMessage,
|
| - state.m_location->clone(), m_world.get());
|
| + } else {
|
| + event =
|
| + ErrorEvent::create(state.errorMessage, state.m_location->clone(),
|
| + m_world.get(), state.exception);
|
| + }
|
| m_globalScope->dispatchErrorEvent(event, NotSharableCrossOrigin);
|
| }
|
| return false;
|
|
|