Module: wine Branch: master Commit: 383de2d79a35aa4ea82eb8ddba2e4107a2b4afa3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=383de2d79a35aa4ea82eb8ddba...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Oct 2 16:22:45 2008 +0200
jscript: Fixed conflict in Block statement that caused problems with empty blocks.
---
dlls/jscript/parser.y | 4 ++-- dlls/jscript/tests/lang.js | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index 98ee250..2123e9c 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -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 diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js index d9c3689..c9d9455 100644 --- a/dlls/jscript/tests/lang.js +++ b/dlls/jscript/tests/lang.js @@ -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"");