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
This commit is contained in:
Richard van Velzen
2015-01-26 12:07:44 +01:00
parent 5c02d65ddb
commit d78ae20e64

View File

@@ -133,9 +133,14 @@ exports.minify = function(files, options) {
stream += "\n//# sourceMappingURL=" + options.outSourceMap; stream += "\n//# sourceMappingURL=" + options.outSourceMap;
} }
var source_map = output.source_map;
if (source_map) {
source_map = source_map + "";
}
return { return {
code : stream + "", code : stream + "",
map : output.source_map + "" map : source_map
}; };
}; };