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

Changeset 285747 in webkit


Ignore:
Timestamp:
Nov 12, 2021, 3:17:17 PM (5 years ago)
Author:
Chris Dumez
Message:

Crash when accessing reason property of a newly created AbortSignal
https://bugs.webkit.org/show_bug.cgi?id=233066
<rdar://problem/85249306>

Reviewed by Geoffrey Garen.

Source/WebCore:

Make sure AbortSignal.reason get initialized to jsUndefined() by default
and not a default-constructed JSValue.

Test: fast/dom/AbortSignal-reason-crash.html

  • dom/AbortSignal.cpp:

(WebCore::AbortSignal::AbortSignal):

  • dom/AbortSignal.h:

LayoutTests:

Add layout test coverage.

  • fast/dom/AbortSignal-reason-crash-expected.txt: Added.
  • fast/dom/AbortSignal-reason-crash.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r285745 r285747  
     12021-11-12  Chris Dumez  <cdumez@apple.com>
     2
     3        Crash when accessing reason property of a newly created AbortSignal
     4        https://bugs.webkit.org/show_bug.cgi?id=233066
     5        <rdar://problem/85249306>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Add layout test coverage.
     10
     11        * fast/dom/AbortSignal-reason-crash-expected.txt: Added.
     12        * fast/dom/AbortSignal-reason-crash.html: Added.
     13
    1142021-11-12  Ryan Haddad  <ryanhaddad@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r285745 r285747  
     12021-11-12  Chris Dumez  <cdumez@apple.com>
     2
     3        Crash when accessing reason property of a newly created AbortSignal
     4        https://bugs.webkit.org/show_bug.cgi?id=233066
     5        <rdar://problem/85249306>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Make sure AbortSignal.reason get initialized to jsUndefined() by default
     10        and not a default-constructed JSValue.
     11
     12        Test: fast/dom/AbortSignal-reason-crash.html
     13
     14        * dom/AbortSignal.cpp:
     15        (WebCore::AbortSignal::AbortSignal):
     16        * dom/AbortSignal.h:
     17
    1182021-11-12  Ryan Haddad  <ryanhaddad@apple.com>
    219
  • trunk/Source/WebCore/dom/AbortSignal.cpp

    r285428 r285747  
    5858    , m_reason(reason)
    5959{
     60    ASSERT(reason);
    6061}
    6162
  • trunk/Source/WebCore/dom/AbortSignal.h

    r285428 r285747  
    6565private:
    6666    enum class Aborted : bool { No, Yes };
    67     explicit AbortSignal(ScriptExecutionContext&, Aborted = Aborted::No, JSC::JSValue reason = { });
     67    explicit AbortSignal(ScriptExecutionContext&, Aborted = Aborted::No, JSC::JSValue reason = JSC::jsUndefined());
    6868
    6969    // EventTarget.
Note: See TracChangeset for help on using the changeset viewer.