Skip to content

Commit

Permalink
fixup! fixup! module: do less CJS module loader initialization at run…
Browse files Browse the repository at this point in the history
… time
  • Loading branch information
joyeecheung committed Mar 30, 2023
1 parent 4d43578 commit b3e68cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/modules/cjs/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -917,11 +917,11 @@ Module._load = function(request, parent, isMain) {
// Slice 'node:' prefix
const id = StringPrototypeSlice(request, 5);

const module = loadBuiltinModule(id, request);
if (!BuiltinModule.canBeRequiredByUsers(id)) {
throw new ERR_UNKNOWN_BUILTIN_MODULE(request);
}

const module = loadBuiltinModule(id, request);
return module.exports;
}

Expand Down

0 comments on commit b3e68cc

Please sign in to comment.