This test checks whether funky scope chains created by catch blocks
are properly protected from GC. It should not crash.
<script>
if (window.layoutTestController)
    layoutTestController.dumpAsText();

function Test_Error() {
    for( var i = 0; i <= 5000; i++ ) {
        try {
            throw new Error("Ungraceful Error");
        }
        catch (e) {
            try { 
                throw new Error("Graceful Error"); 
            } 
            catch (e)  { 
                Test_Error_isPrime(147457); //Do something CPU-intensive
            }
            finally{
                Test_Error_isPrime(147457); //Do something CPU-intensive
            }
        }
    }
}
function Test_Error_isPrime(PrimeTest) {
    for(i=2;i<=Math.sqrt(147457)+1;i++) {
        if (PrimeTest % i == 0) {
            return false;
        }
    }
    return true;
}
Test_Error();
</script>
