quick bugfix (#78)

This commit is contained in:
Kurt Hutten
2023-03-21 19:02:18 +11:00
committed by GitHub
parent 5f7ee2c512
commit 45091d3c4f
3 changed files with 8 additions and 2 deletions

View File

@ -157,7 +157,7 @@ export function findAllPreviousVariables(
const { node: bodyItems } = getNodeFromPath<Program['body']>(ast, bodyPath)
const variables: PrevVariable<any>[] = []
bodyItems.forEach((item) => {
bodyItems?.forEach?.((item) => {
if (item.type !== 'VariableDeclaration' || item.end > sourceRange[0]) return
const varName = item.declarations[0].id.name
const varValue = programMemory?.root[varName]