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
There seems to be a bug that's reproduceable when you have a loop (for or while) and an async closure inside of it (defined using async await) that has access to a value that's scoped outside of the closure but inside of the loop.
I've tried it on rescript 10.1.4 and 11.0.0-rc.4 and both yield a javascript function where the await keyword is used inside of a non-async function.
//Demo.bs.js compiled js file:// Generated by ReScript, PLEASE EDIT WITH CAREasyncfunctiontopLevelAsyncFunction(){for(varinnerScopeVal=0;innerScopeVal<=3;++innerScopeVal){varasyncClosureAccessingScopedVal=(asyncfunction(innerScopeVal){returnfunctionasyncClosureAccessingScopedVal(){console.log("Accessing scoped var inside loop",innerScopeVal);returnawaitPromise.resolve(undefined);/***<-- HERE it is using "await" keyword inside non async function ***/}}(innerScopeVal));awaitasyncClosureAccessingScopedVal(undefined);}}export{topLevelAsyncFunction,}/* No side effect */
The text was updated successfully, but these errors were encountered:
There seems to be a bug that's reproduceable when you have a loop (for or while) and an async closure inside of it (defined using async await) that has access to a value that's scoped outside of the closure but inside of the loop.
I've tried it on rescript 10.1.4 and 11.0.0-rc.4 and both yield a javascript function where the await keyword is used inside of a non-async function.
The text was updated successfully, but these errors were encountered: