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

Fails to parse usage of variable of #173

Closed
privatenumber opened this issue May 16, 2024 · 3 comments
Closed

Fails to parse usage of variable of #173

privatenumber opened this issue May 16, 2024 · 3 comments

Comments

@privatenumber
Copy link

privatenumber commented May 16, 2024

Reproduction

import { init, parse } from 'es-module-lexer'

await init

parse('const of=1;console.log(of/1)')

StackBlitz: https://stackblitz.com/edit/stackblitz-starters-ku65d9?file=index.mjs

Although of is an identifier with a special meaning, it is not reserved:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#identifiers_with_special_meanings

This also runs fine in Node/Chrome: const of=1;console.log(of/1)

@guybedford
Copy link
Owner

Thanks for posting, I've posted a fix in #174.

@privatenumber
Copy link
Author

Thanks for the quick turn around! Really appreciate it 🙌

BTW while I have you here, do you take sponsorships for this project? I only see JSPM and SystemJS on your Open Collective.

@guybedford
Copy link
Owner

Released in 1.5.3.

You're always welcome @privatenumber. Sponsorships to JSPM are always a huge help as it subsidizes the server costs, and is done in a tax efficient way.

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

No branches or pull requests

2 participants