summaryrefslogtreecommitdiff
path: root/src/loadlib.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-12 14:56:44 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-12 14:56:44 +1000
commitad7aa3169657879cc81ecadf5583c3d25177949e (patch)
tree853d9085e9fde9bd3b46b393dd780148d09de64a /src/loadlib.js
parente5dda5d1fcc3f18ba3a5d809c96618265c7dc2a3 (diff)
downloadfengari-ad7aa3169657879cc81ecadf5583c3d25177949e.tar.gz
fengari-ad7aa3169657879cc81ecadf5583c3d25177949e.tar.bz2
fengari-ad7aa3169657879cc81ecadf5583c3d25177949e.zip
src/loadlib.js: Move closeSync inside try/catch
See https://github.com/giann/fengari/commit/278fd3edb6ead6cd65c2293f823887d19e4fbc8e#commitcomment-22009497
Diffstat (limited to 'src/loadlib.js')
-rw-r--r--src/loadlib.js3
1 files changed, 1 insertions, 2 deletions
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;
};
}