aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/loadlib.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/loadlib.js b/src/loadlib.js
index 2cd173f..8ae758b 100644
--- a/src/loadlib.js
+++ b/src/loadlib.js
@@ -118,15 +118,12 @@ if (!WEB) {
const fs = require('fs');
readable = function(filename) {
- let fd = false;
-
try {
- fd = fs.openSync(lua.to_jsstring(filename), 'r');
+ let fd = fs.openSync(Uint8Array.from(filename), 'r');
fs.closeSync(fd);
} catch (e) {
return false;
}
-
return true;
};
} else {