deasync-promise
deasync-promise copied to clipboard
Crashes the repl
I'm trying to use this module to work around a limitation in WebStorm: it doesn't allow top-level await.
aawait.mjs
import aawait from 'deasync-promise';
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
debugger;
aawait(sleep(1000));

Note how the repl> prompt turns into debug>.
In WebStorm, this manifests through a SIGSEV:

Hi, @dandv. Please, provide the following details to reproduce the bug: Steps to reproduce, Expected result, Actual result, Environment