From 44238955fb3c70074e7bc8191efdf3e0143bed16 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Wed, 28 Aug 2024 18:03:15 +0530 Subject: 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 --- ext/node/polyfills/01_require.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ext') 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, -- cgit v1.2.3