Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
module: exclude node:ffi from builtinModules when flag is disabled
Module.builtinModules is supposed to only list modules
that are accessible to user code.
node:ffi requires --experimental-ffi to be required,
so filter it out when the flag is not set,
mirroring the existing handling for --experimental-quic.

Refs: #63137 (comment)

Signed-off-by: Jordan Harband <ljharb@gmail.com>
  • Loading branch information
ljharb committed May 6, 2026
commit 999efeba9258642dd85a1a544801f7218f21426f
3 changes: 3 additions & 0 deletions lib/internal/modules/cjs/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,9 @@ function initializeCJS() {
if (!getOptionValue('--experimental-quic')) {
modules = modules.filter((i) => i !== 'node:quic');
}
if (!getOptionValue('--experimental-ffi')) {
modules = modules.filter((i) => i !== 'node:ffi');
}
Module.builtinModules = ObjectFreeze(modules);

initializeCjsConditions();
Expand Down
Loading