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: error in expression character class with nested character class #136

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

ota-meshi
Copy link
Member

I noticed that the pattern /[a&&b&&[c]]/v causes an unexpected error.
This PR fixes this error.

@ota-meshi ota-meshi added the bug Something isn't working label Sep 11, 2023
Comment on lines -52 to +63
assert.strictEqual(
expected.message.slice(0, 27),
"Invalid regular expression:",
`The error message '${expected.message}' was not syntax error.`,
)
try {
parseRegExpLiteral(source, options)
} catch (err) {
const error = err as RegExpSyntaxError
assert.strictEqual(error.message, expected.message)
assert.strictEqual(error.index, expected.index)

assert.strictEqual(
expected.message.slice(0, 27),
"Invalid regular expression:",
`The error message '${expected.message}' was not syntax error.`,
)
Copy link
Member Author

Choose a reason for hiding this comment

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

I moved test because we can't debug unknown errors.

@ota-meshi ota-meshi merged commit 97c3ce6 into main Sep 11, 2023
14 checks passed
@ota-meshi ota-meshi deleted the fix-expr-char-class-with-nest branch September 11, 2023 23:39
@github-actions
Copy link

🎉 This PR is included in version 4.8.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants