@ -29,7 +29,13 @@ describe('sourcemaps', function() {
|
||||
expect(errorColumn).not.toBeNull();
|
||||
|
||||
|
||||
var sourceMapData = fs.readFileSync('dist/js/prod/es5/playground/src/sourcemap/index.js.map');
|
||||
const content =
|
||||
fs.readFileSync('dist/js/dev/es5/playground/src/sourcemap/index.js').toString("utf8");
|
||||
const marker = "//# sourceMappingURL=data:application/json;base64,";
|
||||
const index = content.indexOf(marker);
|
||||
const sourceMapData =
|
||||
new Buffer(content.substring(index + marker.length), 'base64').toString("utf8");
|
||||
|
||||
var decoder = new sourceMap.SourceMapConsumer(JSON.parse(sourceMapData));
|
||||
|
||||
var originalPosition = decoder.originalPositionFor({line: errorLine, column: errorColumn});
|
||||
|
Reference in New Issue
Block a user