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

follow tc39/ecma262#1869 #944

Merged
merged 2 commits into from
Apr 2, 2020

Conversation

mysticatea
Copy link
Contributor

This PR changes the regular expression validator in acorn in order to follow tc39/ecma262#1869.

Per consensus today, all of

/(?<\ud835\udc9c>.)/
/(?<\ud835\udc9c>.)/u
/(?<\u{1d49c}>.)/
/(?<\u{1d49c}>.)/u
/(?<𝒜>)/
/(?<𝒜>)/u

will be legal.

tc39/ecma262#1869 (comment)

Upstreams:

@marijnh marijnh merged commit f1c3592 into acornjs:master Apr 2, 2020
@mysticatea mysticatea deleted the regexp-unicode-group-names branch April 2, 2020 11:06
// <ZWNJ>
// <ZWJ>
pp.regexp_eatRegExpIdentifierPart = function(state) {
const start = state.pos
let ch = state.current()
state.advance()
const forceU = this.options.ecmaVersion >= 11

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a spec bugfix. We can't say whether any capture group name was legal before 2020 because the spec was nonsensical. Thus, I don't think you should switch on the behaviour; just go with the es2020 clarification.

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.

3 participants