File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 55 RegExpPrototypeExec,
66 decodeURIComponent,
77} = primordials ;
8- const { kEmptyObject } = require ( 'internal/util' ) ;
8+ const {
9+ kEmptyObject,
10+ } = require ( 'internal/util' ) ;
911
1012const { defaultGetFormat } = require ( 'internal/modules/esm/get_format' ) ;
1113const { validateAttributes, emitImportAssertionWarning } = require ( 'internal/modules/esm/assert' ) ;
Original file line number Diff line number Diff line change @@ -477,6 +477,10 @@ function spliceOne(list, index) {
477477
478478const kNodeModulesRE = / ^ (?: .* ) [ \\ / ] n o d e _ m o d u l e s [ \\ / ] / ;
479479
480+ function isUnderNodeModules ( filename ) {
481+ return filename && ( RegExpPrototypeExec ( kNodeModulesRE , filename ) !== null ) ;
482+ }
483+
480484let getStructuredStackImpl ;
481485
482486function lazyGetStructuredStack ( ) {
@@ -524,7 +528,7 @@ function isInsideNodeModules() {
524528 ) {
525529 continue ;
526530 }
527- return RegExpPrototypeExec ( kNodeModulesRE , filename ) !== null ;
531+ return isUnderNodeModules ( filename ) ;
528532 }
529533 }
530534 return false ;
@@ -913,6 +917,7 @@ module.exports = {
913917 isArrayBufferDetached,
914918 isError,
915919 isInsideNodeModules,
920+ isUnderNodeModules,
916921 join,
917922 lazyDOMException,
918923 lazyDOMExceptionClass,
You can’t perform that action at this time.
0 commit comments