aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-17 10:05:56 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-17 10:05:56 +0100
commit4a03542f6ebc8c6d4ed624bc0d30f5a7148a279b (patch)
treea0801a297523d5bf6ece69a2992a7b3dbf23edf6 /src
parent50aa5b5029165be03d0cfb34e7d664795dd80898 (diff)
downloadfengari-4a03542f6ebc8c6d4ed624bc0d30f5a7148a279b.tar.gz
fengari-4a03542f6ebc8c6d4ed624bc0d30f5a7148a279b.tar.bz2
fengari-4a03542f6ebc8c6d4ed624bc0d30f5a7148a279b.zip
Fixed UpVal.setval so that it update v index and v value on the stack
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() {