Is there any way to get the source line number in Javascript, like __LINE__
for C or PHP?
You can try to run C preprocessor (f.e. cpp
from GNU Compiler Collection) on your javascript files -- either dynamically with each request or statically, by making this operation be applied every time you change your javascript files. I think the javascript syntax is similar enough for this to work.
Then you'd have all the power of C preprocessor.