Skip to content

Commit

Permalink
lib: filter node:quic from builtinModules when flag not used
Browse files Browse the repository at this point in the history
PR-URL: #56870
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
  • Loading branch information
jasnell authored and targos committed Feb 5, 2025
1 parent 94a0237 commit 3b305f2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/internal/modules/cjs/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,11 @@ Module.isBuiltin = BuiltinModule.isBuiltin;
function initializeCJS() {
// This need to be done at runtime in case --expose-internals is set.

Module.builtinModules = ObjectFreeze(BuiltinModule.getAllBuiltinModuleIds());
let modules = Module.builtinModules = BuiltinModule.getAllBuiltinModuleIds();
if (!getOptionValue('--experimental-quic')) {
modules = modules.filter((i) => i !== 'node:quic');
}
Module.builtinModules = ObjectFreeze(modules);

initializeCjsConditions();

Expand Down

0 comments on commit 3b305f2

Please sign in to comment.