From 0133e556602950f71747ef518cdaa861fe422b32 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Sun, 23 Apr 2017 14:52:30 +0200 Subject: Handle when no upvalue found --- src/lfunc.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lfunc.js') diff --git a/src/lfunc.js b/src/lfunc.js index bc88702..bde96d7 100644 --- a/src/lfunc.js +++ b/src/lfunc.js @@ -43,9 +43,10 @@ class UpVal { } setval(L, ra) { + let o = L.stack[ra]; if (this.v !== null) { - this.L.stack[this.v] = L.stack[ra]; - } else this.u.value = L.stack[ra]; + this.L.stack[this.v] = new lobject.TValue(o.type, o.value); + } else this.u.value = new lobject.TValue(o.type, o.value); } isopen() { -- cgit v1.2.3-54-g00ecf