diff --git a/lib/parse.js b/lib/parse.js index 78c1dd41..20fc55a4 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -200,7 +200,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) { diff --git a/tools/node.js b/tools/node.js index 1ae69da8..bf0d1462 100644 --- a/tools/node.js +++ b/tools/node.js @@ -80,7 +80,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 }); });