Skip to content

Commit

Permalink
fix(node): don't print warning on process.dlopen.flags (denoland#20124)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju committed Aug 10, 2023
1 parent 6b1a976 commit 69387f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 4 additions & 5 deletions ext/node/polyfills/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 3 additions & 1 deletion test_napi/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 69387f0

Please sign in to comment.