From 4d596650dff0417660874727964a32dae23dc9ea Mon Sep 17 00:00:00 2001 From: daurnimator Date: Wed, 19 Apr 2017 17:47:54 +1000 Subject: lauxlib: Only jsstring-ify if non-null --- src/lauxlib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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"); -- cgit v1.2.3-70-g09d2