Changeset 278763 in webkit


Ignore:
Timestamp:
Jun 11, 2021 9:15:18 AM (13 months ago)
Author:
achristensen@apple.com
Message:

EventSource.constructor throws an exception when the url param is an empty string
https://bugs.webkit.org/show_bug.cgi?id=226635

Reviewed by Yusuke Suzuki.

Source/WebCore:

  • page/EventSource.cpp:

(WebCore::EventSource::create):

LayoutTests:

  • fast/eventsource/eventsource-constructor-expected.txt:
  • fast/eventsource/eventsource-constructor.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r278757 r278763  
     12021-06-11  Alex Christensen  <achristensen@webkit.org>
     2
     3        EventSource.constructor throws an exception when the url param is an empty string
     4        https://bugs.webkit.org/show_bug.cgi?id=226635
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * fast/eventsource/eventsource-constructor-expected.txt:
     9        * fast/eventsource/eventsource-constructor.html:
     10
    1112021-06-11  Diego Pino Garcia  <dpino@igalia.com>
    212
  • trunk/LayoutTests/fast/eventsource/eventsource-constructor-expected.txt

    r219663 r278763  
    22
    33PASS: missing argument to EventSource constructor resulted in an exception (TypeError: Not enough arguments)
    4 PASS: passing an empty string to the EventSource constructor resulted in an exception (SyntaxError: The string did not match the expected pattern.)
     4PASS: no exception when passing an empty string to the EventSource constructor
    55PASS: passing an invalid URL to the EventSource constructor resulted in an exception (SyntaxError: The string did not match the expected pattern.)
    66PASS: no exception when passing a second argument to the EventSource constructor
  • trunk/LayoutTests/fast/eventsource/eventsource-constructor.html

    r138083 r278763  
    2323try {
    2424    new EventSource("");
    25     log("FAIL: no exception when passing an empty string to the EventSource constructor");
     25    log("PASS: no exception when passing an empty string to the EventSource constructor");
    2626}
    2727catch (ex) {
    28     log("PASS: passing an empty string to the EventSource constructor resulted in an exception (" + ex + ")");
     28    log("FAIL: passing an empty string to the EventSource constructor resulted in an exception (" + ex + ")");
    2929}
    3030
  • trunk/Source/WebCore/ChangeLog

    r278758 r278763  
     12021-06-11  Alex Christensen  <achristensen@webkit.org>
     2
     3        EventSource.constructor throws an exception when the url param is an empty string
     4        https://bugs.webkit.org/show_bug.cgi?id=226635
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * page/EventSource.cpp:
     9        (WebCore::EventSource::create):
     10
    1112021-06-11  Adrian Perez de Castro  <aperez@igalia.com>
    212
  • trunk/Source/WebCore/page/EventSource.cpp

    r278516 r278763  
    6767ExceptionOr<Ref<EventSource>> EventSource::create(ScriptExecutionContext& context, const String& url, const Init& eventSourceInit)
    6868{
    69     if (url.isEmpty())
    70         return Exception { SyntaxError };
    71 
    7269    URL fullURL = context.completeURL(url);
    7370    if (!fullURL.isValid())
Note: See TracChangeset for help on using the changeset viewer.