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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp

Issue 2804533002: Update Error Event inside a worker to provide the exact exception value (Closed)
Patch Set: Created 3 years, 8 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
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;

Powered by Google App Engine
This is Rietveld 408576698