diff options
author | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-02-17 10:05:56 +0100 |
---|---|---|
committer | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-02-17 10:05:56 +0100 |
commit | 4a03542f6ebc8c6d4ed624bc0d30f5a7148a279b (patch) | |
tree | a0801a297523d5bf6ece69a2992a7b3dbf23edf6 /src/lfunc.js | |
parent | 50aa5b5029165be03d0cfb34e7d664795dd80898 (diff) | |
download | fengari-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/lfunc.js')
-rw-r--r-- | src/lfunc.js | 6 |
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() { |