aboutsummaryrefslogtreecommitdiff
path: root/src/lmathlib.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lmathlib.js')
-rw-r--r--src/lmathlib.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lmathlib.js b/src/lmathlib.js
index 665fbc4..8313e93 100644
--- a/src/lmathlib.js
+++ b/src/lmathlib.js
@@ -66,13 +66,13 @@ const math_random = function(L) {
up = luaL_checkinteger(L, 2);
break;
}
- default: return luaL_error(L, to_luastring("wrong number of arguments", true));
+ default: return luaL_error(L, "wrong number of arguments");
}
/* random integer in the interval [low, up] */
- luaL_argcheck(L, low <= up, 1, to_luastring("interval is empty", true));
+ luaL_argcheck(L, low <= up, 1, "interval is empty");
luaL_argcheck(L, low >= 0 || up <= LUA_MAXINTEGER + low, 1,
- to_luastring("interval too large", true));
+ "interval too large");
r *= (up - low) + 1;
lua_pushinteger(L, Math.floor(r) + low);
@@ -213,7 +213,7 @@ const math_rad = function(L) {
const math_min = function(L) {
let n = lua_gettop(L); /* number of arguments */
let imin = 1; /* index of current minimum value */
- luaL_argcheck(L, n >= 1, 1, to_luastring("value expected", true));
+ luaL_argcheck(L, n >= 1, 1, "value expected");
for (let i = 2; i <= n; i++){
if (lua_compare(L, i, imin, LUA_OPLT))
imin = i;
@@ -225,7 +225,7 @@ const math_min = function(L) {
const math_max = function(L) {
let n = lua_gettop(L); /* number of arguments */
let imax = 1; /* index of current minimum value */
- luaL_argcheck(L, n >= 1, 1, to_luastring("value expected", true));
+ luaL_argcheck(L, n >= 1, 1, "value expected");
for (let i = 2; i <= n; i++){
if (lua_compare(L, imax, i, LUA_OPLT))
imax = i;
@@ -252,7 +252,7 @@ const math_fmod = function(L) {
let d = lua_tointeger(L, 2);
/* no special case needed for -1 in javascript */
if (d === 0) {
- luaL_argerror(L, 2, to_luastring("zero", true));
+ luaL_argerror(L, 2, "zero");
} else
lua_pushinteger(L, (lua_tointeger(L, 1) % d)|0);
} else {