Fix syntax checking for line terminators inside regular expressions.

JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
This commit is contained in:
Andrey Shitov
2015-07-14 17:29:13 +03:00
parent f3ef9afb91
commit 1195c197e8
+5 -1
View File
@@ -1099,13 +1099,17 @@ lexer_parse_regexp (void)
{
PARSE_ERROR ("Unclosed string", token_start_pos);
}
else if (c == LIT_CHAR_LF)
else if (lit_char_is_line_terminator (c))
{
PARSE_ERROR ("RegExp literal shall not contain newline character", token_start_pos);
}
else if (c == LIT_CHAR_BACKSLASH)
{
consume_char ();
if (lit_char_is_line_terminator (LA (0)))
{
PARSE_ERROR ("RegExp literal backslash sequence should not contain newline character", token_start_pos);
}
}
else if (c == LIT_CHAR_LEFT_SQUARE)
{