From: Mihai Bazon Date: Wed, 18 Dec 2013 10:10:02 +0000 (+0200) Subject: Add option to adjust the src/target line in the source map X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=428e19fed25dc910187080cc41e6afc254def0d5;p=UglifyJS.git Add option to adjust the src/target line in the source map --- diff --git a/lib/sourcemap.js b/lib/sourcemap.js index 34299081..8e86ebd8 100644 --- a/lib/sourcemap.js +++ b/lib/sourcemap.js @@ -49,6 +49,9 @@ function SourceMap(options) { file : null, root : null, orig : null, + + orig_line_diff : 0, + dest_line_diff : 0, }); var generator = new MOZ_SourceMap.SourceMapGenerator({ file : options.file, @@ -67,8 +70,8 @@ function SourceMap(options) { name = info.name; } generator.addMapping({ - generated : { line: gen_line, column: gen_col }, - original : { line: orig_line, column: orig_col }, + generated : { line: gen_line + options.dest_line_diff, column: gen_col }, + original : { line: orig_line + options.orig_line_diff, column: orig_col }, source : source, name : name });