diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2024-08-28 18:03:15 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-28 18:03:15 +0530 |
commit | 44238955fb3c70074e7bc8191efdf3e0143bed16 (patch) | |
tree | 2e2fa7416ebba3a331dc72500131ee487858d14c | |
parent | 97d1635343dc6e93c8dcf4b116922de5b9c57af3 (diff) |
fix(ext/node): throw when loading `cpu-features` module (#25257)
It crashes because of NAN usage, we want to trigger the fallback case in
ssh2 by throwing an error.
Fixes https://github.com/denoland/deno/issues/25236
-rw-r--r-- | ext/node/polyfills/01_require.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/node/polyfills/01_require.js b/ext/node/polyfills/01_require.js index 7eb549134..c29073901 100644 --- a/ext/node/polyfills/01_require.js +++ b/ext/node/polyfills/01_require.js @@ -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, |