aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/minify.js6
-rw-r--r--test/mocha/cli.js12
2 files changed, 17 insertions, 1 deletions
diff --git a/lib/minify.js b/lib/minify.js
index 8e4aded9..8dc275cf 100644
--- a/lib/minify.js
+++ b/lib/minify.js
@@ -165,7 +165,11 @@ function minify(files, options) {
if (!HOP(options.output, "code") || options.output.code) {
if (options.sourceMap) {
if (typeof options.sourceMap.content == "string") {
- options.sourceMap.content = JSON.parse(options.sourceMap.content);
+ try {
+ options.sourceMap.content = JSON.parse(options.sourceMap.content);
+ } catch (ex) {
+ throw new Error("invalid input source map: " + options.sourceMap.content);
+ }
}
options.output.source_map = SourceMap({
file: options.sourceMap.filename,
diff --git a/test/mocha/cli.js b/test/mocha/cli.js
index 10f0465a..7f0bd79f 100644
--- a/test/mocha/cli.js
+++ b/test/mocha/cli.js
@@ -56,6 +56,18 @@ describe("bin/uglifyjs", function () {
done();
});
});
+ it("Should give sensible error against invalid input source map", function(done) {
+ var command = uglifyjscmd + " test/mocha.js --source-map content=blah,url=inline";
+
+ exec(command, function (err, stdout, stderr) {
+ assert.ok(err);
+ assert.deepEqual(stderr.split(/\n/).slice(0, 2), [
+ "INFO: Using input source map: blah",
+ "ERROR: invalid input source map: blah",
+ ]);
+ done();
+ });
+ });
it("Should append source map to output when using --source-map url=inline", function (done) {
var command = uglifyjscmd + " test/input/issue-1323/sample.js --source-map url=inline";
cm, gnu/packages/rdf.scm, gnu/packages/rednotebook.scm, gnu/packages/rpc.scm, gnu/packages/rsync.scm, gnu/packages/ruby.scm, gnu/packages/rust.scm, gnu/packages/scheme.scm, gnu/packages/screen.scm, gnu/packages/security-token.scm, gnu/packages/selinux.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/shellutils.scm, gnu/packages/simh.scm, gnu/packages/sml.scm, gnu/packages/ssh.scm, gnu/packages/statistics.scm, gnu/packages/stenography.scm, gnu/packages/sync.scm, gnu/packages/syncthing.scm, gnu/packages/synergy.scm, gnu/packages/telephony.scm, gnu/packages/terminals.scm, gnu/packages/tex.scm, gnu/packages/texinfo.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tmux.scm, gnu/packages/tor.scm, gnu/packages/toys.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vim.scm, gnu/packages/virtualization.scm, gnu/packages/vlang.scm, gnu/packages/vnc.scm, gnu/packages/vpn.scm, gnu/packages/web-browsers.scm, gnu/packages/web.scm, gnu/packages/wireservice.scm, gnu/packages/wm.scm, gnu/packages/wxwidgets.scm, gnu/packages/xdisorg.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, tests/lint.scm: Remove trailing ".git" from 'git-reference' URL. Ludovic Courtès 2020-05-30gnu: fio: Update to 3.20....* gnu/packages/benchmark.scm (fio): Update to 3.20. Tobias Geerinckx-Rice 2020-03-14gnu: fio: Update to 3.19....* gnu/packages/benchmark.scm (fio): Update to 3.19. Tobias Geerinckx-Rice 2020-02-26gnu: benchmark: Add bonnie++....* gnu/packages/benchmark.scm (bonnie++): New variable. Signed-off-by: Marius Bakke <mbakke@fastmail.com> Vincent Legoll 2020-02-16gnu: fio: Update to 3.18....* gnu/packages/benchmark.scm (fio): Update to 3.18. Tobias Geerinckx-Rice 2019-12-23gnu: fio: Update to 3.17....* gnu/packages/benchmark.scm (fio): Update to 3.17. Tobias Geerinckx-Rice 2019-12-20gnu: intel-mpi-benchmarks: Merge with "imb-openmpi"....* gnu/packages/mpi.scm (intel-mpi-benchmarks): Remove. * gnu/packages/benchmark.scm (imb): Rename to... (intel-mpi-benchmarks): ... this. Change 'name'. Update to 2019.3. [arguments]: Remove 'build phase. Rewrite 'install phase. Pass #:parallel-build? and #:make-flags. (intel-mpi-benchmarks/openmpi): New variable. (imb-openmpi): Rewrite in terms of 'deprecated-package'. Ludovic Courtès 2019-12-12gnu: fio: Download over HTTPS....* gnu/packages/benchmark.scm (fio)[source]: Use HTTPS. Tobias Geerinckx-Rice 2019-12-12gnu: fio: Update to 3.16....* gnu/packages/benchmark.scm (fio): Update to 3.16. Tobias Geerinckx-Rice 2019-12-04gnu: python-pandas: Move to (gnu packages python-science)....* gnu/packages/python-xyz.scm (python-pandas, python2-pandas): Move from here... * gnu/packages/python-science.scm (python-pandas, python2-pandas): ...to here. * gnu/packages/benchmark.scm, gnu/packages/databases.scm, gnu/packages/graph.scm, gnu/packages/parallel.scm, gnu/packages/serialization.scm: Import (gnu packages python-science). Ricardo Wurmus 2019-06-14gnu: Add benchmark....* gnu/packages/benchmark.scm(benchmark): New variable. * gnu/packages/patches/benchmark-unbundle-googletest.patch: New file. * gnu/local.mk(dist_patch_DATA): Add it. Gábor Boskovits 2019-06-06gnu: fio: Update to 3.14....* gnu/packages/benchmark.scm (fio): Update to 3.14. Tobias Geerinckx-Rice 2019-03-15gnu: fio: Update to 3.13....* gnu/packages/benchmark.scm (fio): Update to 3.13. Marius Bakke