fix let without assignment

This commit is contained in:
Dmitry Vasilev
2023-10-30 15:13:29 +08:00
parent 376799de84
commit 84ed01dbf2
2 changed files with 16 additions and 1 deletions

View File

@@ -1015,7 +1015,12 @@ const eval_statement = (s, scope, calls, context) => {
}
if(stmt.type == 'let' && s.type == 'identifier') {
const node = {...s, result: {ok: true}}
return {ok, children: [...children, node], scope, calls}
return {
ok,
children: [...children, node],
scope: {...scope, [s.value]: undefined},
calls
}
}
const {
ok: next_ok,