--
You received this message because you are subscribed to the Google Groups "MozLab" group.
To post to this group, send email to moz...@googlegroups.com.
To unsubscribe from this group, send email to mozlab+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mozlab?hl=en.
By the way, is there any easy way to get a stack trace directly at the
repl when an exception occurs? I know I could write a new interactor
(or modify mozrepl's default interactor) but I don't really know where
should I start, I'm a javascript/mozilla internals newbie :)
Grazie ancora e buon lavoro :)
__
Alessandro
function crasto(x) {
if (x === 0)
throw(new Error('division by 0!'));
else return 1/x;
}
function bobby() { crasto(0);}
function jimmy() { bobby(); }
-------------------------------------
and at the repl, when calling jimmy(), I get
-------repl output--------
repl> jimmy()
!!! Error: division by 0!
Details:
fileName: chrome://mozrepl/content/repl.js -> file:////home/ale/src/cane.js?0
lineNumber: 3
-------------------------------
For some reason, if I copy paste the javascriptInteractor code from
repl.js in my mozrepl init file and define a new interactor and push
it, I can see the stack trace.
I changed the error reporting code to get a simpler view like this:
---------------------------------------
repl> jimmy()
!!! Error: division by 0!
Trace:
crasto(0) -> file:////home/ale/src/cane.js?0:3
bobby() -> file:////home/ale/src/cane.js?0:8
jimmy() -> file:////home/ale/src/cane.js?0:12
-----------------------------------------
__
Alessandro