mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Fix regression after #1927
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
parent
44833cf7be
commit
ce1d555288
@ -518,49 +518,31 @@ re_parse_char_class (re_parser_ctx_t *parser_ctx_p, /**< number of classes */
|
||||
}
|
||||
} /* ch == LIT_CHAR_BACKSLASH */
|
||||
|
||||
if (ch == LIT_CHAR_UNDEF)
|
||||
if (start != LIT_CHAR_UNDEF)
|
||||
{
|
||||
if (start != LIT_CHAR_UNDEF)
|
||||
if (is_range)
|
||||
{
|
||||
if (is_range)
|
||||
if (start > ch)
|
||||
{
|
||||
return ecma_raise_syntax_error (ECMA_ERR_MSG ("invalid character class, invalid range"));
|
||||
return ecma_raise_syntax_error (ECMA_ERR_MSG ("invalid character class, wrong order"));
|
||||
}
|
||||
else
|
||||
{
|
||||
append_char_class (re_ctx_p, start, start);
|
||||
append_char_class (re_ctx_p, start, ch);
|
||||
start = LIT_CHAR_UNDEF;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (start != LIT_CHAR_UNDEF)
|
||||
{
|
||||
if (is_range)
|
||||
{
|
||||
if (start > ch)
|
||||
{
|
||||
return ecma_raise_syntax_error (ECMA_ERR_MSG ("invalid character class, wrong order"));
|
||||
}
|
||||
else
|
||||
{
|
||||
append_char_class (re_ctx_p, start, ch);
|
||||
start = LIT_CHAR_UNDEF;
|
||||
is_range = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
append_char_class (re_ctx_p, start, start);
|
||||
start = ch;
|
||||
is_range = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
append_char_class (re_ctx_p, start, start);
|
||||
start = ch;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
start = ch;
|
||||
}
|
||||
}
|
||||
while (token_type == RE_TOK_START_CHAR_CLASS || token_type == RE_TOK_START_INV_CHAR_CLASS);
|
||||
|
||||
|
||||
@ -129,3 +129,7 @@ assert (r == "abcdefghjklmnopqrstuvwxyz");
|
||||
|
||||
r = new RegExp ("[\\x61-\\x7a]+$").exec("abcdefghjklmnopqrstuvwxyz");
|
||||
assert (r == "abcdefghjklmnopqrstuvwxyz");
|
||||
|
||||
r = new RegExp("[\\u0800-\\uffff]", "g");
|
||||
assert (r.test ("\uffff"));
|
||||
assert (!r.test ("\uffff"));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user