Recursion - Call stack fails to pop when testing the maximum stack size
<p>Basically <em><strong>call stack</strong></em> will start to <em>pop</em> out the <em>function</em> calls one by one when the <em><strong>last-in</strong></em> function call returns. But when ever I try to create a call stack nearer to the size of its maximum, An <em><code>uncaught expression</code></em> is getting raised.</p>
<pre><code>//Code for testing the stack size
var cnt = 0;

function test(){
 //Max stack size is nearer to ~41800
 if(cnt++ == 41763){
  console.log('finished');
  return true;
 }
 return test();
}

test();
</code></pre>
<p>So the above code is throwing an exception for me in <strong>chromium Version 49.0.2623.112 m</strong> like below,</p>
<blockquote>
<p>Uncaught exception</p>
<p>&lt; true</p>
</blockquote>
<p>Please not that the above error has no message in it. My question here is,</p>
<p>The last function call in the stack has returned <code>true</code> that means the stack size was not exceeded. why didn't the other function calls in that stack was not returned? And what is the reason for this blank exception message?</p>