aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsergeyv <sergeyv@chromium.org>2016-02-08 13:42:07 -0800
committerRichard van Velzen <rvanvelzen@experty.com>2016-02-10 10:19:39 +0100
commit7a4ed9d200c96d1fa2f9fcdfeab6ee76a3bbd696 (patch)
tree129641be6402989b5639acb9ee813cbd9a1efa7f
parentd5c651a5e5667e64f4fe76f4d3669ba5bd375b6d (diff)
downloadtracifyjs-7a4ed9d200c96d1fa2f9fcdfeab6ee76a3bbd696.tar.gz
tracifyjs-7a4ed9d200c96d1fa2f9fcdfeab6ee76a3bbd696.zip
Revert "using the original sourcemap as the base"
This reverts commit ad18689d926d25c7a25b95c630c2ad05b7b5f5b5. Reason for revert: introduce issue #882 Currently, generated sourcemap contains copy of all existing mappings and adds new mappings from uglified code to original one. However, previous mapping are no longer valid and shouldn't be added.
-rw-r--r--lib/sourcemap.js15
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/sourcemap.js b/lib/sourcemap.js
index a67011f0..e5d7df60 100644
--- a/lib/sourcemap.js
+++ b/lib/sourcemap.js
@@ -53,16 +53,11 @@ function SourceMap(options) {
orig_line_diff : 0,
dest_line_diff : 0,
});
+ var generator = new MOZ_SourceMap.SourceMapGenerator({
+ file : options.file,
+ sourceRoot : options.root
+ });
var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig);
- var generator;
- if (orig_map) {
- generator = MOZ_SourceMap.SourceMapGenerator.fromSourceMap(orig_map);
- } else {
- generator = new MOZ_SourceMap.SourceMapGenerator({
- file : options.file,
- sourceRoot : options.root
- });
- }
function add(source, gen_line, gen_col, orig_line, orig_col, name) {
if (orig_map) {
var info = orig_map.originalPositionFor({
@@ -83,7 +78,7 @@ function SourceMap(options) {
source : source,
name : name
});
- }
+ };
return {
add : add,
get : function() { return generator },