JavaScriptCore bytecompiler does not compute scope depth correctly
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 21 Aug 2011 05:21:50 +0000 (05:21 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 21 Aug 2011 05:21:50 +0000 (05:21 +0000)
commitc08fe2ea7ac1ed1523a7abf3dfba774f29945356
treed1ebe2ff88dae5fac5ce6d55b6487c4a4c0a347c
parent61c70c2ab656313695a8e96fe542e5c487fa4f22
JavaScriptCore bytecompiler does not compute scope depth correctly
in the case of constant declarations
https://bugs.webkit.org/show_bug.cgi?id=66572

Source/JavaScriptCore:

Patch by Filip Pizlo <fpizlo@apple.com> on 2011-08-20
Reviewed by Oliver Hunt.

Changed the handling of const to add the dynamic scope depth.

* bytecompiler/NodesCodegen.cpp:
(JSC::ConstDeclNode::emitCodeSingle):

LayoutTests:

Patch by Filip Pizlo <fpizlo@apple.com> on 2011-08-20
Reviewed by Oliver Hunt.

Added tests that reproduce the failure.

* fast/js/const-expected.txt:
* fast/js/resources/const.js:
(tryCatch1):
(tryCatch2):
(with1):
(with2):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@93487 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/js/const-expected.txt
LayoutTests/fast/js/resources/const.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp