aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2013-12-18 12:10:02 +0200
committerMihai Bazon <mihai@bazon.net>2013-12-18 12:10:02 +0200
commit428e19fed25dc910187080cc41e6afc254def0d5 (patch)
treedb807ca0f4c413ee54f37d4c379177cfd0bf113b /lib
parentf65e55dff40334bda8eed4f77b88a1c90af27d7c (diff)
downloadtracifyjs-428e19fed25dc910187080cc41e6afc254def0d5.tar.gz
tracifyjs-428e19fed25dc910187080cc41e6afc254def0d5.zip
Add option to adjust the src/target line in the source map
Diffstat (limited to 'lib')
-rw-r--r--lib/sourcemap.js7
1 files 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
});