Bug 226586 - Request.constructor misses checking for the type of init.signal param
Summary: Request.constructor misses checking for the type of init.signal param
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-06-03 08:15 PDT by zyscoder@gmail.com
Modified: 2021-06-10 08:16 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zyscoder@gmail.com 2021-06-03 08:15:56 PDT
Steps to reproduce:

(1) Open a tab and navigate to any URL;
(2) Run the following code in the Console of Devtools:
```
new Request('', {signal:{}})
```
(3) Then this code would be evaluated successfully without throwing any exception. Only a warning is asserted.

Actual results:

This code would be evaluated successfully without throwing any exception. Only a warning is asserted.

Expected results:

As https://fetch.spec.whatwg.org/#requestinfo says, the init.signal param is of AbortSignal type. Since the code above sets the input param as {}, a TypeError exception should be thrown. (Just behave as what the warning says.)

BTW, in my test both Chrome and Firefox throw exceptions when evaluating this code.
Comment 1 youenn fablet 2021-06-07 01:35:35 PDT
See https://bugs.webkit.org/show_bug.cgi?id=199576 for some background info on why it is difficult to make it throw.
@zyscoder, what is the impact of not throwing here for you?
Comment 2 Radar WebKit Bug Importer 2021-06-10 08:16:18 PDT
<rdar://problem/79140275>