Skip to content

Commit 1d24abc

Browse files
authored
fix: use StringPrototypeToString
1 parent 57f5686 commit 1d24abc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/modules/cjs/loader.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const {
6464
StringPrototypeSlice,
6565
StringPrototypeSplit,
6666
StringPrototypeStartsWith,
67+
StringPrototypeToString
6768
} = primordials;
6869

6970
// Map used to store CJS parsing data.
@@ -1295,7 +1296,7 @@ Module.syncBuiltinESMExports = function syncBuiltinESMExports() {
12951296
};
12961297

12971298
Module.isBuiltIn = function isBuiltIn(moduleName) {
1298-
moduleName = StringPrototypeReplace(moduleName, /^node:/, '');
1299+
moduleName = StringPrototypeReplace(StringPrototypeToString(moduleName), /^node:/, '');
12991300
return ArrayPrototypeIncludes(Module.builtinModules, moduleName);
13001301
};
13011302

0 commit comments

Comments
 (0)