From d78ae20e64a6449b63ac86c225f0fe7faae353bd Mon Sep 17 00:00:00 2001 From: Richard van Velzen Date: Mon, 26 Jan 2015 12:07:44 +0100 Subject: Make empty source map values more reasonable in .minify() `"null"` isn't a very usable value. `JSON.parse(null)` also gives `null`, which makes this fully backwards compatible. Closes #616 --- tools/node.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/node.js b/tools/node.js index 4bc8517b..1ae69da8 100644 --- a/tools/node.js +++ b/tools/node.js @@ -133,9 +133,14 @@ exports.minify = function(files, options) { stream += "\n//# sourceMappingURL=" + options.outSourceMap; } + var source_map = output.source_map; + if (source_map) { + source_map = source_map + ""; + } + return { code : stream + "", - map : output.source_map + "" + map : source_map }; }; -- cgit v1.2.3