Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: import/export of literal string names #714

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fabiosantoscode
Copy link

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
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
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