Search the web
Sign In
New User? Sign Up
jsosa · JavaScript OSA-Talk
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Recursion   Message List  
Reply | Forward Message #436 of 529 |
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
}




Tue Apr 13, 2004 2:27 pm

admiralnovia
Offline Offline
Send Email Send Email

Forward
Message #436 of 529 |
Expand Messages Author Sort by Date

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...
Arthur Knapp
admiralnovia
Offline Send Email
Apr 13, 2004
2:27 pm

... And I think I might agree: yes, 1,000 *is* too much recursion :)...
Gavin Kistner
rabyak
Online Now Send Email
Apr 13, 2004
4:00 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help