@@ -446,7 +446,7 @@ it('native function', async function() {
446
446
'[1].map(function(x) { throw new Error(x); });'
447
447
] , [
448
448
'Error: 1' ,
449
- re `[/\\].original-${ id } .js` ,
449
+ re `${ stackFramePathStartsWith ( ) } (?:.* [/\\])? .original-${ id } .js` ,
450
450
/ a t A r r a y \. m a p \( ( n a t i v e | < a n o n y m o u s > ) \) /
451
451
] ) ;
452
452
} ) ;
@@ -475,7 +475,7 @@ it('throw in Timeout with empty source map', function(done) {
475
475
' throw new Error("this is the error")' ,
476
476
'})'
477
477
] , [
478
- re `[/\\].generated-${ id } .${ extension } :3$` ,
478
+ re `${ stackFramePathStartsWith ( ) } (?:.* [/\\])? .generated-${ id } .${ extension } :3$` ,
479
479
' throw new Error("this is the error")' ,
480
480
/ ^ \^ $ / ,
481
481
'Error: this is the error' ,
@@ -544,7 +544,7 @@ it('default options', function(done) {
544
544
'process.nextTick(foo);' ,
545
545
'process.nextTick(function() { process.exit(1); });'
546
546
] , [
547
- re `[/\\].original-${ id } \.js:1$` ,
547
+ re `${ stackFramePathStartsWith ( ) } (?:.* [/\\])? .original-${ id } \.js:1$` ,
548
548
'this is the original code' ,
549
549
'^' ,
550
550
'Error: this is the error' ,
@@ -559,7 +559,7 @@ it('handleUncaughtExceptions is true', function(done) {
559
559
'require("./source-map-support").install({ handleUncaughtExceptions: true });' ,
560
560
'process.nextTick(foo);'
561
561
] , [
562
- re `[/\\].original-${ id } \.js:1$` ,
562
+ re `${ stackFramePathStartsWith ( ) } (?:.* [/\\])? .original-${ id } \.js:1$` ,
563
563
'this is the original code' ,
564
564
'^' ,
565
565
'Error: this is the error' ,
@@ -574,7 +574,7 @@ it('handleUncaughtExceptions is false', function(done) {
574
574
'require("./source-map-support").install({ handleUncaughtExceptions: false });' ,
575
575
'process.nextTick(foo);'
576
576
] , [
577
- re `[/\\].generated-${ id } .${ extension } :2$` ,
577
+ re `${ stackFramePathStartsWith ( ) } (?:.* [/\\])? .generated-${ id } .${ extension } :2$` ,
578
578
'function foo() { throw new Error("this is the error"); }' ,
579
579
580
580
' ^' ,
@@ -591,7 +591,7 @@ it('default options with empty source map', function(done) {
591
591
'require("./source-map-support").install();' ,
592
592
'process.nextTick(foo);'
593
593
] , [
594
- re `[/\\].generated-${ id } .${ extension } :2$` ,
594
+ re `${ stackFramePathStartsWith ( ) } (?:.* [/\\])? .generated-${ id } .${ extension } :2$` ,
595
595
'function foo() { throw new Error("this is the error"); }' ,
596
596
' ^' ,
597
597
'Error: this is the error' ,
@@ -606,7 +606,7 @@ it('default options with source map with gap', function(done) {
606
606
'require("./source-map-support").install();' ,
607
607
'process.nextTick(foo);'
608
608
] , [
609
- re `[/\\].generated-${ id } .${ extension } :2$` ,
609
+ re `${ stackFramePathStartsWith ( ) } (?:.* [/\\])? .generated-${ id } .${ extension } :2$` ,
610
610
'function foo() { throw new Error("this is the error"); }' ,
611
611
' ^' ,
612
612
'Error: this is the error' ,
@@ -637,7 +637,7 @@ it('sourcesContent', function(done) {
637
637
'process.nextTick(foo);' ,
638
638
'process.nextTick(function() { process.exit(1); });'
639
639
] , [
640
- re `[/\\]original-${ id } \.js:1002$` ,
640
+ re `${ stackFramePathStartsWith ( ) } (?:.* [/\\])? original-${ id } \.js:1002$` ,
641
641
' line 2' ,
642
642
' ^' ,
643
643
'Error: this is the error' ,
@@ -851,7 +851,7 @@ it('supports multiple instances', function(done) {
851
851
' process.nextTick(function() { process.exit(1); });' ,
852
852
'})();'
853
853
] , [
854
- re `[/\\].original2-${ id } \.js:1$` ,
854
+ re `${ stackFramePathStartsWith ( ) } (?:.* [/\\])? .original2-${ id } \.js:1$` ,
855
855
'this is some other original code' ,
856
856
'^' ,
857
857
'Error: this is the error' ,
0 commit comments