Fix expression statement parsing in case of statement starts with keyword

This commit is contained in:
Ilmir Usmanov 2014-12-12 16:35:46 +03:00
parent 6aee69d6df
commit c1ebb8db50
2 changed files with 11 additions and 1 deletions

View File

@ -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;
} }
} }

View File

@ -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');