summaryrefslogtreecommitdiff
path: root/src/lapi.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-24 15:39:39 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-24 15:45:33 +1000
commitcf49a091eb7f6ec652d12aca5174a4c0ab30db46 (patch)
treece151738dd0f1487d01e218c32ea256acfbd4b88 /src/lapi.js
parentb56f0ec3154d8644ed5c62cd7a4aee7139874c1c (diff)
downloadfengari-cf49a091eb7f6ec652d12aca5174a4c0ab30db46.tar.gz
fengari-cf49a091eb7f6ec652d12aca5174a4c0ab30db46.tar.bz2
fengari-cf49a091eb7f6ec652d12aca5174a4c0ab30db46.zip
src/lapi.js: use .setfrom() when setting a TValue from a TValue
Diffstat (limited to 'src/lapi.js')
-rw-r--r--src/lapi.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/lapi.js b/src/lapi.js
index ae9fa89..44ed1ad 100644
--- a/src/lapi.js
+++ b/src/lapi.js
@@ -567,11 +567,8 @@ const lua_setupvalue = function(L, funcindex, n) {
if (aux) {
let name = aux.name;
let val = aux.val;
-
L.top--;
- val.type = L.stack[L.top].type;
- val.value = L.stack[L.top].value;
-
+ val.setfrom(L.stack[L.top]);
return name;
}
return null;