mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 21:14:28 -08:00
bare imports
This commit is contained in:
@@ -240,7 +240,11 @@ const codegen = (node, cxt, parent) => {
|
||||
return do_codegen(node.key) + ' : ' + do_codegen(node.value);
|
||||
} else if(node.type == 'import') {
|
||||
const names = node.imports.map(n => n.value)
|
||||
return `const {${names.join(',')}} = __modules['${node.full_import_path}'];`;
|
||||
if(names.length == 0) {
|
||||
return ''
|
||||
} else {
|
||||
return `const {${names.join(',')}} = __modules['${node.full_import_path}'];`;
|
||||
}
|
||||
} else if(node.type == 'export') {
|
||||
const identifiers = collect_destructuring_identifiers(node.binding.name_node)
|
||||
.map(i => i.value)
|
||||
|
||||
Reference in New Issue
Block a user