1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-25 00:29:09 -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 GitHub
parent 6b1a976181
commit 69387f0b0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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) {
export function dlopen(module, filename, flags) { // NOTE(bartlomieju): _flags is currently ignored, but we don't warn for it
if (typeof flags !== "undefined") { // as it makes DX bad, even though it might not be needed:
warnNotImplemented("process.dlopen doesn't support 'flags' argument"); // https://github.com/denoland/deno/issues/20075
}
Module._extensions[".node"](module, filename); Module._extensions[".node"](module, filename);
return module; return module;
} }

View file

@ -21,6 +21,8 @@ export function loadTestLibrary() {
// Internal, used in ext/node // Internal, used in ext/node
const module = {}; 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; return module.exports;
} }