Skip to content

feat: import/export of literal string names#714

Open
fabiosantoscode wants to merge 2 commits into
davidbonnet:mainfrom
fabiosantoscode:main
Open

feat: import/export of literal string names#714
fabiosantoscode wants to merge 2 commits into
davidbonnet:mainfrom
fabiosantoscode:main

Conversation

@fabiosantoscode
Copy link
Copy Markdown

Closes #713

Foreign names can be string literals, like so:

export {m as "m"};
export {n as "n", "o" as o, "p"} from "module";
import {"s" as t} from "module";

This implementation is incomplete. Changing ExportAllDeclaration to support this raised an issue with testing (specifically with acorn-import-attributes), and fixing it would make the PR too large.

@fabiosantoscode
Copy link
Copy Markdown
Author

I opened this PR over on acorn-import-attributes: xtuc/acorn-import-attributes#36. If it gets merged, I'll implement quoted export-all in this one.

@fabiosantoscode
Copy link
Copy Markdown
Author

fabiosantoscode commented Sep 18, 2024

I decided to implement export * as "string" from ..., but not submit a test.

Locally, I added

export * as "q" from "module"; to exports.js, and then ran the test with a patched node_modules/acorn-import-attributes. It passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Does not handle literal module specifier

1 participant