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

Doesn't handle exports with invalid identifiers #94

Open
timfish opened this issue Jun 2, 2024 · 0 comments · May be fixed by #115
Open

Doesn't handle exports with invalid identifiers #94

timfish opened this issue Jun 2, 2024 · 0 comments · May be fixed by #115
Assignees

Comments

@timfish
Copy link
Contributor

timfish commented Jun 2, 2024

CommonJs supports exports keyed with arbitrary strings which are not valid identifiers:

exports["unsigned short"] = "something"

This means the webidl-conversions package results in the following error due to invalid iitm code:

file:///Users/tim/Documents/Repositories/import-in-the-middle/test/check-exports/node_modules/webidl-conversions/lib/index.js?iitm=true:69
      let $unsigned short = _.unsigned short
                    ^^^^^
SyntaxError: Unexpected identifier 'short'
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:118:18)
    at callTranslator (node:internal/modules/esm/loader:273:14)
    at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:278:30)
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 a pull request may close this issue.

1 participant