It is not possible to get a stack trace from a JavaScript exception as in
the example below. The reason for this is that it is quite expensive to
collect a stack trace each time an exception occur. The stack trace have to
be build at the time where the exception occur even though the stack trace
most likely will never be used. This will add a performance penalty for
using exceptions.
You might be able to use the debugger interface to get the stack traces you
need. The V8 debugger interface has the ability to have a debug event
listener to be called for each exception (both caught and uncaught) thrown.
On the bleeding edge there is also an ability to call a function in the
context of the debugger which can be used to collect a stack trace.
Regards,
Søren
On Mon, Dec 1, 2008 at 12:09 PM, George Moschovitis <
[EMAIL PROTECTED]> wrote:
>
> Hello there,
>
> I am wondering if v8 provides a way to extract a StackTrace from a
> JavaScript Exception, ie something like:
>
> try {
> ...
> } catch (ex) {
> ex.stackTrace();
> }
>
>
> thanks,
> George.
> >
>
--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---