summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Token.cpp
diff options
context:
space:
mode:
author0xtechnobabble <0xtechnobabble@protonmail.com>2020-03-14 13:56:49 +0200
committerAndreas Kling <kling@serenityos.org>2020-03-14 13:58:30 +0100
commit644b4f420133d3945eca02d2734b7819e02f3c47 (patch)
treed418faeb1fb5e7ee184c9eceaae634d213fa1032 /Libraries/LibJS/Token.cpp
parent0659d0724142666ac016598e1a544a160120d2b0 (diff)
downloadserenity-644b4f420133d3945eca02d2734b7819e02f3c47.zip
LibJS: Evaluate for statements in their own scope if necessary
We now evaluate for loops in their own scope if their init statement is a lexical declaration. Evaluating for loops in their own scope allow us to obtain expected behaviour, which means for example, that the block-scoped variables declared in a for statement will be limited to the scope of the for loop's body and statement and not to that of the current scope (i.e the one where the for statement was made)
Diffstat (limited to 'Libraries/LibJS/Token.cpp')
0 files changed, 0 insertions, 0 deletions