diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/bindings.js b/bindings.js index 226b37f..3ad138d 100644 --- a/bindings.js +++ b/bindings.js @@ -81,6 +81,11 @@ function bindings(opts) { if (!opts.module_root) { opts.module_root = exports.getRoot(exports.getFileName()); } + + // Add the user defined tries + if (opts.userDefinedTries) { + opts.try = opts.try.concat(opts.userDefinedTries); + } // Ensure the given bindings name ends with .node if (path.extname(opts.bindings) != '.node') { @@ -155,7 +160,7 @@ exports.getFileName = function getFileName(calling_file) { Error.prepareStackTrace = function(e, st) { for (var i = 0, l = st.length; i < l; i++) { fileName = st[i].getFileName(); - if (fileName !== __filename) { + if (fileName !== undefined && fileName !== __filename) { if (calling_file) { if (fileName !== calling_file) { return; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..09b4c12 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "bindings", + "version": "1.5.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + } + } +}