aboutsummaryrefslogtreecommitdiff
path: root/src/lapi.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-22 15:38:45 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-22 15:38:45 +0100
commit9ff3e69b37f7b7603056b684a19b1dd8c641c8d5 (patch)
tree1a7436a107753891efe5d2f7d42314ab7c7d1736 /src/lapi.js
parenteb9ad22e7538a25ef565e93c842eef48dba2469e (diff)
downloadfengari-9ff3e69b37f7b7603056b684a19b1dd8c641c8d5.tar.gz
fengari-9ff3e69b37f7b7603056b684a19b1dd8c641c8d5.tar.bz2
fengari-9ff3e69b37f7b7603056b684a19b1dd8c641c8d5.zip
lua_copy, lua_next, luaL_argerror
Diffstat (limited to 'src/lapi.js')
-rw-r--r--src/lapi.js13
1 files changed, 12 insertions, 1 deletions
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