I ran across a new error today, (because I was doing something
stupid), so I thought I'd share:
'InternalError: too much recursion'
I wanted to discover how much was too much, so I tries some
experiments:
// Test 1
//
function TestRecursion( x )
{
try { TestRecursion( x + 1 ) } catch( e ) { return x }
}
TestRecursion( 1 );
// Test 2
//
function TestRecursion( x ) { TestRecursion( x + 1 ) }
try { TestRecursion( 1 ) } catch( e ) { e }
In both cases, it turned out that the error was not trappable, it just
ignored the try-statement and errored. So here's the one that worked:
// Test 3
//
BBEDIT = MacOS.appBySignature( 'R*ch' );
BBEDIT.activate();
BBEDIT.make( BBEDIT._types.text_window );
function TestRecursion( x )
{
BBEDIT.text_window[1].contents = x;
TestRecursion( x + 1 );
}
TestRecursion( 1 );
The answer: 1000. So now you know. :)
{ Arthur Knapp
arthur @ s t e l l a r v i s i o n s . c o m
}