Bug 574518: Better solution: recur until error so that test autotunes for memory usage

This commit is contained in:
David Mandelin 2010-06-25 16:47:30 -07:00
parent ffa14c0ca4
commit 113fdd40ed

View File

@ -63,9 +63,13 @@ function test()
var recursionDepth = 0;
function err() {
if (++recursionDepth == 64)
return new Error();
return err.apply(this, arguments);
try {
return err.apply(this, arguments);
} catch (e) {
if (!(e instanceof InternalError))
throw e;
}
return new Error();
}
// The full stack trace in error would include 64*4 copies of s exceeding