mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Fix strict mode in an object initializer's getters / setters definition.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
parent
4f58104981
commit
7ccec19c26
@ -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);
|
||||
|
||||
|
||||
@ -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 ();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user