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 /src/jsifier.js | |
parent | cfe4eb5b4f1dd020276a2bd7a4886e172e76b48b (diff) |
Fix line numbering for invoke instructions.
Line numbering of exceptions now work (better) in optimized mode.
Diffstat (limited to 'src/jsifier.js')
-rw-r--r-- | src/jsifier.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 88b9d9f6..7264b0e9 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -693,7 +693,9 @@ function JSify(data, functionsOnly, givenFunctions) { } } i++; - return JS + (Debugging.on ? Debugging.getComment(line.lineNum) : ''); + // invoke instructions span two lines, and the debug info is located + // on the second line, hence the +1 + return JS + (Debugging.on ? Debugging.getComment(line.lineNum + (line.intertype === 'invoke' ? 1 : 0)) : ''); }) .join('\n') .split('\n') // some lines include line breaks |