Index: Source/core/dom/ExecutionContext.cpp |
diff --git a/Source/core/dom/ExecutionContext.cpp b/Source/core/dom/ExecutionContext.cpp |
index 4ec9a88c8031b8d3d83268850358998f581dc5d5..528a6a80de560d822c2f1b3525be692a367a9ea2 100644 |
--- a/Source/core/dom/ExecutionContext.cpp |
+++ b/Source/core/dom/ExecutionContext.cpp |
@@ -132,7 +132,7 @@ bool ExecutionContext::shouldSanitizeScriptError(const String& sourceURL, Access |
return !(securityOrigin()->canRequest(completeURL(sourceURL)) || corsStatus == SharableCrossOrigin); |
} |
-void ExecutionContext::reportException(PassRefPtrWillBeRawPtr<ErrorEvent> event, int scriptId, PassRefPtrWillBeRawPtr<ScriptCallStack> callStack, AccessControlStatus corsStatus) |
+void ExecutionContext::reportException(PassRefPtrWillBeRawPtr<ErrorEvent> event, int scriptId, PassRefPtrWillBeRawPtr<ScriptCallStack> callStack, AccessControlStatus corsStatus, bool isPromiseReject) |
{ |
RefPtrWillBeRawPtr<ErrorEvent> errorEvent = event; |
if (m_inDispatchErrorEvent) { |
@@ -143,7 +143,8 @@ void ExecutionContext::reportException(PassRefPtrWillBeRawPtr<ErrorEvent> event, |
} |
// First report the original exception and only then all the nested ones. |
- if (!dispatchErrorEvent(errorEvent, corsStatus)) |
+ // FIXME: Do not dispatch uncaught Promise rejects until the window.onerror spec is finalized. |
+ if (isPromiseReject || !dispatchErrorEvent(errorEvent, corsStatus)) |
logExceptionToConsole(errorEvent->messageForConsole(), scriptId, errorEvent->filename(), errorEvent->lineno(), errorEvent->colno(), callStack); |
if (!m_pendingExceptions) |