Mozilla/mozilla/js/rhino/testsrc/doctests/tail-call-in-try.doctest
nboyd%atg.com dc30f073a5 First take at a doctest function like the Python doctest, with JUnit driver
and a few tests.


git-svn-id: svn://10.0.0.236/trunk@246950 18797224-902f-48f8-a5cc-f745e15eee43
2008-03-03 22:20:35 +00:00

16 lines
342 B
Plaintext

// Fix bug reported in newsgroup:
// Tail call optimization was interfering with catching exceptions.
// The following program should print 7, but was resulting in an uncaught
// exception.
js> function g() {
> throw 3;
> }
js> function f() {
> try {
> return g();
> } catch (e) {
> return 7;
> }
> }
js> f()
7