Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ce877c6

Browse filesBrowse files
Uzlopakmarco-ippolito
authored andcommitted
util: fix crashing when emitting new Buffer() deprecation warning #53075
PR-URL: #53089 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent 0c24b91 commit ce877c6
Copy full SHA for ce877c6

1 file changed

+8-4Lines changed: 8 additions & 4 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/util.js‎

Copy file name to clipboardExpand all lines: lib/internal/util.js
+8-4Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const {
3737
SafeWeakRef,
3838
StringPrototypeIncludes,
3939
StringPrototypeReplace,
40+
StringPrototypeStartsWith,
4041
StringPrototypeToLowerCase,
4142
StringPrototypeToUpperCase,
4243
Symbol,
@@ -502,11 +503,14 @@ function isInsideNodeModules() {
502503
if (ArrayIsArray(stack)) {
503504
for (const frame of stack) {
504505
const filename = frame.getFileName();
505-
// If a filename does not start with / or contain \,
506-
// it's likely from Node.js core.
506+
507507
if (
508-
filename[0] !== '/' &&
509-
StringPrototypeIncludes(filename, '\\') === false
508+
filename == null ||
509+
StringPrototypeStartsWith(filename, 'node:') === true ||
510+
(
511+
filename[0] !== '/' &&
512+
StringPrototypeIncludes(filename, '\\') === false
513+
)
510514
) {
511515
continue;
512516
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.