diff --git a/lib/parse.js b/lib/parse.js index de982b1e..58174878 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -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) { diff --git a/tools/node.js b/tools/node.js index 084998da..42eb0602 100644 --- a/tools/node.js +++ b/tools/node.js @@ -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 }); });