Deep nesting is leading to ReferenceError for hoisted function
authorgskachkov@gmail.com <gskachkov@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Apr 2017 21:25:50 +0000 (21:25 +0000)
committergskachkov@gmail.com <gskachkov@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Apr 2017 21:25:50 +0000 (21:25 +0000)
commit71bb8e41b7432192dc1092190ccf3826eb00169e
tree7b475a9197499303554ee942e949e5f235911940
parent507266011a7b5e1da9336f302f3f01806f0fc2e3
Deep nesting is leading to ReferenceError for hoisted function
https://bugs.webkit.org/show_bug.cgi?id=171456

Reviewed by Yusuke Suzuki.

Current patch fix error that appears during hoisting of the function
in block scope. Error happens only when exist some deep scope that lead
to increase scope stack, after which list of the hosted candidates do not
copied to updated scope stack.

Source/JavaScriptCore:
* parser/Parser.h:
(JSC::Scope::Scope):

LayoutTests:
* js/function-declaration-statement-expected.txt:
* js/script-tests/function-declaration-statement.js:
(deepNesting.foo):
(deepNesting):
(deepNestingForFunctionDeclaration.foo):
(deepNestingForFunctionDeclaration):
(eval.deepNestingInEval.foo):
(eval.deepNestingInEval):
(eval.deepNestingForFunctionDeclarationInEval.foo):
(eval.deepNestingForFunctionDeclarationInEval):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215977 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/js/function-declaration-statement-expected.txt
LayoutTests/js/script-tests/function-declaration-statement.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/parser/Parser.h