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:
László Langó
2017-07-19 11:01:16 +02:00
committed by yichoi
parent 44833cf7be
commit ce1d555288
2 changed files with 15 additions and 29 deletions
-18
View File
@@ -518,23 +518,6 @@ re_parse_char_class (re_parser_ctx_t *parser_ctx_p, /**< number of classes */
} }
} /* ch == LIT_CHAR_BACKSLASH */ } /* ch == LIT_CHAR_BACKSLASH */
if (ch == LIT_CHAR_UNDEF)
{
if (start != LIT_CHAR_UNDEF)
{
if (is_range)
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("invalid character class, invalid range"));
}
else
{
append_char_class (re_ctx_p, start, start);
start = LIT_CHAR_UNDEF;
}
}
}
else
{
if (start != LIT_CHAR_UNDEF) if (start != LIT_CHAR_UNDEF)
{ {
if (is_range) if (is_range)
@@ -561,7 +544,6 @@ re_parse_char_class (re_parser_ctx_t *parser_ctx_p, /**< number of classes */
start = ch; start = ch;
} }
} }
}
while (token_type == RE_TOK_START_CHAR_CLASS || token_type == RE_TOK_START_INV_CHAR_CLASS); while (token_type == RE_TOK_START_CHAR_CLASS || token_type == RE_TOK_START_INV_CHAR_CLASS);
return re_parse_iterator (parser_ctx_p, out_token_p); return re_parse_iterator (parser_ctx_p, out_token_p);
+4
View File
@@ -129,3 +129,7 @@ assert (r == "abcdefghjklmnopqrstuvwxyz");
r = new RegExp ("[\\x61-\\x7a]+$").exec("abcdefghjklmnopqrstuvwxyz"); r = new RegExp ("[\\x61-\\x7a]+$").exec("abcdefghjklmnopqrstuvwxyz");
assert (r == "abcdefghjklmnopqrstuvwxyz"); assert (r == "abcdefghjklmnopqrstuvwxyz");
r = new RegExp("[\\u0800-\\uffff]", "g");
assert (r.test ("\uffff"));
assert (!r.test ("\uffff"));