Skip to content

Commit 3d260ee

Browse files
committed
Fix missing autolet inner declaration block
1 parent b81761f commit 3d260ee

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

source/parser.hera

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5851,6 +5851,7 @@ Init
58515851
}
58525852
}
58535853
else if (node.type == "Declaration") {
5854+
if (node.children && node.children.length) createLetDecs(node.children, scopes)
58545855
node.names.forEach((name) => currentScope.add(name))
58555856
}
58565857
else {

test/autolet.civet

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,19 @@ describe "auto let with function", ->
4141
var b = 2
4242
}
4343
a = 2
44+
let c = (b) => {
45+
c = 1
46+
}
4447
---
4548
let b = 1
4649
function b(a) {
4750
a = 1
4851
var b = 2
4952
}
5053
let a = 2
54+
let c = (b) => {
55+
return let c = 1
56+
}
5157
"""
5258

5359
describe "auto let with multiple declaration", ->

0 commit comments

Comments
 (0)