A file deadlock.mjs
with this in it:
await new Promise(function(resolve) {});
will run and immediately end giving an exit code of 13. I would've expected this program to hang forever.
await new Promise(function(resolve) {resolve()});
unsurprisingly ends immediately and gives a 0 exit code.
Why doesn't the first program deadlock? And what is the significance of exit code 13?