Skip to content

Commit

Permalink
unwrap return value while reassigning values
Browse files Browse the repository at this point in the history
forgot to do this
  • Loading branch information
TheTrio committed Oct 16, 2024
1 parent 1e7b808 commit 49af51b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "espressolang",
"version": "1.0.1",
"version": "1.0.2",
"repository": {
"url": "https://github.com/TheTrio/Espresso"
},
Expand Down
10 changes: 5 additions & 5 deletions src/evaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ const evaluateReassignmentStatement = (
value = currentStore.getLocal(lvalue.value!)
}
if (value !== NOT_FOUND_IN_STORE) {
setValueFromLValue(
statement.lvalue!,
currentStore,
evaluateExpression(statement.rvalue!, store)
)
let value = evaluateExpression(statement.rvalue!, store)
if (value instanceof ReturnValue) {
value = value.value
}
setValueFromLValue(statement.lvalue!, currentStore, value)
return
}
currentStore = currentStore.parentStore!
Expand Down

0 comments on commit 49af51b

Please sign in to comment.