From 428e19fed25dc910187080cc41e6afc254def0d5 Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Wed, 18 Dec 2013 12:10:02 +0200 Subject: [PATCH] Add option to adjust the src/target line in the source map --- lib/sourcemap.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 }); -- 2.34.1