summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-08-10 20:19:20 +0200
committerGitHub <noreply@github.com>2023-08-10 20:19:20 +0200
commit69387f0b0c4ac3be4ce88f9139d141cbc7da277b (patch)
tree631300553e6bbb171c27deeec18f2662b35ed5dc
parent6b1a9761812c2f373e52684ae4be8fb939e589b7 (diff)
fix(node): don't print warning on process.dlopen.flags (#20124)
Closes https://github.com/denoland/deno/issues/20075
-rw-r--r--ext/node/polyfills/process.ts9
-rw-r--r--test_napi/common.js4
2 files changed, 7 insertions, 6 deletions
diff --git a/ext/node/polyfills/process.ts b/ext/node/polyfills/process.ts
index 2f1c2968f..4c375760d 100644
--- a/ext/node/polyfills/process.ts
+++ b/ext/node/polyfills/process.ts
@@ -292,11 +292,10 @@ function _kill(pid: number, sig: number): number {
}
}
-// TODO(bartlomieju): flags is currently not supported.
-export function dlopen(module, filename, flags) {
- if (typeof flags !== "undefined") {
- warnNotImplemented("process.dlopen doesn't support 'flags' argument");
- }
+export function dlopen(module, filename, _flags) {
+ // NOTE(bartlomieju): _flags is currently ignored, but we don't warn for it
+ // as it makes DX bad, even though it might not be needed:
+ // https://github.com/denoland/deno/issues/20075
Module._extensions[".node"](module, filename);
return module;
}
diff --git a/test_napi/common.js b/test_napi/common.js
index 5ad0e9cf3..ede045666 100644
--- a/test_napi/common.js
+++ b/test_napi/common.js
@@ -21,6 +21,8 @@ export function loadTestLibrary() {
// Internal, used in ext/node
const module = {};
- process.dlopen(module, specifier);
+ // Pass some flag, it should be ignored, but make sure it doesn't print
+ // warnings.
+ process.dlopen(module, specifier, 0);
return module.exports;
}