You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run the code: (async () => { let x = true; let c = 0; try { while (x) { x = false; await Promise.resolve(); } } finally { console.log("Count" + ++c); } })();
The expected output is: Count1
What I got: Count1 Count2.
From some reason the 'finally' called two times after end of loop.
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Describe the bug
When I run the code:
(async () => { let x = true; let c = 0; try { while (x) { x = false; await Promise.resolve(); } } finally { console.log("Count" + ++c); } })();
The expected output is:
Count1
What I got:
Count1 Count2
.From some reason the 'finally' called two times after end of loop.
link: https://play.swc.rs/?version=1.3.44&code=H4sIAAAAAAAAA02NTQrCMBCF94J3eHSVECjdS914Aa8QwlQDYwJJalskdze2xvpWMx%2FvB0LHxRkIif6M1%2FGAIqaEGT1SGOm0I1NQ9%2F1TWKobmO6WCWKWO8JaMGiOteEjPWmbcA3%2BYSO1gaLnJwn5c%2BTtyBis08x%2FE8a7YqaW%2FU00Fz%2B61EBBKVPDazTLUvYGez%2FLGdMAAAA%3D&config=H4sIAAAAAAAAA1WPSw7DIAwF9zkF8rrbdtE79BAWdSIifrKJVBTl7iUE0maH3xsz8jooBbNoeKq1PMsQkYX4nEsi2Sf8lARIOxTNJia49XaWvRrRCtVoOxpIyBOluiX3hoMNQajjLXPGmzH%2FC3VwkUnkCu4o%2BsnSVTc0JbjwXmrZDkk50qF%2FwA%2FqsvNjMPLqm4kXGrYvhlQioBQBAAA%3D
thanks.
Input code
Config
Playground link
https://play.swc.rs/?version=1.3.44&code=H4sIAAAAAAAAA02NTQrCMBCF94J3eHSVECjdS914Aa8QwlQDYwJJalskdze2xvpWMx%2FvB0LHxRkIif6M1%2FGAIqaEGT1SGOm0I1NQ9%2F1TWKobmO6WCWKWO8JaMGiOteEjPWmbcA3%2BYSO1gaLnJwn5c%2BTtyBis08x%2FE8a7YqaW%2FU00Fz%2B61EBBKVPDazTLUvYGez%2FLGdMAAAA%3D&config=H4sIAAAAAAAAA1WPSw7DIAwF9zkF8rrbdtE79BAWdSIifrKJVBTl7iUE0maH3xsz8jooBbNoeKq1PMsQkYX4nEsi2Sf8lARIOxTNJia49XaWvRrRCtVoOxpIyBOluiX3hoMNQajjLXPGmzH%2FC3VwkUnkCu4o%2BsnSVTc0JbjwXmrZDkk50qF%2FwA%2FqsvNjMPLqm4kXGrYvhlQioBQBAAA%3D
Expected behavior
To execute finally statement once after loop
Actual behavior
No response
Version
1.3.44
Additional context
No response
The text was updated successfully, but these errors were encountered: