Bug 291651

Summary: [JSC] Iterator.prototype.reduce fails with `undefined` initial parameter
Product: WebKit Reporter: marcel laverdet <marcel.webkit>
Component: JavaScriptCoreAssignee: 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
Reported 2025-04-16 15:39:56 PDT
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
Radar WebKit Bug Importer
Comment 1 2025-04-17 05:07:10 PDT
Yusuke Suzuki
Comment 2 2025-04-17 05:08:42 PDT
EWS
Comment 3 2025-04-17 08:42:50 PDT
Committed 293797@main (cc66425b1afa): <https://commits.webkit.org/293797@main> Reviewed commits have been landed. Closing PR #44190 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.