[webkit-reviews] review granted: [Bug 223777] Handle OOM in ScriptExecutionContext::reportUnhandledPromiseRejection : [Attachment 425199] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Apr 5 13:55:36 PDT 2021
Yusuke Suzuki <ysuzuki at apple.com> has granted Tadeu Zagallo
<tzagallo at apple.com>'s request for review:
Bug 223777: Handle OOM in
ScriptExecutionContext::reportUnhandledPromiseRejection
https://bugs.webkit.org/show_bug.cgi?id=223777
Attachment 425199: Patch
https://bugs.webkit.org/attachment.cgi?id=425199&action=review
--- Comment #5 from Yusuke Suzuki <ysuzuki at apple.com> ---
Comment on attachment 425199
--> https://bugs.webkit.org/attachment.cgi?id=425199
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=425199&action=review
r=me
> Source/WebCore/dom/ScriptExecutionContext.cpp:408
> + if (resultMessage.is8Bit())
> + return tryMakeString("Unhandled Promise Rejection: ", StringView
{ resultMessage.characters8(), length }, addEllipsis ? "..." : "");
> + return tryMakeString("Unhandled Promise Rejection: ", StringView {
resultMessage.characters16(), length }, addEllipsis ? "..." : "");
We can write
StringView(resultMessage).left(length)
> Source/WebCore/dom/ScriptExecutionContext.cpp:420
> + errorMessage = "Unhandled Promise Rejection";
Let's use "Unhandled Promise Rejection"_s so that we can avoid allocation for
string storage.
More information about the webkit-reviews
mailing list