diff --git a/jerry-core/parser/js/parser.cpp b/jerry-core/parser/js/parser.cpp index 897c6f323..0a0786e99 100644 --- a/jerry-core/parser/js/parser.cpp +++ b/jerry-core/parser/js/parser.cpp @@ -393,9 +393,6 @@ parse_property_assignment (void) dump_function_end_for_rewrite (); - const bool is_strict = scopes_tree_strict_mode (STACK_TOP (scopes)); - scopes_tree_set_strict_mode (STACK_TOP (scopes), false); - token_after_newlines_must_be (TOK_OPEN_BRACE); skip_newlines (); @@ -410,8 +407,6 @@ parse_property_assignment (void) token_after_newlines_must_be (TOK_CLOSE_BRACE); - scopes_tree_set_strict_mode (STACK_TOP (scopes), is_strict); - dump_ret (); rewrite_function_end (VARG_FUNC_EXPR); diff --git a/tests/jerry/object-literal-2.js b/tests/jerry/object-literal-2.js index 511656941..ef379678c 100644 --- a/tests/jerry/object-literal-2.js +++ b/tests/jerry/object-literal-2.js @@ -24,3 +24,16 @@ function c() { assert (b.let + b.enum === 25) } c(); + +function d () { + "use strict"; + + try { + /* 'let' is a FutureReservedWord in strict mode code */ + eval ('var a = { get prop () { let = 1; } }'); + assert (false); + } catch (e) { + assert (e instanceof SyntaxError); + } +} +d ();