Skip to content

Conversation

@adams85
Copy link
Contributor

@adams85 adams85 commented Jul 9, 2025

Since ES6, identifiers can also contain astral Unicode code points.

This PR adjusts isAsyncFunction and isUsingKeyword to handle this correctly.

Also, removes redundant check for backslash in isLet (as potential backslash is already tokenized as part of an identifier token).

UPDATE: I just realized that isIdentifierChar checks for astral characters when the astral argument is omitted. So this PR just cleans up and makes things more consistent.

@adams85 adams85 changed the title Correct astral identifier char handling in keyword lookahead functions Clean up identifier char handling in keyword lookahead functions Jul 9, 2025
@adams85 adams85 force-pushed the improve-keyword-lookahead branch from 2280002 to f98a258 Compare July 9, 2025 09:22
@adams85 adams85 force-pushed the improve-keyword-lookahead branch from f98a258 to 4e650c6 Compare July 9, 2025 09:27
@marijnh
Copy link
Member

marijnh commented Jul 9, 2025

Thanks! The astral parameter to isIdentifierChar already defaults to true. Could you simplify this by removing those parameters again?

@adams85
Copy link
Contributor Author

adams85 commented Jul 9, 2025

Sure thing!

@marijnh marijnh merged commit f9da2f3 into acornjs:master Jul 9, 2025
2 checks passed
@marijnh
Copy link
Member

marijnh commented Jul 9, 2025

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants