From 4105fee42aa927c4da8ddd7b2e51b9f55202ddeb Mon Sep 17 00:00:00 2001 From: daurnimator Date: Wed, 19 Apr 2017 17:46:17 +1000 Subject: lua-cli: Pass null to luaL_loadfile for stdin --- tests/manual-tests/lua-cli.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/manual-tests/lua-cli.js b/tests/manual-tests/lua-cli.js index 5bbf5cd..f11e833 100755 --- a/tests/manual-tests/lua-cli.js +++ b/tests/manual-tests/lua-cli.js @@ -208,8 +208,10 @@ const handle_script = function(L, argv) { let fname = argv[0]; let status; if (fname === "-" && argv[-1] !== "--") - fname = void 0; /* stdin */ - status = lauxlib.luaL_loadfile(L, lua.to_luastring(fname)); + fname = null; /* stdin */ + else + fname = lua.to_luastring(fname); + status = lauxlib.luaL_loadfile(L, fname); if (status === lua.thread_status.LUA_OK) { let n = pushargs(L); /* push arguments to script */ status = docall(L, n, lua.LUA_MULTRET); -- cgit v1.2.3-70-g09d2