From 4a03542f6ebc8c6d4ed624bc0d30f5a7148a279b Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Fri, 17 Feb 2017 10:05:56 +0100 Subject: Fixed UpVal.setval so that it update v index and v value on the stack --- src/lfunc.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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() { -- cgit v1.2.3-54-g00ecf