@@ -278,7 +278,7 @@ it('throw with empty source map', function() {
278278 'throw new Error("test");'
279279 ] , [
280280 'Error: test' ,
281- / ^ a t O b j e c t \. e x p o r t s \. t e s t \( (?: .* [ / \\ ] ) ? .g e n e r a t e d .j s : 1 : 3 4 \) $ /
281+ / ^ a t O b j e c t \. e x p o r t s \. t e s t \( (?: .* [ / \\ ] ) ? \ .g e n e r a t e d .j s : 1 : 3 4 \) $ /
282282 ] ) ;
283283} ) ;
284284
@@ -293,7 +293,7 @@ it('throw in Timeout with empty source map', function(done) {
293293 ' throw new Error("this is the error")' ,
294294 / ^ \^ $ / ,
295295 'Error: this is the error' ,
296- / ^ a t ( ( n u l l ) | ( T i m e o u t ) ) \. _ o n T i m e o u t \( (?: .* [ / \\ ] ) ? .g e n e r a t e d .j s : 3 : 1 1 \) $ /
296+ / ^ a t ( ( n u l l ) | ( T i m e o u t ) ) \. _ o n T i m e o u t \( (?: .* [ / \\ ] ) ? .g e n e r a t e d \ .j s : 3 : 1 1 \) $ /
297297 ] ) ;
298298} ) ;
299299
@@ -302,7 +302,7 @@ it('throw with source map with gap', function() {
302302 'throw new Error("test");'
303303 ] , [
304304 'Error: test' ,
305- / ^ a t O b j e c t \. e x p o r t s \. t e s t \( (?: .* [ / \\ ] ) ? .g e n e r a t e d .j s : 1 : 3 4 \) $ /
305+ / ^ a t O b j e c t \. e x p o r t s \. t e s t \( (?: .* [ / \\ ] ) ? \ .g e n e r a t e d \ .j s : 1 : 3 4 \) $ /
306306 ] ) ;
307307} ) ;
308308
@@ -311,7 +311,7 @@ it('sourcesContent with data URL', function() {
311311 'throw new Error("test");'
312312 ] , [
313313 'Error: test' ,
314- / ^ a t O b j e c t \. e x p o r t s \. t e s t \( (?: .* [ / \\ ] ) ? o r i g i n a l .j s : 1 0 0 1 : 5 \) $ /
314+ / ^ a t O b j e c t \. e x p o r t s \. t e s t \( (?: .* [ / \\ ] ) ? o r i g i n a l \ .j s : 1 0 0 1 : 5 \) $ /
315315 ] ) ;
316316} ) ;
317317
@@ -321,7 +321,27 @@ it('finds the last sourceMappingURL', function() {
321321 'throw new Error("test");'
322322 ] , [
323323 'Error: test' ,
324- / ^ a t O b j e c t \. e x p o r t s \. t e s t \( (?: .* [ / \\ ] ) ? o r i g i n a l .j s : 1 0 0 2 : 5 \) $ /
324+ / ^ a t O b j e c t \. e x p o r t s \. t e s t \( (?: .* [ / \\ ] ) ? o r i g i n a l \. j s : 1 0 0 2 : 5 \) $ /
325+ ] ) ;
326+ } ) ;
327+
328+ it ( 'maps original name from source' , function ( ) {
329+ var sourceMap = createEmptySourceMap ( ) ;
330+ sourceMap . addMapping ( {
331+ generated : { line : 2 , column : 8 } ,
332+ original : { line : 1000 , column : 10 } ,
333+ source : '.original.js' ,
334+ name : 'myOriginalName'
335+ } ) ;
336+ compareStackTrace ( sourceMap , [
337+ 'function foo() {' ,
338+ ' throw new Error("test");' ,
339+ '}' ,
340+ 'foo();'
341+ ] , [
342+ 'Error: test' ,
343+ / ^ a t m y O r i g i n a l N a m e \( (?: .* [ / \\ ] ) ? \. o r i g i n a l .j s : 1 0 0 0 : 1 1 \) $ / ,
344+ / ^ a t O b j e c t \. e x p o r t s \. t e s t \( (?: .* [ / \\ ] ) ? \. g e n e r a t e d .j s : 4 : 1 \) $ /
325345 ] ) ;
326346} ) ;
327347
@@ -337,7 +357,7 @@ it('default options', function(done) {
337357 'this is the original code' ,
338358 '^' ,
339359 'Error: this is the error' ,
340- / ^ a t f o o \( (?: .* [ / \\ ] ) ? .o r i g i n a l \. j s : 1 : 1 \) $ /
360+ / ^ a t f o o \( (?: .* [ / \\ ] ) ? \ .o r i g i n a l \. j s : 1 : 1 \) $ /
341361 ] ) ;
342362} ) ;
343363
@@ -352,7 +372,7 @@ it('handleUncaughtExceptions is true', function(done) {
352372 'this is the original code' ,
353373 '^' ,
354374 'Error: this is the error' ,
355- / ^ a t f o o \( (?: .* [ / \\ ] ) ? .o r i g i n a l \. j s : 1 : 1 \) $ /
375+ / ^ a t f o o \( (?: .* [ / \\ ] ) ? \ .o r i g i n a l \. j s : 1 : 1 \) $ /
356376 ] ) ;
357377} ) ;
358378
@@ -414,7 +434,7 @@ it('specifically requested error source', function(done) {
414434 'process.on("uncaughtException", function (e) { console.log("SRC:" + sms.getErrorSource(e)); });' ,
415435 'process.nextTick(foo);'
416436 ] , [
417- / ^ S R C : .* [ / \\ ] .o r i g i n a l .j s : 1 $ / ,
437+ / ^ S R C : .* [ / \\ ] \ .o r i g i n a l \ .j s : 1 $ / ,
418438 'this is the original code' ,
419439 '^'
420440 ] ) ;
@@ -488,9 +508,9 @@ it('should consult all retrieve source map providers', function(done) {
488508 'process.nextTick(function() { console.log(count); });' ,
489509 ] , [
490510 'Error: this is the error' ,
491- / ^ a t f o o \( (?: .* [ / \\ ] ) ? o r i g i n a l .j s : 1 0 0 4 : 5 \) $ / ,
511+ / ^ a t f o o \( (?: .* [ / \\ ] ) ? o r i g i n a l \ .j s : 1 0 0 4 : 5 \) $ / ,
492512 'Error: this is the error' ,
493- / ^ a t f o o \( (?: .* [ / \\ ] ) ? o r i g i n a l .j s : 1 0 0 4 : 5 \) $ / ,
513+ / ^ a t f o o \( (?: .* [ / \\ ] ) ? o r i g i n a l \ .j s : 1 0 0 4 : 5 \) $ / ,
494514 '1' , // The retrieval should only be attempted once
495515 ] ) ;
496516} ) ;
@@ -525,9 +545,9 @@ it('should allow for runtime inline source maps', function(done) {
525545 'require("./.generated.jss");' ,
526546 ] , [
527547 'Error: this is the error' ,
528- / ^ a t f o o \( .* [ / \\ ] o r i g i n a l .j s : 1 0 0 4 : 5 \) $ / ,
548+ / ^ a t f o o \( .* [ / \\ ] o r i g i n a l \ .j s : 1 0 0 4 : 5 \) $ / ,
529549 'Error: this is the error' ,
530- / ^ a t f o o \( .* [ / \\ ] o r i g i n a l .j s : 1 0 0 4 : 5 \) $ / ,
550+ / ^ a t f o o \( .* [ / \\ ] o r i g i n a l \ .j s : 1 0 0 4 : 5 \) $ / ,
531551 '0' , // The retrieval should only be attempted once
532552 ] ) ;
533553} ) ;
0 commit comments