jscript: Fix do while loop parsing.

This commit is contained in:
Piotr Caban 2009-07-06 10:38:23 +02:00 committed by Alexandre Julliard
parent b5a82030ad
commit 60748ebf51
2 changed files with 8 additions and 1 deletions

View File

@ -386,7 +386,7 @@ IfStatement
/* ECMA-262 3rd Edition 12.6 */
IterationStatement
: kDO Statement kWHILE '(' Expression ')' ';'
: kDO Statement kWHILE '(' Expression ')' semicolon_opt
{ $$ = new_while_statement(ctx, TRUE, $5, $2); }
| kWHILE '(' Expression ')' Statement
{ $$ = new_while_statement(ctx, FALSE, $3, $5); }

View File

@ -671,6 +671,13 @@ do {
} while(false);
ok(tmp === 1, "tmp !== 1");
tmp = 0;
do {
ok(tmp < 4, "tmp >= 4");
tmp++;
} while(tmp < 4)
ok(tmp === 4, "tmp !== 4")
tmp = 0;
while(tmp < 4) {
tmp++;