for-in loops should preserve and restore the TDZ stack for each of its internal loops.
https://bugs.webkit.org/show_bug.cgi?id=185995
<rdar://problem/
40173142>
Reviewed by Saam Barati.
JSTests:
* stress/regress-185995.js: Added.
Source/JavaScriptCore:
This is because there's no guarantee that any of the loop bodies will be
executed. Hence, there's no guarantee that the TDZ variables will have been
initialized after each loop body.
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::preserveTDZStack):
(JSC::BytecodeGenerator::restoreTDZStack):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::ForInNode::emitBytecode):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232219
268f45cc-cd09-0410-ab3c-
d52691b4dbfc