Read user-defined filename for string based contexts from options.filename
This commit is contained in:
parent
a64bdda9ae
commit
4d12f36b2b
|
|
@ -194,7 +194,7 @@ JS_Parse_Error.prototype.toString = function() {
|
|||
};
|
||||
|
||||
function js_error(message, filename, line, col, pos) {
|
||||
throw new JS_Parse_Error(message, line, col, pos);
|
||||
throw new JS_Parse_Error(''+ message + ' at ' + filename, line, col, pos);
|
||||
};
|
||||
|
||||
function is_token(token, type, val) {
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ exports.minify = function(files, options) {
|
|||
: fs.readFileSync(file, "utf8");
|
||||
sourcesContent[file] = code;
|
||||
toplevel = UglifyJS.parse(code, {
|
||||
filename: options.fromString ? "?" : file,
|
||||
filename: options.fromString ? (options.filename ? options.filename : "?") : file,
|
||||
toplevel: toplevel
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user