@@ -446,7 +446,7 @@ it('native function', async function() {
446446 '[1].map(function(x) { throw new Error(x); });'
447447 ] , [
448448 'Error: 1' ,
449- re `[/\\].original-${ id } .js` ,
449+ re `${ stackFramePathStartsWith ( ) } (?:.* [/\\])? .original-${ id } .js` ,
450450 / 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 > ) \) /
451451 ] ) ;
452452} ) ;
@@ -475,7 +475,7 @@ it('throw in Timeout with empty source map', function(done) {
475475 ' throw new Error("this is the error")' ,
476476 '})'
477477 ] , [
478- re `[/\\].generated-${ id } .${ extension } :3$` ,
478+ re `${ stackFramePathStartsWith ( ) } (?:.* [/\\])? .generated-${ id } .${ extension } :3$` ,
479479 ' throw new Error("this is the error")' ,
480480 / ^ \^ $ / ,
481481 'Error: this is the error' ,
@@ -544,7 +544,7 @@ it('default options', function(done) {
544544 'process.nextTick(foo);' ,
545545 'process.nextTick(function() { process.exit(1); });'
546546 ] , [
547- re `[/\\].original-${ id } \.js:1$` ,
547+ re `${ stackFramePathStartsWith ( ) } (?:.* [/\\])? .original-${ id } \.js:1$` ,
548548 'this is the original code' ,
549549 '^' ,
550550 'Error: this is the error' ,
@@ -559,7 +559,7 @@ it('handleUncaughtExceptions is true', function(done) {
559559 'require("./source-map-support").install({ handleUncaughtExceptions: true });' ,
560560 'process.nextTick(foo);'
561561 ] , [
562- re `[/\\].original-${ id } \.js:1$` ,
562+ re `${ stackFramePathStartsWith ( ) } (?:.* [/\\])? .original-${ id } \.js:1$` ,
563563 'this is the original code' ,
564564 '^' ,
565565 'Error: this is the error' ,
@@ -574,7 +574,7 @@ it('handleUncaughtExceptions is false', function(done) {
574574 'require("./source-map-support").install({ handleUncaughtExceptions: false });' ,
575575 'process.nextTick(foo);'
576576 ] , [
577- re `[/\\].generated-${ id } .${ extension } :2$` ,
577+ re `${ stackFramePathStartsWith ( ) } (?:.* [/\\])? .generated-${ id } .${ extension } :2$` ,
578578 'function foo() { throw new Error("this is the error"); }' ,
579579
580580 ' ^' ,
@@ -591,7 +591,7 @@ it('default options with empty source map', function(done) {
591591 'require("./source-map-support").install();' ,
592592 'process.nextTick(foo);'
593593 ] , [
594- re `[/\\].generated-${ id } .${ extension } :2$` ,
594+ re `${ stackFramePathStartsWith ( ) } (?:.* [/\\])? .generated-${ id } .${ extension } :2$` ,
595595 'function foo() { throw new Error("this is the error"); }' ,
596596 ' ^' ,
597597 'Error: this is the error' ,
@@ -606,7 +606,7 @@ it('default options with source map with gap', function(done) {
606606 'require("./source-map-support").install();' ,
607607 'process.nextTick(foo);'
608608 ] , [
609- re `[/\\].generated-${ id } .${ extension } :2$` ,
609+ re `${ stackFramePathStartsWith ( ) } (?:.* [/\\])? .generated-${ id } .${ extension } :2$` ,
610610 'function foo() { throw new Error("this is the error"); }' ,
611611 ' ^' ,
612612 'Error: this is the error' ,
@@ -637,7 +637,7 @@ it('sourcesContent', function(done) {
637637 'process.nextTick(foo);' ,
638638 'process.nextTick(function() { process.exit(1); });'
639639 ] , [
640- re `[/\\]original-${ id } \.js:1002$` ,
640+ re `${ stackFramePathStartsWith ( ) } (?:.* [/\\])? original-${ id } \.js:1002$` ,
641641 ' line 2' ,
642642 ' ^' ,
643643 'Error: this is the error' ,
@@ -851,7 +851,7 @@ it('supports multiple instances', function(done) {
851851 ' process.nextTick(function() { process.exit(1); });' ,
852852 '})();'
853853 ] , [
854- re `[/\\].original2-${ id } \.js:1$` ,
854+ re `${ stackFramePathStartsWith ( ) } (?:.* [/\\])? .original2-${ id } \.js:1$` ,
855855 'this is some other original code' ,
856856 '^' ,
857857 'Error: this is the error' ,
0 commit comments