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: nodejs#56870
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
  • Loading branch information
jasnell authored Feb 3, 2025
1 parent c21d576 commit 2972fe9
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 2972fe9

Please sign in to comment.