Skip to content

Export not detected #20

@nicolo-ribaudo

Description

@nicolo-ribaudo

⚠️ This is not real-world code. It's technically a bug, but no real program will notice it. Feel free to close this issue!

Consider this non-strict mode code: (GitHub's syntax highlighting is broken)

function fn() {
    yield / "/ //" /*
}
/*/
}

module.exports.foo = 2;

// */

The tokens are:

[function] [Identifier: fn] [paren left] [paren left] [brace left]
[Identifier: yield] [division] [String: "/ //"] [Comment: \n}\n/ ]
[brace right]

[Identifier: module] [dot] [Identifier: exports] [dot] [Identifier: foo] [equal] [Number: 2] [semicolon]

However, cjs-module-lexer returns { exports: [], reexports: [] }.

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