From ad7aa3169657879cc81ecadf5583c3d25177949e Mon Sep 17 00:00:00 2001 From: daurnimator Date: Fri, 12 May 2017 14:56:44 +1000 Subject: src/loadlib.js: Move closeSync inside try/catch See https://github.com/giann/fengari/commit/278fd3edb6ead6cd65c2293f823887d19e4fbc8e#commitcomment-22009497 --- src/loadlib.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/loadlib.js b/src/loadlib.js index c70e7f9..c43f498 100644 --- a/src/loadlib.js +++ b/src/loadlib.js @@ -88,12 +88,11 @@ if (!WEB) { try { fd = fs.openSync(lua.to_jsstring(filename), 'r'); + fs.closeSync(fd); } catch (e) { return false; } - fs.closeSync(fd); - return true; }; } -- cgit v1.2.3-70-g09d2