From dbcb965525833d167370fdade4ff8da7126be8a6 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Fri, 31 Mar 2017 11:15:46 +0200 Subject: Use correct sprintf package --- src/lauxlib.js | 6 +++--- src/lstrlib.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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'); -- cgit v1.2.3-70-g09d2