diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index 7e74880a7cb..748a06a13bf 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -264,6 +264,8 @@ HtmlComment /* ECMA-262 3rd Edition 14 */ SourceElements : /* empty */ { $$ = new_source_elements(ctx); } + | SourceElements FunctionExpression + { $$ = $1; } | SourceElements Statement { $$ = source_elements_add_statement($1, $2); } diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js index fd14c934567..8ab4d1e650f 100644 --- a/dlls/jscript/tests/lang.js +++ b/dlls/jscript/tests/lang.js @@ -902,5 +902,7 @@ ok(re.source === "=(\\?|%3F)", "re.source = " + re.source); ok(createNullBSTR() === '', "createNullBSTR() !== ''"); function do_test() {} +function nosemicolon() {} nosemicolon(); +function () {} nosemicolon(); reportSuccess();