1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-24 08:09:08 -05:00

fix(node): don't print warning on process.dlopen.flags (#20124)

Closes https://github.com/denoland/deno/issues/20075
This commit is contained in:
Bartek Iwańczuk 2023-08-10 20:19:20 +02:00 committed by Divy Srivastava
parent 1a1283fa4d
commit 5515cee539
2 changed files with 7 additions and 6 deletions

View file

@ -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;
}

View file

@ -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;
}