From 9ff3e69b37f7b7603056b684a19b1dd8c641c8d5 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Wed, 22 Feb 2017 15:38:45 +0100 Subject: lua_copy, lua_next, luaL_argerror --- src/lapi.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/lapi.js') diff --git a/src/lapi.js b/src/lapi.js index 76dee1b..625608b 100644 --- a/src/lapi.js +++ b/src/lapi.js @@ -149,6 +149,12 @@ const lua_rotate = function(L, idx, n) { reverse(L, pIdx, L.top - 1); }; +const lua_copy = function(L, fromidx, toidx) { + let fr = index2addr_(L, fromidx); + let to = index2addr_(L, toidx); + L.stack[to] = fr; +}; + const lua_remove = function(L, idx) { lua_rotate(L, idx, -1); lua_pop(L, 1); @@ -647,6 +653,10 @@ const lua_error = function(L) { ldebug.luaG_errormsg(L); }; +const lua_next = function(L, idx) { + +}; + const lua_concat = function(L, n) { assert(n < L.top - L.ci.funcOff, "not enough elements in the stack"); if (n >= 2) @@ -729,4 +739,5 @@ module.exports.lua_insert = lua_insert; module.exports.lua_gc = lua_gc; module.exports.lua_getallocf = lua_getallocf; module.exports.lua_getextraspace = lua_getextraspace; -module.exports.lua_stringtonumber = lua_stringtonumber; \ No newline at end of file +module.exports.lua_stringtonumber = lua_stringtonumber; +module.exports.lua_copy = lua_copy; \ No newline at end of file -- cgit v1.2.3-54-g00ecf