Merge pull request #905 from ahlinc/contrib/master

Fix hiding problems in ./build/Debug/tree_sitter_*_binding.node
This commit is contained in:
Max Brunsfeld 2021-01-29 08:18:23 -08:00 committed by GitHub
commit c982d86556
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,10 +1,14 @@
try {
module.exports = require("./build/Release/tree_sitter_PARSER_NAME_binding");
} catch (error) {
try {
module.exports = require("./build/Debug/tree_sitter_PARSER_NAME_binding");
} catch (_) {
if (error.code !== 'MODULE_NOT_FOUND')
throw error
else try {
module.exports = require("./build/Debug/tree_sitter_PARSER_NAME_binding");
} catch (error2) {
if (error2.code === 'MODULE_NOT_FOUND')
throw error
throw error2
}
}