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
Is your feature request related to a problem? Please describe.
I have a script that I made that allows me to use await but I keep having to wrap it:
return(async()=>{varresult=await ... });
Then I have to do this, which seems silly:
But if .run() already returns a promise, when why am I not able to use 'await' in the script body? Seems the code is node being run in an async function even though a promise is being used.
Describe the solution you'd like
Be consistent, if .run() returns a promise, allow await operators in the script body by using async functions.
Describe alternatives you've considered
One ay is to run sync code to run async, so
Is your feature request related to a problem? Please describe.
I have a script that I made that allows me to use await but I keep having to wrap it:
Then I have to do this, which seems silly:
![Image](https://private-user-images.githubusercontent.com/2531435/409792860-de2a642b-79dc-44da-8b30-161e6aac5f1d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNjgyODUsIm5iZiI6MTczOTM2Nzk4NSwicGF0aCI6Ii8yNTMxNDM1LzQwOTc5Mjg2MC1kZTJhNjQyYi03OWRjLTQ0ZGEtOGIzMC0xNjFlNmFhYzVmMWQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTJUMTM0NjI1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTc1ZGZlMjExNTJiOTIzODRlNWM1OWNkZWQwYmFlMjhkMTRmYjc1ZmU2MTdlNWFmNzdhZDc0Mjc3MGViNWZhNyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.AzkM6Zf9oyEN44dstx16WJ05iWohixyibWd876TM3yY)
But if .run() already returns a promise, when why am I not able to use 'await' in the script body? Seems the code is node being run in an async function even though a promise is being used.
Describe the solution you'd like
Be consistent, if
.run()
returns a promise, allow await operators in the script body by using async functions.Describe alternatives you've considered
One ay is to run sync code to run async, so
Which is just silly, since
.run()
runs it async anyhow. Also, that way is no good if you want to return a value.The best alternative way that works so far:
Seems if I return a promise at least the system detects it and that works for now.
The text was updated successfully, but these errors were encountered: