From cf49a091eb7f6ec652d12aca5174a4c0ab30db46 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Wed, 24 May 2017 15:39:39 +1000 Subject: src/lapi.js: use .setfrom() when setting a TValue from a TValue --- src/lapi.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') 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; -- cgit v1.2.3-70-g09d2