summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-04-19 17:47:54 +1000
committerdaurnimator <quae@daurnimator.com>2017-04-19 18:09:17 +1000
commit4d596650dff0417660874727964a32dae23dc9ea (patch)
tree9ff7a1613b47b4373dc6f5e244df969ecb40339a /src
parentd33794a4181964a729fc3e8c6eb1b7119a6d52d6 (diff)
downloadfengari-4d596650dff0417660874727964a32dae23dc9ea.tar.gz
fengari-4d596650dff0417660874727964a32dae23dc9ea.tar.bz2
fengari-4d596650dff0417660874727964a32dae23dc9ea.zip
lauxlib: Only jsstring-ify if non-null
Diffstat (limited to 'src')
-rw-r--r--src/lauxlib.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lauxlib.js b/src/lauxlib.js
index 3bf5b86..8e263fe 100644
--- a/src/lauxlib.js
+++ b/src/lauxlib.js
@@ -567,13 +567,13 @@ if (typeof require === "function") {
};
const luaL_loadfilex = function(L, filename, mode) {
- let jsfilename = lobject.jsstring(filename);
let lf = new LoadF();
let fnameindex = lapi.lua_gettop(L) + 1; /* index of filename on the stack */
if (filename === null) {
lapi.lua_pushliteral(L, "=stdin");
lf.f = process.stdin.fd;
} else {
+ let jsfilename = lobject.jsstring(filename);
lapi.lua_pushliteral(L, `@${jsfilename}`);
try {
lf.f = fs.openSync(jsfilename, "r");