diff options
author | Jez Ng <me@jezng.com> | 2013-06-21 16:01:38 -0700 |
---|---|---|
committer | Jez Ng <me@jezng.com> | 2013-06-22 01:23:22 -0700 |
commit | 88feddf045882bbddd29d9286eae4e6a9086e286 (patch) | |
tree | ce60c87bf58117ff6e4d3e092c394da255762a57 /tools/eliminator/node_modules/uglify-js/lib/process.js | |
parent | d50e7b4f7de07df53f820051dac85e79f8aa6e84 (diff) |
Get test_source_map passing again.
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) { |