mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Fix expression statement parsing in case of statement starts with keyword
This commit is contained in:
parent
6aee69d6df
commit
c1ebb8db50
@ -2417,6 +2417,11 @@ parse_statement (void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
parse_expression (true);
|
parse_expression (true);
|
||||||
|
skip_newlines ();
|
||||||
|
if (!token_is (TOK_SEMICOLON))
|
||||||
|
{
|
||||||
|
lexer_save_token (tok);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,7 +54,12 @@ b = 'property1';
|
|||||||
a = {
|
a = {
|
||||||
'property1' : 'value1',
|
'property1' : 'value1',
|
||||||
get property2 () { return 1; },
|
get property2 () { return 1; },
|
||||||
set property2 (a) { this.property3 = a * 10; },
|
set property2 (a) {
|
||||||
|
if (true)
|
||||||
|
this.property3 = a * 10;
|
||||||
|
else
|
||||||
|
this.property3 = a;
|
||||||
|
},
|
||||||
set property3 (b) { this.property1 = b; }
|
set property3 (b) { this.property1 = b; }
|
||||||
};
|
};
|
||||||
assert (a.property1 === 'value1');
|
assert (a.property1 === 'value1');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user