Take a look at http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi which
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

Reply via email to