Skip to content

Commit

Permalink
fix stack track for new sourcemap format
Browse files Browse the repository at this point in the history
  • Loading branch information
Zordius Chen committed Nov 7, 2015
1 parent 926dc87 commit 2d4003f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ betterIndent = function (string, loc) {
return string + (new Array(newloc - size + 1)).join(' ');
},

addSourceComments = function (source, sourceMap) {
addSourceComments = function (source, sourceMap, filename) {
var oldlines,
lines = source.split(/\n/),
mappings = [],
Expand Down Expand Up @@ -66,7 +66,7 @@ addSourceComments = function (source, sourceMap) {
});
sourceMap.linemappings = mappings;
sourceMap.oldLines = oldlines;
sourceMapCache[sourceMap.file] = sourceMap;
sourceMapCache[filename] = sourceMap;
source = lines.join('\n').replace(/\/\/# sourceMappingURL=.+/, '// SourceMap was distributed to comments by gulp-jsx-coverage');
}

Expand Down Expand Up @@ -125,7 +125,7 @@ initModuleLoaderHack = function (options) {
}

if (srcCache) {
sourceStore.set(filename, addSourceComments(src, srcCache));
sourceStore.set(filename, addSourceComments(src, srcCache, filename));
}

// Don't instrument files that aren't meant to be
Expand Down

0 comments on commit 2d4003f

Please sign in to comment.