Skip to content

Commit

Permalink
fix(ext/node): throw when loading cpu-features module (#25257)
Browse files Browse the repository at this point in the history
It crashes because of NAN usage, we want to trigger the fallback case in
ssh2 by throwing an error.

Fixes #25236
  • Loading branch information
littledivy authored and lucacasonato committed Aug 29, 2024
1 parent 8db5e9b commit 14e9b50
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ext/node/polyfills/01_require.js
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,9 @@ Module._extensions[".json"] = function (module, filename) {

// Native extension for .node
Module._extensions[".node"] = function (module, filename) {
if (filename.endsWith("cpufeatures.node")) {
throw new Error("Using cpu-features module is currently not supported");
}
module.exports = op_napi_open(
filename,
globalThis,
Expand Down

0 comments on commit 14e9b50

Please sign in to comment.