diff options
author | Benoit Giannangeli <giann008@gmail.com> | 2017-03-31 11:15:46 +0200 |
---|---|---|
committer | Benoit Giannangeli <giann008@gmail.com> | 2017-03-31 11:23:06 +0200 |
commit | dbcb965525833d167370fdade4ff8da7126be8a6 (patch) | |
tree | 19c530db542e2e62907958a843da10ec604ca300 /src | |
parent | fedcb75c0fa087abcaa53a1df3304a97c4516faa (diff) | |
download | fengari-dbcb965525833d167370fdade4ff8da7126be8a6.tar.gz fengari-dbcb965525833d167370fdade4ff8da7126be8a6.tar.bz2 fengari-dbcb965525833d167370fdade4ff8da7126be8a6.zip |
Use correct sprintf package
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'); |