Bug 289430

Summary: [JSC] `Set#union` and `Set#synmmetric` should get `next` before cloning `this`
Product: WebKit Reporter: Sosuke Suzuki <aosukeke>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   

Sosuke Suzuki
Reported 2025-03-09 07:32:55 PDT
According to the spec[1][2], `Set#symmetricDifference` and `Set#union` get keys iterator's `next` method via `GetIteratorFromMethod`[3] and `GetIteratorDirect`[4] before cloning `this`. However, the current JSC implementation don't get it. Getting `next` method can occur observable side effects, so we need to fix it. [1]: https://tc39.es/ecma262/#sec-set.prototype.symmetricdifference [2]: https://tc39.es/ecma262/#sec-set.prototype.union [3]: https://tc39.es/ecma262/#sec-getiteratorfrommethod [4]: https://tc39.es/ecma262/#sec-getiteratordirect
Attachments
Sosuke Suzuki
Comment 1 2025-03-09 07:34:13 PDT
EWS
Comment 2 2025-03-09 20:16:40 PDT
Committed 291875@main (b07e269b5a00): <https://commits.webkit.org/291875@main> Reviewed commits have been landed. Closing PR #42158 and removing active labels.
Radar WebKit Bug Importer
Comment 3 2025-03-09 20:17:13 PDT
Note You need to log in before you can comment on or make changes to this bug.