diff --git a/src/libjsparser/lexer.c b/src/libjsparser/lexer.c index f2fd57f78..56b1d77f6 100644 --- a/src/libjsparser/lexer.c +++ b/src/libjsparser/lexer.c @@ -777,7 +777,7 @@ parse_string (void) /* Only single escape character is allowed. */ if (LA (1) == 'x' || LA (1) == 'u' || __isdigit (LA (1))) { - PARSE_WARN ("Escape sequences are ignored yet", token_start - buffer_start); + // PARSE_WARN ("Escape sequences are ignored yet", token_start - buffer_start); consume_char (); consume_char (); continue; diff --git a/src/libjsparser/parser.c b/src/libjsparser/parser.c index cab153af8..1b92b8ebc 100644 --- a/src/libjsparser/parser.c +++ b/src/libjsparser/parser.c @@ -1327,13 +1327,30 @@ parse_member_expression (idx_t *this_arg) parse_member_expression (this_arg); skip_newlines (); - if (this_arg) + if (token_is (TOK_OPEN_PAREN)) { - parse_argument_list (AL_CONSTRUCT_EXPR, ID(1), *this_arg); // push obj + if (this_arg) + { + parse_argument_list (AL_CONSTRUCT_EXPR, ID(1), *this_arg); // push obj + } + else + { + parse_argument_list (AL_CONSTRUCT_EXPR, ID(1), INVALID_VALUE); // push obj + } } else { - parse_argument_list (AL_CONSTRUCT_EXPR, ID(1), INVALID_VALUE); // push obj + lexer_save_token (TOK ()); + STACK_PUSH (IDX, next_temp_name ()); + if (this_arg) + { + DUMP_OPCODE_3 (construct_n, ID (1), ID (2), 1); + DUMP_OPCODE_3 (meta, OPCODE_META_TYPE_THIS_ARG, *this_arg, INVALID_VALUE); + } + else + { + DUMP_OPCODE_3 (construct_n, ID (1), ID (2), 0); + } } STACK_SWAP (IDX); @@ -1631,9 +1648,9 @@ parse_unary_expression (void) else if (is_keyword (KW_VOID)) { STACK_PUSH (IDX, next_temp_name ()); - DUMP_OPCODE_3 (assignment, ID(1), OPCODE_ARG_TYPE_VARIABLE, ID (2)); - DUMP_OPCODE_3 (assignment, ID(1), OPCODE_ARG_TYPE_SIMPLE, ECMA_SIMPLE_VALUE_UNDEFINED); - STACK_SWAP (IDX); + NEXT (unary_expression); + DUMP_OPCODE_3 (assignment, ID(2), OPCODE_ARG_TYPE_VARIABLE, ID (1)); + DUMP_OPCODE_3 (assignment, ID(2), OPCODE_ARG_TYPE_SIMPLE, ECMA_SIMPLE_VALUE_UNDEFINED); STACK_DROP (IDX, 1); break; } @@ -3225,7 +3242,7 @@ parse_source_element (void) } static void -skip_optional_name_and_braces (void) +skip_optional_name_and_parens (void) { if (token_is (TOK_NAME)) { @@ -3236,7 +3253,7 @@ skip_optional_name_and_braces (void) current_token_must_be (TOK_OPEN_PAREN); } - while (!token_is (TOK_CLOSE_BRACE)) + while (!token_is (TOK_CLOSE_PAREN)) { skip_newlines (); } @@ -3272,7 +3289,7 @@ static void skip_function (void) { skip_newlines (); - skip_optional_name_and_braces (); + skip_optional_name_and_parens (); skip_newlines (); skip_braces (); } diff --git a/tests/jerry-test-suite/08/08.04/08.04-002.js b/tests/jerry-test-suite/08/08.04/08.04-002.js index d7f0f8718..7760ead8d 100644 --- a/tests/jerry-test-suite/08/08.04/08.04-002.js +++ b/tests/jerry-test-suite/08/08.04/08.04-002.js @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert("x\0a" < "x\0b") && ("x\0b" < "x\0c")); +assert(("x\0a" < "x\0b") && ("x\0b" < "x\0c"));