diff options
author | daurnimator <quae@daurnimator.com> | 2017-12-29 00:47:42 +1100 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-12-29 02:32:41 +1100 |
commit | f9375fcb71171d7b18190fa59ec402f7f68e26dd (patch) | |
tree | 8ebbed2fb6a89ec5a91450e959645f7625115a15 | |
parent | eb214f05b57f2fe0e980d54a0573167b20c218d8 (diff) | |
download | fengari-f9375fcb71171d7b18190fa59ec402f7f68e26dd.tar.gz fengari-f9375fcb71171d7b18190fa59ec402f7f68e26dd.tar.bz2 fengari-f9375fcb71171d7b18190fa59ec402f7f68e26dd.zip |
src/lauxlib.js: Convert default argument to luaL_optlstring on demand
-rw-r--r-- | src/lauxlib.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lauxlib.js b/src/lauxlib.js index b4d839d..8cb608d 100644 --- a/src/lauxlib.js +++ b/src/lauxlib.js @@ -325,6 +325,8 @@ const luaL_checkstring = luaL_checklstring; const luaL_optlstring = function(L, arg, def) { if (lua.lua_type(L, arg) <= 0) { + if (typeof str === "string") + def = lua.to_luastring(def); return def; } else return luaL_checklstring(L, arg); }; |