Bug 291651
Summary: | [JSC] Iterator.prototype.reduce fails with `undefined` initial parameter | ||
---|---|---|---|
Product: | WebKit | Reporter: | marcel laverdet <marcel.webkit> |
Component: | JavaScriptCore | Assignee: | Yusuke Suzuki <ysuzuki> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | keith_miller, webkit-bug-importer, ysuzuki |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 18 | ||
Hardware: | All | ||
OS: | macOS 15 |
marcel laverdet
The specification for this function is pretty cut and dry. "Not present" is not the same as `undefined`.
> Iterator.from([]).reduce(() => false, undefined)
TypeError: Iterator.prototype.reduce requires an initial value or an iterator that is not done.
Chrome agrees that the result of this expression is `undefined`.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/149470140>
Yusuke Suzuki
Pull request: https://github.com/WebKit/WebKit/pull/44190
EWS
Committed 293797@main (cc66425b1afa): <https://commits.webkit.org/293797@main>
Reviewed commits have been landed. Closing PR #44190 and removing active labels.