diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lauxlib.js | 6 | ||||
-rw-r--r-- | src/lstrlib.js | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lauxlib.js b/src/lauxlib.js index 90cff5c..5a13379 100644 --- a/src/lauxlib.js +++ b/src/lauxlib.js @@ -292,15 +292,15 @@ const luaL_len = function(L, idx) { lapi.lua_len(L, idx); let l = lapi.lua_tointegerx(L, -1); if (l === false) - luaL_error(L, "object length is not an integer"); + luaL_error(L, lua.to_luastring("object length is not an integer")); lapi.lua_pop(L, 1); /* remove object */ return l; }; const luaL_tolstring = function(L, idx) { - if (luaL_callmeta(L, idx, "__tostring")) { + if (luaL_callmeta(L, idx, lua.to_luastring("__tostring"))) { if (!lapi.lua_isstring(L, -1)) - luaL_error(L, "'__tostring' must return a string"); + luaL_error(L, lua.to_luastring("'__tostring' must return a string")); } else { switch(lapi.lua_type(L, idx)) { case CT.LUA_TNUMBER: diff --git a/src/lstrlib.js b/src/lstrlib.js index 9104078..90341e7 100644 --- a/src/lstrlib.js +++ b/src/lstrlib.js @@ -1,7 +1,7 @@ "use strict"; const assert = require('assert'); -const sprintf = require('sprintf'); +const sprintf = require('sprintf-js').sprintf; const lapi = require('./lapi.js'); const lauxlib = require('./lauxlib.js'); |