@@ -693,12 +693,12 @@ lexer_parse_identifier (parser_context_t *context_p, /**< context */
693693
694694 if (JERRY_UNLIKELY (code_point >= LIT_UTF8_2_BYTE_MARKER ))
695695 {
696+ #if ENABLED (JERRY_ES2015 )
696697 utf8_length = lit_read_code_point_from_utf8 (source_p ,
697698 (lit_utf8_size_t ) (source_end_p - source_p ),
698699 & code_point );
699700 decoded_length = utf8_length ;
700701
701- #if ENABLED (JERRY_ES2015 )
702702 /* Only ES2015 supports code points outside of the basic plane which can be part of an identifier. */
703703 if ((code_point >= LIT_UTF16_HIGH_SURROGATE_MIN && code_point <= LIT_UTF16_HIGH_SURROGATE_MAX )
704704 && source_p + 3 < source_end_p )
@@ -717,11 +717,23 @@ lexer_parse_identifier (parser_context_t *context_p, /**< context */
717717 char_count = 2 ;
718718 }
719719 }
720- else if (source_p [0 ] >= LEXER_UTF8_4BYTE_START )
720+ else if (source_p [0 ] >= LIT_UTF8_4_BYTE_MARKER )
721721 {
722722 decoded_length = 2 * 3 ;
723723 has_escape = true;
724724 }
725+ #else /* !ENABLED (JERRY_ES2015) */
726+ if (code_point < LIT_UTF8_4_BYTE_MARKER )
727+ {
728+ utf8_length = lit_read_code_point_from_utf8 (source_p ,
729+ (lit_utf8_size_t ) (source_end_p - source_p ),
730+ & code_point );
731+ decoded_length = utf8_length ;
732+ }
733+ else
734+ {
735+ code_point = 0 ;
736+ }
725737#endif /* ENABLED (JERRY_ES2015) */
726738 }
727739
@@ -1091,7 +1103,7 @@ lexer_parse_string (parser_context_t *context_p, /**< context */
10911103 }
10921104#endif /* ENABLED (JERRY_ES2015) */
10931105
1094- if (* source_p >= LEXER_UTF8_4BYTE_START )
1106+ if (* source_p >= LIT_UTF8_4_BYTE_MARKER )
10951107 {
10961108 /* Processing 4 byte unicode sequence (even if it is
10971109 * after a backslash). Always converted to two 3 byte
@@ -1893,7 +1905,7 @@ lexer_convert_ident_to_cesu8 (uint8_t *destination_p, /**< destination string */
18931905 }
18941906
18951907#if ENABLED (JERRY_ES2015 )
1896- if (* source_p >= LEXER_UTF8_4BYTE_START )
1908+ if (* source_p >= LIT_UTF8_4_BYTE_MARKER )
18971909 {
18981910 lit_four_byte_utf8_char_to_cesu8 (destination_p , source_p );
18991911
@@ -2113,7 +2125,7 @@ lexer_convert_literal_to_chars (parser_context_t *context_p, /**< context */
21132125 }
21142126#endif /* ENABLED (JERRY_ES2015) */
21152127
2116- if (* source_p >= LEXER_UTF8_4BYTE_START )
2128+ if (* source_p >= LIT_UTF8_4_BYTE_MARKER )
21172129 {
21182130 /* Processing 4 byte unicode sequence (even if it is
21192131 * after a backslash). Always converted to two 3 byte
@@ -3028,7 +3040,7 @@ lexer_compare_identifier_to_chars (const uint8_t *left_p, /**< left identifier *
30283040
30293041 escape_size = lit_code_point_to_cesu8_bytes (utf8_buf , code_point );
30303042 }
3031- else if (* left_p >= LEXER_UTF8_4BYTE_START )
3043+ else if (* left_p >= LIT_UTF8_4_BYTE_MARKER )
30323044 {
30333045 lit_four_byte_utf8_char_to_cesu8 (utf8_buf , left_p );
30343046 escape_size = 3 * 2 ;
0 commit comments