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
Linux 176bea3b1763 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 GNU/Linux
Subsystem
vm
What steps will reproduce the bug?
$ node
Welcome to Node.js v16.13.0.
Type ".help" for more information.
> vm.runInThisContext("await 42")
evalmachine.<anonymous>:1
await 42
^^^^^
Uncaught:
SyntaxError: await is only valid in async functions and the top level bodies of modules
>
How often does it reproduce? Is there a required condition?
always
What is the expected behavior?
Some output as running await 42.
What do you see instead?
$ node
Welcome to Node.js v16.13.0.
Type ".help" for more information.
> await 42
42
>
Additional information
No response
The text was updated successfully, but these errors were encountered:
vm.runInThisContext runs a script and therefore does not support top level await. if you want to use that you'll need to use the experimental vm.Module api. the repl is just transpiling code with top level await into async functions.
Version
v16.13.0
Platform
Linux 176bea3b1763 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 GNU/Linux
Subsystem
vm
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
always
What is the expected behavior?
Some output as running
await 42
.What do you see instead?
Additional information
No response
The text was updated successfully, but these errors were encountered: