Skip to content

Commit

Permalink
lib: let deps require node prefixed modules
Browse files Browse the repository at this point in the history
fixup

fixup

PR-URL: #50047
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
  • Loading branch information
KhafraDev authored Oct 6, 2023
1 parent 527589b commit 6b599a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/internal/bootstrap/realm.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,9 @@ function requireBuiltin(id) {
// Allow internal modules from dependencies to require
// other modules from dependencies by providing fallbacks.
function requireWithFallbackInDeps(request) {
if (!BuiltinModule.map.has(request)) {
if (StringPrototypeStartsWith(request, 'node:')) {
request = StringPrototypeSlice(request, 5);
} else if (!BuiltinModule.map.has(request)) {
request = `internal/deps/${request}`;
}
return requireBuiltin(request);
Expand Down

0 comments on commit 6b599a3

Please sign in to comment.