Fix invalid preparsing of variable declarations which are not splitted by comma.

JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
This commit is contained in:
Andrey Shitov
2015-08-11 08:54:19 +03:00
parent d6ad1c467e
commit 531a9d3352
2 changed files with 18 additions and 0 deletions
+6
View File
@@ -3026,6 +3026,12 @@ preparse_scope (bool is_global)
}
skip_newlines ();
if (!token_is (TOK_COMMA)
&& !token_is (TOK_EQ))
{
is_in_var_declaration_list = false;
}
}
else if (is_in_var_declaration_list)
{
+12
View File
@@ -17,6 +17,7 @@ assert (y === undefined);
assert (z === undefined);
assert (i === undefined);
assert (j === undefined);
assert (k === undefined);
assert (q === undefined);
assert (v === undefined);
@@ -49,3 +50,14 @@ for (var q in {})
}
{ var v = 1 }
try
{
var k
l
assert (false)
}
catch (e)
{
assert (e instanceof ReferenceError);
}