Skip to content

Doesn't handle exports with invalid identifiers #94

@timfish

Description

@timfish

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions