summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lfunc.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lfunc.js b/src/lfunc.js
index 39ad049..c309147 100644
--- a/src/lfunc.js
+++ b/src/lfunc.js
@@ -40,8 +40,10 @@ class UpVal {
}
setval(L, ra) {
- if (this.v !== null) this.v = ra;
- else this.u.value = L.stack[ra];
+ if (this.v !== null) {
+ L.stack[this.v] = L.stack[ra];
+ this.v = ra;
+ } else this.u.value = L.stack[ra];
}
isopen() {