Fix expression statement parsing in case of statement starts with keyword
This commit is contained in:
1 parent
6aee69d6df
commit
c1ebb8db50
2 files changed
+11
-1
No files matched your search
@@ -2417,6 +2417,11 @@ parse_statement (void)
|
||||
else
|
||||
{
|
||||
parse_expression (true);
|
||||
skip_newlines ();
|
||||
if (!token_is (TOK_SEMICOLON))
|
||||
{
|
||||
lexer_save_token (tok);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,12 @@ b = 'property1';
|
||||
a = {
|
||||
'property1' : 'value1',
|
||||
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; }
|
||||
};
|
||||
assert (a.property1 === 'value1');
|
||||
|
||||
Reference in new issue
Block a user