c = '\0';
break;
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ if (parser->node != NULL) {
+ switch (parser->node->token_type) {
+ case NJS_TOKEN_METHOD_CALL:
+ case NJS_TOKEN_FUNCTION_CALL:
+ case NJS_TOKEN_FUNCTION_EXPRESSION:
+ case NJS_TOKEN_EVAL:
+ goto next_char;
+
+ default:
+ break;
+ }
+ }
+
+ njs_parser_syntax_error(parser,
+ "Octal escape sequences can't be used "
+ "in untagged template literals "
+ "or in strict mode code");
+
+ return NJS_TOKEN_ILLEGAL;
+
+ case '8':
+ case '9':
+ if (parser->node != NULL) {
+ switch (parser->node->token_type) {
+ case NJS_TOKEN_METHOD_CALL:
+ case NJS_TOKEN_FUNCTION_CALL:
+ case NJS_TOKEN_FUNCTION_EXPRESSION:
+ case NJS_TOKEN_EVAL:
+ goto next_char;
+
+ default:
+ break;
+ }
+ }
+
+ njs_parser_syntax_error(parser,
+ "The escapes \\8 and \\9 can't be used "
+ "in untagged template literals "
+ "or in strict mode code");
+
+ return NJS_TOKEN_ILLEGAL;
+
+next_char:
+
+ break;
+
case 'b':
c = '\b';
break;
{ njs_str("'r' !== '\\r'"),
njs_str("true") },
+ /* Octal escape sequences are not allowed in strict mode.*/
+
+ { njs_str("'\\0a'"),
+ njs_str("\0a") },
+
+ { njs_str("'\\1a'"),
+ njs_str("SyntaxError: Octal escape sequences can't be used in untagged template literals or in strict mode code in 1") },
+
+ { njs_str("'a\\2a'"),
+ njs_str("SyntaxError: Octal escape sequences can't be used in untagged template literals or in strict mode code in 1") },
+
+ { njs_str("'\\3a'"),
+ njs_str("SyntaxError: Octal escape sequences can't be used in untagged template literals or in strict mode code in 1") },
+
+ { njs_str("'a\\4a'"),
+ njs_str("SyntaxError: Octal escape sequences can't be used in untagged template literals or in strict mode code in 1") },
+
+ { njs_str("'\\5a'"),
+ njs_str("SyntaxError: Octal escape sequences can't be used in untagged template literals or in strict mode code in 1") },
+
+ { njs_str("'a\\6a'"),
+ njs_str("SyntaxError: Octal escape sequences can't be used in untagged template literals or in strict mode code in 1") },
+
+ { njs_str("'\\7a'"),
+ njs_str("SyntaxError: Octal escape sequences can't be used in untagged template literals or in strict mode code in 1") },
+
+ { njs_str("'\\8a'"),
+ njs_str("SyntaxError: The escapes \\8 and \\9 can't be used in untagged template literals or in strict mode code in 1") },
+
+ { njs_str("'\\9a'"),
+ njs_str("SyntaxError: The escapes \\8 and \\9 can't be used in untagged template literals or in strict mode code in 1") },
+
+ { njs_str("'\\aa'"),
+ njs_str("aa") },
+
+ { njs_str("'\\*a'"),
+ njs_str("*a") },
+
+ { njs_str("`\\7`"),
+ njs_str("SyntaxError: Octal escape sequences can't be used in untagged template literals or in strict mode code in 1") },
+
+ { njs_str("`\\9`"),
+ njs_str("SyntaxError: The escapes \\8 and \\9 can't be used in untagged template literals or in strict mode code in 1") },
+
+ /* Octal escape sequences are allowed in tagged template literals in strict mode.*/
+
+#if 0 /* FIXME: tag function runtime semantics */
+ { njs_str("function x (s) {return s[0]}; x`\\7`"),
+ njs_str("undefined") },
+
+ { njs_str("function x (s) {return s[0]}; x`\\9`"),
+ njs_str("undefined") },
+
+ { njs_str("function x (s) {return s.raw[0]}; x`\\9`"),
+ njs_str("\\9") },
+
+ { njs_str("function x (s) {return s.raw[0]}; x`\\7`"),
+ njs_str("\\7") },
+#endif
+
/* Broken UTF-8 literals.*/
{ njs_str("'\\a\x96\xE5\x9C\xE3\x81\xB6'"),