aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/intertyper.js4
-rw-r--r--src/jsifier.js2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/intertyper.js b/src/intertyper.js
index 3db09516..b181be61 100644
--- a/src/intertyper.js
+++ b/src/intertyper.js
@@ -47,6 +47,10 @@ var Debugging = {
return ret;
},
+
+ getComment: function(lineNum) {
+ return lineNum in this.llvmLineToSourceLine ? ' //@line ' + this.llvmLineToSourceLine[lineNum] : '';
+ }
};
//! @param parseFunctions We parse functions only on later passes, since we do not
diff --git a/src/jsifier.js b/src/jsifier.js
index 32cf263d..67c6ac06 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -436,7 +436,7 @@ function JSify(data, functionsOnly, givenTypes, givenFunctions, givenGlobalVaria
ret += indent + 'if (Date.now() - START_TIME >= ' + (EXECUTION_TIMEOUT*1000) + ') throw "Timed out!" + (new Error().stack);\n';
}
// for special labels we care about (for phi), mark that we visited them
- return ret + label.lines.map(function(line) { return line.JS + (Debugging.on ? ' //@line ' + Debugging.llvmLineToSourceLine[line.lineNum] : '') })
+ return ret + label.lines.map(function(line) { return line.JS + (Debugging.on ? Debugging.getComment(line.lineNum) : '') })
.join('\n')
.split('\n') // some lines include line breaks
.map(function(line) { return indent + line })