RESOLVED FIXED 189799
[JSC] ForStatement should call CreatePerIterationEnvironment before first iteration
https://bugs.webkit.org/show_bug.cgi?id=189799
Summary [JSC] ForStatement should call CreatePerIterationEnvironment before first ite...
Dasa Paddock
Reported 2018-09-20 12:56:54 PDT
Test code: let callback1; let callbacks2 = new Array(); let callbacks3 = new Array(); for ( let i = (callback1 = () => i, 0); callbacks2.push(() => i), i < 5; callbacks3.push(() => i), i++) { // loop body i++; } console.log(callback1()); console.log(callbacks2[0]()); console.log(callbacks3[0]()); Expected output (works in Chrome and Firefox) 0 1 3 Actual output in Safari TP 65: 1 1 3 Note: I found this test code at: https://github.com/Microsoft/TypeScript/issues/17632
Attachments
Radar WebKit Bug Importer
Comment 1 2018-09-24 10:36:03 PDT
Saam Barati
Comment 2 2018-09-24 11:19:26 PDT
Thanks for the report. It looks like Chrome and Firefox are correct w.r.t the spec: https://tc39.github.io/ecma262/#sec-for-statement-runtime-semantics-labelledevaluation
Rick Waldron
Comment 3 2020-09-03 06:25:42 PDT
Dasa Paddock
Comment 4 2022-02-09 13:45:29 PST
I'm not sure when this was fixed, but I'm unable to repro in Safari 15.3.
Dasa Paddock
Comment 5 2022-02-09 13:48:37 PST
Sorry for the noise, this is still broken in Safari 15.3 and Safari TP 139.
Dasa Paddock
Comment 6 2023-08-22 17:09:49 PDT
This is still broken in Safari TP 177.
Alexey Shvayka
Comment 7 2023-10-11 16:53:22 PDT
*** Bug 257677 has been marked as a duplicate of this bug. ***
Alexey Shvayka
Comment 8 2023-10-22 16:03:56 PDT
EWS
Comment 9 2023-10-23 10:32:43 PDT
Committed 269653@main (f32cd0f7cb79): <https://commits.webkit.org/269653@main> Reviewed commits have been landed. Closing PR #19403 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.