Open mbostock opened 2 months ago
Currently the above is translated into (approximately):
const {doesNotExist} = await import("./_import/module.js");
We’ll need to do something like this instead:
const $module = await import("./_import/module.js");
if (!("doesNotExist" in $module)) throw new SyntaxError("The requested module './module.js' does not provide an export named 'doesNotExist'");
const {doesNotExist} = $module;
Where $module
doesn’t collide with any referenced symbol.
We translate static imports to dynamic imports, but this should error rather than resolve to
undefined
: