File tree
Expand file treeCollapse file tree2 files changed
+9
-2
lines changed Expand file treeCollapse file tree2 files changed
+9
-2
lines changed Original file line number | Diff line number | Diff line change |
---|
|
5 | 5 | RegExpExec,
|
6 | 6 | decodeURIComponent,
|
7 | 7 | } = primordials;
|
8 |
| -const { kEmptyObject } = require('internal/util'); |
| 8 | +const { |
| 9 | +kEmptyObject, |
| 10 | +} = require('internal/util'); |
9 | 11 |
|
10 | 12 | const { defaultGetFormat } = require('internal/modules/esm/get_format');
|
11 | 13 | const { 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) {
|
477 | 477 |
|
478 | 478 | const kNodeModulesRE = /^(?:.*)[\\/]node_modules[\\/]/;
|
479 | 479 |
|
| 480 | +function isUnderNodeModules(filename) { |
| 481 | +return filename && (RegExpExec(kNodeModulesRE, filename) !== null); |
| 482 | +} |
| 483 | + |
480 | 484 | let getStructuredStackImpl;
|
481 | 485 |
|
482 | 486 | function lazyGetStructuredStack() {
|
@@ -524,7 +528,7 @@ function isInsideNodeModules() {
|
524 | 528 | ) {
|
525 | 529 | continue;
|
526 | 530 | }
|
527 |
| -return RegExpExec(kNodeModulesRE, filename) !== null; |
| 531 | +return isUnderNodeModules(filename); |
528 | 532 | }
|
529 | 533 | }
|
530 | 534 | return false;
|
@@ -913,6 +917,7 @@ module.exports = {
|
913 | 917 | isArrayBufferDetached,
|
914 | 918 | isError,
|
915 | 919 | isInsideNodeModules,
|
| 920 | +isUnderNodeModules, |
916 | 921 | join,
|
917 | 922 | lazyDOMException,
|
918 | 923 | lazyDOMExceptionClass,
|
|
You can’t perform that action at this time.
0 commit comments