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

Unexpected parsing behavior after upgrading Acorn from v8.9.0 to v8.11.3 #1273

Closed
aladdin-add opened this issue Jan 19, 2024 · 1 comment
Closed

Comments

@aladdin-add
Copy link

I recently upgraded the Acorn version in my project from v8.9.0 to v8.11.3 and noticed unexpected changes in the parsing behavior. Specifically, the parsing of certain constructs is different than the previous version.

  1. The following export statements now parse "default" as "Identifier" instead of "Keyword":
export { default } from "foo";
export { foo as default } from "foo";
import { default as foo } from "foo";
  1. The parsing of "var" and "null" in import statements has also changed. Previously, "var" was parsed as "Keyword" and "null" as "Null", but now both are parsed as "Identifier":
import { var as baz } from "foo";
import { null as nil } from "bar";

I am unsure if this change in parsing behavior is intentional or a bug. In the previous version, "default" was recognized as a "Keyword," and "var" and "null" were parsed differently. Please let me know if this is the expected behavior or if it is a bug introduced in the new version.

@marijnh
Copy link
Member

marijnh commented Jan 19, 2024

These changes are intentional. In this context the identifiers are binding names, not keywords.

@marijnh marijnh closed this as completed Jan 19, 2024
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

3 participants
@marijnh @aladdin-add and others