jscript: Fixed conflict in Block statement that caused problems with empty blocks.

This commit is contained in:
Jacek Caban 2008-10-02 16:22:45 +02:00 committed by Alexandre Julliard
parent 47b842bff7
commit 383de2d79a
2 changed files with 6 additions and 2 deletions

View File

@ -325,8 +325,8 @@ StatementList_opt
/* ECMA-262 3rd Edition 12.1 */
Block
: '{' StatementList_opt '}'
{ $$ = new_block_statement(ctx, $2); }
: '{' StatementList '}' { $$ = new_block_statement(ctx, $2); }
| '{' '}' { $$ = new_block_statement(ctx, NULL) }
/* ECMA-262 3rd Edition 12.2 */
VariableStatement

View File

@ -175,6 +175,10 @@ if(true)
tmp = 1;
ok(tmp === 1, "tmp !== 1, if(true) not evaluated?");
if(false) {
}else {
}
var obj3 = { prop1: 1, prop2: typeof(false) };
ok(obj3.prop1 === 1, "obj3.prop1 is not 1");
ok(obj3.prop2 === "boolean", "obj3.prop2 is not \"boolean\"");