⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286840 in webkit


Ignore:
Timestamp:
Dec 10, 2021, 2:30:48 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Handle TerminationException in WebCore::ReadableStream::create()
https://bugs.webkit.org/show_bug.cgi?id=233061

Patch by Frederic Wang <fwang@igalia.com> on 2021-12-10
Reviewed by Darin Adler.

Source/WebCore:

Test: streams/readable-stream-create-after-worker-terminates-crash.html

  • bindings/js/ReadableStream.cpp:

(WebCore::ReadableStream::create): Do not try immediately casting the constructor value to an
object, since it is undefined when a termination exception is thrown.

LayoutTests:

Add non-regression test.

  • streams/readable-stream-create-after-worker-terminates-crash-expected.txt: Added.
  • streams/readable-stream-create-after-worker-terminates-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r286836 r286840  
     12021-12-10  Frederic Wang  <fwang@igalia.com>
     2
     3        Handle TerminationException in WebCore::ReadableStream::create()
     4        https://bugs.webkit.org/show_bug.cgi?id=233061
     5
     6        Reviewed by Darin Adler.
     7
     8        Add non-regression test.
     9
     10        * streams/readable-stream-create-after-worker-terminates-crash-expected.txt: Added.
     11        * streams/readable-stream-create-after-worker-terminates-crash.html: Added.
     12
    1132021-12-09  Antoine Quint  <graouts@webkit.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r286838 r286840  
     12021-12-10  Frederic Wang  <fwang@igalia.com>
     2
     3        Handle TerminationException in WebCore::ReadableStream::create()
     4        https://bugs.webkit.org/show_bug.cgi?id=233061
     5
     6        Reviewed by Darin Adler.
     7
     8        Test: streams/readable-stream-create-after-worker-terminates-crash.html
     9
     10        * bindings/js/ReadableStream.cpp:
     11        (WebCore::ReadableStream::create): Do not try immediately casting the constructor value to an
     12        object, since it is undefined when a termination exception is thrown.
     13
    1142021-12-10  Kimmo Kinnunen  <kkinnunen@apple.com>
    215
  • trunk/Source/WebCore/bindings/js/ReadableStream.cpp

    r284861 r286840  
    4646    auto& globalObject = *JSC::jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject);
    4747
    48     auto* constructor = JSC::asObject(globalObject.get(&lexicalGlobalObject, clientData.builtinNames().ReadableStreamPrivateName()));
     48    auto constructorValue = globalObject.get(&lexicalGlobalObject, clientData.builtinNames().ReadableStreamPrivateName());
    4949    RETURN_IF_EXCEPTION(scope, Exception { ExistingExceptionError });
     50    auto constructor = JSC::asObject(constructorValue);
    5051
    5152    auto constructData = getConstructData(vm, constructor);
Note: See TracChangeset for help on using the changeset viewer.