diff options
author | daurnimator <quae@daurnimator.com> | 2017-05-04 16:18:29 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-05-04 16:18:29 +1000 |
commit | 0bd95f16e2af2028f0a5c9b41478bca74f16cc99 (patch) | |
tree | cb6e1b156634f80417fcd6e0f965869cb61c5b25 /src/lapi.js | |
parent | 928d79618605c35f8f6659c9683110211758fb24 (diff) | |
download | fengari-0bd95f16e2af2028f0a5c9b41478bca74f16cc99.tar.gz fengari-0bd95f16e2af2028f0a5c9b41478bca74f16cc99.tar.bz2 fengari-0bd95f16e2af2028f0a5c9b41478bca74f16cc99.zip |
Add lua_pushfstring and lua_pushvstring
Diffstat (limited to 'src/lapi.js')
-rw-r--r-- | src/lapi.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lapi.js b/src/lapi.js index 15cf2ef..4516fcc 100644 --- a/src/lapi.js +++ b/src/lapi.js @@ -239,6 +239,16 @@ const lua_pushstring = function (L, s) { return s; }; +const lua_pushvfstring = function (L, fmt, argp) { + assert(Array.isArray(fmt)); + return lobject.luaO_pushvfstring(L, fmt, argp); +}; + +const lua_pushfstring = function (L, fmt, ...argp) { + assert(Array.isArray(fmt)); + return lobject.luaO_pushvfstring(L, fmt, argp); +}; + const lua_pushliteral = function (L, s) { assert(typeof s === "string" || s === undefined || s === null, "lua_pushliteral expects a JS string"); @@ -1065,6 +1075,8 @@ module.exports.lua_pushlstring = lua_pushlstring; module.exports.lua_pushnil = lua_pushnil; module.exports.lua_pushnumber = lua_pushnumber; module.exports.lua_pushstring = lua_pushstring; +module.exports.lua_pushfstring = lua_pushfstring; +module.exports.lua_pushvfstring = lua_pushvfstring; module.exports.lua_pushthread = lua_pushthread; module.exports.lua_pushvalue = lua_pushvalue; module.exports.lua_rawequal = lua_rawequal; |