This commit is contained in:
Caridy Patiño 2015-01-04 20:04:49 +00:00
commit 8aa856e918

View File

@ -53,10 +53,7 @@ function SourceMap(options) {
orig_line_diff : 0, orig_line_diff : 0,
dest_line_diff : 0, dest_line_diff : 0,
}); });
var generator = new MOZ_SourceMap.SourceMapGenerator({ var generator;
file : options.file,
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);
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) {
@ -78,7 +75,15 @@ function SourceMap(options) {
source : source, source : source,
name : name name : name
}); });
}; }
if (orig_map) {
generator = MOZ_SourceMap.SourceMapGenerator.fromSourceMap(orig_map);
} else {
generator = new MOZ_SourceMap.SourceMapGenerator({
file : options.file,
sourceRoot : options.root
});
}
return { return {
add : add, add : add,
get : function() { return generator }, get : function() { return generator },