diff --git a/jerry-core/parser/js/js-scanner-util.c b/jerry-core/parser/js/js-scanner-util.c index 10960ca11..a8bfe924f 100644 --- a/jerry-core/parser/js/js-scanner-util.c +++ b/jerry-core/parser/js/js-scanner-util.c @@ -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) { diff --git a/tests/jerry/arguments.js b/tests/jerry/arguments.js index a9b3193fe..b1014d599 100644 --- a/tests/jerry/arguments.js +++ b/tests/jerry/arguments.js @@ -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);