diff options
author | Jez Ng <me@jezng.com> | 2013-06-20 14:46:40 -0700 |
---|---|---|
committer | Jez Ng <me@jezng.com> | 2013-06-22 01:23:21 -0700 |
commit | 5459b3543fdc8eb01806e6fb03b05d19bd2815e9 (patch) | |
tree | 875b649b5105e3a62bb27581d303210fe19a1fa9 /tools | |
parent | cfe4eb5b4f1dd020276a2bd7a4886e172e76b48b (diff) |
Fix line numbering for invoke instructions.
Line numbering of exceptions now work (better) in optimized mode.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/eliminator/node_modules/uglify-js/lib/process.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/eliminator/node_modules/uglify-js/lib/process.js b/tools/eliminator/node_modules/uglify-js/lib/process.js index 39ccde37..88ce490f 100644 --- a/tools/eliminator/node_modules/uglify-js/lib/process.js +++ b/tools/eliminator/node_modules/uglify-js/lib/process.js @@ -412,7 +412,19 @@ function gen_code(ast, options) { }; function add_commas(a) { - return a.join("," + space); + var str = a.join("," + space); + if (options.debug) { + // if a line contains more than one comma-separated segment, assign it the + // original line number of the first NodeWithLine segment + for (var i = 0, l = a.length; i < l; i ++) { + var v = a[i]; + if (v instanceof NodeWithLine) { + v.str = str; + return v + } + } + } + return str; }; function parenthesize(expr) { |