give sensible error against invalid input source map (#3044)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user