summaryrefslogtreecommitdiff
path: root/src/lauxlib.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-24 15:05:44 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-24 15:53:08 +0100
commit0a006ad403733a85abe5be3f242c0264a4556afb (patch)
tree008b1cf32172a0fc17ddf2ff369a1b77e1618bc4 /src/lauxlib.js
parentfc79b2ae7a85af1b892a103340b9465274153c60 (diff)
downloadfengari-0a006ad403733a85abe5be3f242c0264a4556afb.tar.gz
fengari-0a006ad403733a85abe5be3f242c0264a4556afb.tar.bz2
fengari-0a006ad403733a85abe5be3f242c0264a4556afb.zip
math.abs, math.sin, math.cos, math.tan, math.asin, math.acos, math.atan
Diffstat (limited to 'src/lauxlib.js')
-rw-r--r--src/lauxlib.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lauxlib.js b/src/lauxlib.js
index 3774309..728469a 100644
--- a/src/lauxlib.js
+++ b/src/lauxlib.js
@@ -179,6 +179,13 @@ const interror = function(L, arg) {
tag_error(L, arg, CT.LUA_TNUMBER);
};
+const luaL_checknumber = function(L, arg) {
+ let d = lapi.lua_tonumber(L, arg);
+ if (d === false)
+ tag_error(L, arg, CT.LUA_TNUMBER);
+ return d;
+};
+
const luaL_checkinteger = function(L, arg) {
let d = lapi.lua_tointeger(L, arg);
if (d === false)
@@ -356,17 +363,18 @@ const luaL_newlib = function(L, l) {
};
module.exports.LUA_LOADED_TABLE = LUA_LOADED_TABLE;
+module.exports.luaL_Buffer = luaL_Buffer;
module.exports.luaL_addlstring = luaL_addlstring;
module.exports.luaL_addstring = luaL_addstring;
module.exports.luaL_addvalue = luaL_addvalue;
module.exports.luaL_argcheck = luaL_argcheck;
module.exports.luaL_argerror = luaL_argerror;
-module.exports.luaL_Buffer = luaL_Buffer;
module.exports.luaL_buffinit = luaL_buffinit;
module.exports.luaL_callmeta = luaL_callmeta;
module.exports.luaL_checkany = luaL_checkany;
module.exports.luaL_checkinteger = luaL_checkinteger;
module.exports.luaL_checklstring = luaL_checklstring;
+module.exports.luaL_checknumber = luaL_checknumber;
module.exports.luaL_checkstack = luaL_checkstack;
module.exports.luaL_checktype = luaL_checktype;
module.exports.luaL_error = luaL_error;