| Summary: | CountQueuingStrategy.constructor misses checking the type of init param | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | zyscoder <zyscoder> | ||||||
| Component: | WebKit Misc. | Assignee: | youenn fablet <youennf> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | achristensen, benjamin, calvaris, cdumez, ews-watchlist, joepeck, sam, webkit-bug-importer, youennf | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Local Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Linux | ||||||||
| Attachments: |
|
||||||||
Created attachment 430947 [details]
Patch
Comment on attachment 430947 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=430947&action=review > Source/WebCore/Modules/streams/CountQueuingStrategy.js:44 > + value: @toNumber(parameters.highWaterMark), Likely not a good idea to access parameters.highWaterMark twice as it is web observable and it could return different values for each call. I think it'd be better to cache the result of parameters.highWaterMark. Created attachment 431053 [details]
Patch
Comment on attachment 431053 [details]
Patch
AS debug wk2 error is unrelated
Committed r278710 (238678@main): <https://commits.webkit.org/238678@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 431053 [details]. |
Steps to reproduce: (1) Open a tab and navigate to any URL; (2) Run the following code in the Console of Devtools: ``` new CountQueuingStrategy('any'); ``` (3) Then this code would be evaluated successfully without throwing any exceptions. Actual results: Then this code would be evaluated successfully without throwing any exceptions. Expected results: As https://streams.spec.whatwg.org/#cqs-constructor says, the init param is of {highWaterMark: double} type. Webkit should throw a TypeError exception when evaluating this code. In my test, Chrome and Firefox throw exceptions: Chrome: `TypeError: Failed to construct 'CountQueuingStrategy': cannot convert to dictionary` Firefox: `'highWaterMark' must not be undefined.`