Open
Description
Describe the bug
Currently, bundle-source
(via @endo/module-source
) will happily generate a bundle where a module contains a top-level-await which defers a SyntaxError to runtime, since the enclosing function is not async
.
Steps to reproduce
bundle-source entry.mjs
where entry.mjs
is await null
, then run this bundle with importBundle
.
Expected behavior
bundle-source
should balk because ModuleSource
throws a user-meaningful exception like “Endo emulated ModuleSource does not yet support top-level-await”.
Platform environment
Endo at 271aa92