From 7ebe292cc79f580246d365cd0da93f80294b48f0 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Fri, 18 Aug 2017 10:53:56 +1000 Subject: src/lauxlib.js: Don't index possibly missing global 'process' --- src/lauxlib.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/lauxlib.js') diff --git a/src/lauxlib.js b/src/lauxlib.js index 9a6666a..68a975d 100644 --- a/src/lauxlib.js +++ b/src/lauxlib.js @@ -846,11 +846,13 @@ const luaL_dofile = function(L, filename) { }; const lua_writestringerror = function(s) { - if (process.stderr) process.stderr.write(s); - else console.error(s); + if (WEB) { + process.stderr.write(s); + } else { + console.error(s); + } }; - const luaL_checkversion = function(L) { let ver = lua.LUA_VERSION_NUM; let sz = LUAL_NUMSIZES; -- cgit v1.2.3-54-g00ecf