WebKit Bugzilla
Attachment 347076 Details for
Bug 188551
: Unhandled Promise Rejection logging in workers should not emit ErrorEvent to host Worker object
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188551-20180815000312.patch (text/plain), 9.28 KB, created by
Yusuke Suzuki
on 2018-08-14 08:03:13 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2018-08-14 08:03:13 PDT
Size:
9.28 KB
patch
obsolete
>Subversion Revision: 234846 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index cf872ff87eb541e09dbd94a8c225dddf4722ab3f..c78088f0a3883ede6a37acbcaf4228d54e8757c5 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,17 @@ >+2018-08-14 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ Unhandled Promise Rejection logging in workers should not emit ErrorEvent to host Worker object >+ https://bugs.webkit.org/show_bug.cgi?id=188551 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Previously we dispatched ErrorEvent on the Worker object of the host side when the unhandled promise >+ rejection happens in the worker. But that was wrong. We should not dispatch such an event and we >+ should just log the error message. >+ >+ * dom/ScriptExecutionContext.cpp: >+ (WebCore::ScriptExecutionContext::reportUnhandledPromiseRejection): >+ > 2018-08-14 Yusuke Suzuki <yusukesuzuki@slowstart.org> > > Worker should support unhandled promise rejections >diff --git a/Source/WebCore/dom/ScriptExecutionContext.cpp b/Source/WebCore/dom/ScriptExecutionContext.cpp >index ca795c991ddec0a62725019187c221284c327f49..dbe898f118252f3b23ac720db743c75cf4fbbff5 100644 >--- a/Source/WebCore/dom/ScriptExecutionContext.cpp >+++ b/Source/WebCore/dom/ScriptExecutionContext.cpp >@@ -393,22 +393,15 @@ void ScriptExecutionContext::reportUnhandledPromiseRejection(JSC::ExecState& sta > JSC::VM& vm = state.vm(); > auto scope = DECLARE_CATCH_SCOPE(vm); > >- int lineNumber = 0; >- int columnNumber = 0; >- String sourceURL; >- > JSC::JSValue result = promise.result(vm); > String resultMessage = retrieveErrorMessage(state, vm, result, scope); > String errorMessage = makeString("Unhandled Promise Rejection: ", resultMessage); >- if (callStack) { >- if (const ScriptCallFrame* callFrame = callStack->firstNonNativeCallFrame()) { >- lineNumber = callFrame->lineNumber(); >- columnNumber = callFrame->columnNumber(); >- sourceURL = callFrame->sourceURL(); >- } >- } >- >- logExceptionToConsole(errorMessage, sourceURL, lineNumber, columnNumber, WTFMove(callStack)); >+ std::unique_ptr<Inspector::ConsoleMessage> message; >+ if (callStack) >+ message = std::make_unique<Inspector::ConsoleMessage>(MessageSource::JS, MessageType::Log, MessageLevel::Error, errorMessage, callStack.releaseNonNull()); >+ else >+ message = std::make_unique<Inspector::ConsoleMessage>(MessageSource::JS, MessageType::Log, MessageLevel::Error, errorMessage); >+ addConsoleMessage(WTFMove(message)); > } > > void ScriptExecutionContext::addConsoleMessage(MessageSource source, MessageLevel level, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, JSC::ExecState* state, unsigned long requestIdentifier) >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 85872cbed6aff94ba99823e115f2dde00e5c22bb..afade5db6cc4d45eedce088fa60fde0eae5149f6 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2018-08-14 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ Unhandled Promise Rejection logging in workers should not emit ErrorEvent to host Worker object >+ https://bugs.webkit.org/show_bug.cgi?id=188551 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * http/wpt/workers/promise-unhandled-rejection.any.worker-expected.txt: >+ * js/dom/unhandled-promise-rejection-bindings-type-error-in-workers-expected.txt: >+ > 2018-08-14 Yusuke Suzuki <yusukesuzuki@slowstart.org> > > Worker should support unhandled promise rejections >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index c83a9299bf284ca55cec729843721b13e6ecf2e5..287375165d3a130b29a31bcdc53257842f4606d6 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,14 @@ >+2018-08-14 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ Unhandled Promise Rejection logging in workers should not emit ErrorEvent to host Worker object >+ https://bugs.webkit.org/show_bug.cgi?id=188551 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * web-platform-tests/WebCryptoAPI/derive_bits_keys/ecdh_bits.https.worker-expected.txt: >+ * web-platform-tests/WebCryptoAPI/derive_bits_keys/ecdh_keys.https.worker-expected.txt: >+ * web-platform-tests/streams/readable-streams/tee.dedicatedworker-expected.txt: >+ > 2018-08-14 Yusuke Suzuki <yusukesuzuki@slowstart.org> > > Worker should support unhandled promise rejections >diff --git a/LayoutTests/http/wpt/workers/promise-unhandled-rejection.any.worker-expected.txt b/LayoutTests/http/wpt/workers/promise-unhandled-rejection.any.worker-expected.txt >index 81a5153b23f988c805ebf25f88be233d2242ce0f..6e4a34d05bcfdf60f0e293eae8609dece73b3063 100644 >--- a/LayoutTests/http/wpt/workers/promise-unhandled-rejection.any.worker-expected.txt >+++ b/LayoutTests/http/wpt/workers/promise-unhandled-rejection.any.worker-expected.txt >@@ -1,5 +1,3 @@ >-CONSOLE MESSAGE: line 1774: TypeError: null is not an object (evaluating 'this.message_target.removeEventListener') >-CONSOLE MESSAGE: Unhandled Promise Rejection: Reject > > Harness Error (FAIL), message = undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/ecdh_bits.https.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/ecdh_bits.https.worker-expected.txt >index b3f3549c81bbf6283aaae77cb96dad847129af85..188b1188abb3a99862f0367b20597a76cbbc5f4d 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/ecdh_bits.https.worker-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/ecdh_bits.https.worker-expected.txt >@@ -1,5 +1,3 @@ >-CONSOLE MESSAGE: line 1774: TypeError: null is not an object (evaluating 'this.message_target.removeEventListener') >-CONSOLE MESSAGE: line 198: Unhandled Promise Rejection: DataError: Data provided to an operation does not meet requirements > > FAIL Untitled Data provided to an operation does not meet requirements > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/ecdh_keys.https.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/ecdh_keys.https.worker-expected.txt >index 69c1f0a77ead9fa683e3af21d9513b2819829df1..188b1188abb3a99862f0367b20597a76cbbc5f4d 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/ecdh_keys.https.worker-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/ecdh_keys.https.worker-expected.txt >@@ -1,5 +1,3 @@ >-CONSOLE MESSAGE: line 1774: TypeError: null is not an object (evaluating 'this.message_target.removeEventListener') >-CONSOLE MESSAGE: line 167: Unhandled Promise Rejection: DataError: Data provided to an operation does not meet requirements > > FAIL Untitled Data provided to an operation does not meet requirements > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/tee.dedicatedworker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/tee.dedicatedworker-expected.txt >index 0563a2ed1b6d4b17779de5d87d549826f9db8980..e03a5c2183c845526d1b0b2f9a7ea433981d3d5d 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/tee.dedicatedworker-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/tee.dedicatedworker-expected.txt >@@ -1,11 +1,3 @@ >-CONSOLE MESSAGE: line 1774: TypeError: null is not an object (evaluating 'this.message_target.removeEventListener') >-CONSOLE MESSAGE: Unhandled Promise Rejection: [object Object] >-CONSOLE MESSAGE: line 1774: TypeError: null is not an object (evaluating 'this.message_target.removeEventListener') >-CONSOLE MESSAGE: Unhandled Promise Rejection: [object Object] >-CONSOLE MESSAGE: line 1774: TypeError: null is not an object (evaluating 'this.message_target.removeEventListener') >-CONSOLE MESSAGE: Unhandled Promise Rejection: [object Object] >-CONSOLE MESSAGE: line 1774: TypeError: null is not an object (evaluating 'this.message_target.removeEventListener') >-CONSOLE MESSAGE: Unhandled Promise Rejection: [object Object] > > PASS ReadableStream teeing: rs.tee() returns an array of two ReadableStreams > PASS ReadableStream teeing: should be able to read one branch to the end without affecting the other >diff --git a/LayoutTests/js/dom/unhandled-promise-rejection-bindings-type-error-in-workers-expected.txt b/LayoutTests/js/dom/unhandled-promise-rejection-bindings-type-error-in-workers-expected.txt >index 47c48bbe68b6e2e1d69dfca8503e88e6ddc820ba..127fa6f2fce46febdbcd6709c105aa44f835a142 100644 >--- a/LayoutTests/js/dom/unhandled-promise-rejection-bindings-type-error-in-workers-expected.txt >+++ b/LayoutTests/js/dom/unhandled-promise-rejection-bindings-type-error-in-workers-expected.txt >@@ -5,7 +5,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE > Starting worker: ../resources/unhandled-promise-rejection-bindings-type-error-in-workers.js > PASS [Worker] error.promise is promise > PASS [Worker] error.reason instanceof TypeError is true >-Got error from worker: Unhandled Promise Rejection: TypeError: The PromiseRejectionEvent.promise getter can only be used on instances of PromiseRejectionEvent > PASS successfullyParsed is true > > TEST COMPLETE
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
youennf
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188551
:
347071
|
347073
|
347074
|
347075
| 347076