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
"Impossible" is logged, because the break statement seems to short-circuit the inner loop
🙂 Expected behavior
"Success" is logged, because the break statement should short-circuit the outer block
Interestingly, it does seem to handle breaking from outer loops (eg adding a superfluous loop, tmp: for (let nvm = 0; nvm < 1; nvm++) ...), but not plain blocks.
The text was updated successfully, but these errors were encountered:
The code above should be statically known to log Success, since the await never actually happens. The generated code instead jumps to the Impossible branch.
Bug Report
When using the "ES5" target,
async
/await
code generation does not correctly handle breaking from labelled blocks.🔎 Search Terms
break block label async
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
Compiler options:
--lib ES2015,dom --target ES5
🙁 Actual behavior
"Impossible" is logged, because the
break
statement seems to short-circuit the inner loop🙂 Expected behavior
"Success" is logged, because the
break
statement should short-circuit the outer blockInterestingly, it does seem to handle breaking from outer loops (eg adding a superfluous loop,
tmp: for (let nvm = 0; nvm < 1; nvm++) ...
), but not plain blocks.The text was updated successfully, but these errors were encountered: