lib/sourcemap.js: Copy sourceContent from old souce-map to the new source-map. Should fix #882
This commit is contained in:
parent
572b97b0bb
commit
05ac8d6e5c
|
|
@ -58,6 +58,16 @@ function SourceMap(options) {
|
||||||
sourceRoot : options.root
|
sourceRoot : options.root
|
||||||
});
|
});
|
||||||
var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig);
|
var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig);
|
||||||
|
|
||||||
|
if (orig_map && Array.isArray(options.orig.sources)) {
|
||||||
|
options.orig.sources.forEach(function(source) {
|
||||||
|
var sourceContent = orig_map.sourceContentFor(source, true);
|
||||||
|
if (sourceContent) {
|
||||||
|
generator.setSourceContent(source, sourceContent);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function add(source, gen_line, gen_col, orig_line, orig_col, name) {
|
function add(source, gen_line, gen_col, orig_line, orig_col, name) {
|
||||||
if (orig_map) {
|
if (orig_map) {
|
||||||
var info = orig_map.originalPositionFor({
|
var info = orig_map.originalPositionFor({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user