summaryrefslogtreecommitdiff
path: root/src/lmathlib.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-03-30 16:39:41 +1100
committerdaurnimator <quae@daurnimator.com>2018-03-30 16:42:26 +1100
commitfb3b9c3b3f0ee1a04ec264d1b40bd1cccf24a999 (patch)
tree3166cfef0f1c8cde6b6662b46791dfb66f681e3d /src/lmathlib.js
parent2f2bd7fad5342583f85e99ec67eea74fad5fafdd (diff)
parent1371afafae9144b30475262f06940c4057485d02 (diff)
downloadfengari-fb3b9c3b3f0ee1a04ec264d1b40bd1cccf24a999.tar.gz
fengari-fb3b9c3b3f0ee1a04ec264d1b40bd1cccf24a999.tar.bz2
fengari-fb3b9c3b3f0ee1a04ec264d1b40bd1cccf24a999.zip
Merge branch 'accept-jsstrings'
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 {