diff options
| author | Benoit Giannangeli <giann008@gmail.com> | 2017-04-23 14:52:30 +0200 | 
|---|---|---|
| committer | Benoit Giannangeli <giann008@gmail.com> | 2017-04-23 14:52:30 +0200 | 
| commit | 0133e556602950f71747ef518cdaa861fe422b32 (patch) | |
| tree | 270ebdcb9dd2ad88fb93a913854bcbc3b427336c /src/lfunc.js | |
| parent | 8966842ba72fb1eef351355ead2e8950fd87141a (diff) | |
| download | fengari-0133e556602950f71747ef518cdaa861fe422b32.tar.gz fengari-0133e556602950f71747ef518cdaa861fe422b32.tar.bz2 fengari-0133e556602950f71747ef518cdaa861fe422b32.zip | |
Handle when no upvalue found
Diffstat (limited to 'src/lfunc.js')
| -rw-r--r-- | src/lfunc.js | 5 | 
1 files changed, 3 insertions, 2 deletions
| 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() { | 
