Skip to content

Fix regexp character classes with \uNNNN and \xNN code points #974

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

Conversation

akosthekiss
Copy link
Member

Also adding a regression test covering the issue.

Fixes #962

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu

@akosthekiss akosthekiss added bug Undesired behaviour parser Related to the JavaScript parser labels Mar 19, 2016
@zherczeg
Copy link
Member

What is the problem exactly?

@akosthekiss
Copy link
Member Author

It's described in #962, as mentioned in the first comment. (In short: if a regexp contains a character class, and that character class contains a hex-specified code point -- either \uNNNN or \xNN --, then the current implementation incorrectly adds the character 'u' or 'x' to the character class as well.)

@zherczeg
Copy link
Member

LGTM. I think in such cases it is better to describe the problem in the commit log as well.

Currently, if a regexp contains a character class and that
character class contains a hex-specified code point -- either
\uNNNN or \xNN --, then the character 'u' or 'x' is added to the
character class as well. This patch fixes the error and also adds
a regression test covering the issue.

Fixes jerryscript-project#962

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
@akosthekiss akosthekiss force-pushed the regex-char-class-uxcode-fix branch from 25eb636 to 57db5ca Compare March 20, 2016 12:57
@LaszloLango
Copy link
Contributor

LGTM

@akosthekiss akosthekiss merged commit 57db5ca into jerryscript-project:master Mar 21, 2016
@akosthekiss akosthekiss deleted the regex-char-class-uxcode-fix branch March 21, 2016 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Undesired behaviour parser Related to the JavaScript parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants