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

🚑 fix bad import #2985

Merged
merged 2 commits into from
Dec 6, 2020
Merged

🚑 fix bad import #2985

merged 2 commits into from
Dec 6, 2020

Conversation

maxence-lefebvre
Copy link
Contributor

Hi,

As of today, InputStream is the default export of its module and not a named one.

image

The module CharStreams was trying to load the named one which does not exist.

Test case

console.log(require('antlr4').CharStreams.fromString('test'))

Expected

InputStream {
  name: '<empty>',
  strdata: 'test',
  decodeToUnicodeCodePoints: true,
  _index: 0,
  data: [ 116, 101, 115, 116 ],
  _size: 4
}

Actual

TypeError: InputStream is not a constructor
    at Object.fromString (node_modules\antlr4\src\antlr4\CharStreams.js:19:12)

@ericvergnaud
Copy link
Contributor

Would you mind adding a test? It's a pity we didn't have one to detect that break...

@ericvergnaud ericvergnaud merged commit 1b947ee into antlr:master Dec 6, 2020
@ericvergnaud
Copy link
Contributor

Thanks!

@parrt parrt added this to the 4.9.1 milestone Jan 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants