I'm wondering if it's possible to get the line number of a statement inside a .js file. For instance:
// line 1
// line 2
// line 4
var thisline = new Error().lineNumber
If that doesn't work in whatever environment you're using, you can try:
var stack = new Error().stack
Then hunt through the stack for the line number.