diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-05-23 20:25:48 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-23 20:25:48 +0800 |
commit | e667f0acb87484617f506b561ecf0497ef9bdf25 (patch) | |
tree | ac96eb5e3600febd05fcd9e83dd25a649ffb0cd7 /test/sourcemaps.js | |
parent | 69ac794bc82a5e8451a49a2a32f44a7aee895542 (diff) | |
download | tracifyjs-e667f0acb87484617f506b561ecf0497ef9bdf25.tar.gz tracifyjs-e667f0acb87484617f506b561ecf0497ef9bdf25.zip |
fix source map offset (#1993)
Account for whitespace insertions.
fixes #505
fixes #890
Diffstat (limited to 'test/sourcemaps.js')
-rw-r--r-- | test/sourcemaps.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/sourcemaps.js b/test/sourcemaps.js index 4757d1e0..2717eff4 100644 --- a/test/sourcemaps.js +++ b/test/sourcemaps.js @@ -1,4 +1,4 @@ -var UglifyJS = require("./node"); +var UglifyJS = require(".."); var ok = require("assert"); module.exports = function () { @@ -26,11 +26,11 @@ module.exports = function () { } function source_map(js) { - var source_map = UglifyJS.SourceMap(); - var stream = UglifyJS.OutputStream({ source_map: source_map }); - var parsed = UglifyJS.parse(js); - parsed.print(stream); - return JSON.parse(source_map.toString()); + return JSON.parse(UglifyJS.minify(js, { + compress: false, + mangle: false, + sourceMap: true + }).map); } // Run standalone |