Fix for propagating arguments reference from nested blocks. (#3309)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg 2019-11-14 13:48:58 +01:00 committed by Dániel Bátyai
parent 55c7590767
commit b4b55a67a2
2 changed files with 15 additions and 0 deletions

View File

@ -371,6 +371,7 @@ scanner_push_literal_pool (parser_context_t *context_p, /**< context */
if (!(status_flags & SCANNER_LITERAL_POOL_FUNCTION))
{
JERRY_ASSERT (prev_literal_pool_p != NULL);
status_flags |= SCANNER_LITERAL_POOL_NO_ARGUMENTS;
if (prev_literal_pool_p->status_flags & SCANNER_LITERAL_POOL_IN_WITH)
{

View File

@ -129,3 +129,17 @@ fn_expr (1);
(function () {
var a = [arguments];
})();
function nested_args()
{
var a;
for (var i = 0; i < 1; i++)
{
if (i == 0)
{
a = arguments[i];
}
}
assert(a === 3);
}
nested_args(3);