I've actually seen this before, but as far as I can see it's for hooking the stack trace formatting to a different function, which inside, yes has an array that contains the line number but this gets a hit on performance as well as changing what the stack trace is formatted as.
Am I misreading it? I may be? Really, I'm just to make it super simple for people to get the line number when it's exceptions raised without needing to hook into or modify anything. Just like mozilla's implementation. This came about because a bunch of us on the node.js IRC all agreed it'd be hella nice to have. On May 31, 1:40 am, Søren Gjesse <[email protected]> wrote: > Take a look athttp://code.google.com/p/v8/wiki/JavaScriptStackTraceApiwhich > shows different ways of obtaining the line numbers for the active stack > frames when the exception was thrown. > > Regards, > Søren > > > > On Tue, May 31, 2011 at 07:29, zeunix <[email protected]> wrote: > > Example for reference: > > try { > > foobar(); > > } catch (e) { > > > console.log(e.lineNumber); > > } > > > Although it's non-standard, Mozilla current implements lineNumber. I > > was looking through the source that generates this object and was > > considering diving in and adding this myself. > > In CommonJS implementations using V8, like node.js (http:// > > nodejs.org/), it would be really helpful to have direct access to the > > line number the exception was raised on. Especially if they are > > writing a custom uncaughtException handler. It might be useful in the > > browser as well for complex web apps. > > I wanted to get everyone's opinion before I spent the time adding > > this > > feature and it got rejected when submitted. Thoughts? I do realize > > the > > line number is inside the e.stack, but if they want to display a > > custom error message without the stack trace, they're SOL on the line > > number. > > > -- > > v8-dev mailing list > > [email protected] > >http://groups.google.com/group/v8-dev -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
