You can just parse (new Error).stack:
var __LINE__ = (new Error).stack.split("\n")[1].match(/:([0-9]+):/)[1]; var __LINE__ = (new Error).stack.split("\n")[1].match(/:([0-9]+):/)[1];Unless you’re running it on an old IE that doesn’t host the `window.console` object.