diff options
Diffstat (limited to 'tools/eliminator/node_modules/uglify-js/lib/process.js')
-rw-r--r-- | tools/eliminator/node_modules/uglify-js/lib/process.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/eliminator/node_modules/uglify-js/lib/process.js b/tools/eliminator/node_modules/uglify-js/lib/process.js index da38caa7..3fd99b79 100644 --- a/tools/eliminator/node_modules/uglify-js/lib/process.js +++ b/tools/eliminator/node_modules/uglify-js/lib/process.js @@ -72,7 +72,7 @@ function NodeWithLine(str, line) { NodeWithLine.prototype = new String(); NodeWithLine.prototype.toString = function() { return this.str; } NodeWithLine.prototype.valueOf = function() { return this.str; } -NodeWithLine.prototype.lineComment = function() { return " // @line " + this.line; } +NodeWithLine.prototype.lineComment = function() { return " //@line " + this.line; } // XXX ugly hack String.prototype.lineComment = function() { return ""; } @@ -1686,10 +1686,15 @@ function gen_code(ast, options) { && rvalue[0] == "regexp" && /^script/i.test(rvalue[1])) { right = " " + right; } - var tok = this[0]; var str = add_spaces([ left, operator, right ]); - if (options.debug && tok.start) - return new NodeWithLine(str, tok.start.line); + if (options.debug) { + if (this[0].start) + return new NodeWithLine(str, this[0].start.line); + else if (lvalue[0].start) + return new NodeWithLine(str, lvalue[0].start.line); + else if (rvalue[0].start) + return new NodeWithLine(str, rvalue[0].start.line); + } return str; }, "unary-prefix": function(operator, expr) { |