Allow "<NUL>" character within string literals in strict mode

JerryScript-DCO-1.0-Signed-off-by: Yanhui Shen shen.elf@gmail.com
This commit is contained in:
Yanhui Shen
2017-08-15 10:29:23 +08:00
committed by yichoi
parent 522c7d3f87
commit b32e5444d8
2 changed files with 56 additions and 0 deletions
+10
View File
@@ -615,6 +615,16 @@ lexer_parse_string (parser_context_t *context_p) /**< context */
continue;
}
if (*source_p == LIT_CHAR_0
&& source_p + 1 < source_end_p
&& (*(source_p + 1) < LIT_CHAR_0 || *(source_p + 1) > LIT_CHAR_9))
{
source_p++;
column++;
length++;
continue;
}
/* Except \x, \u, and octal numbers, everything is
* converted to a character which has the same byte length. */
if (*source_p >= LIT_CHAR_0 && *source_p <= LIT_CHAR_3)