mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 20:35:50 +00:00
Add a try...catch around the recursion test to catch 'too much recursion' exceptions. They are OK; we are only testing against crashes in this test.
This commit is contained in:
parent
b757fa1a10
commit
67070c0aad
@ -50,8 +50,10 @@ printStatus(summary);
|
||||
/*
|
||||
* Just seeing that we don't crash when compiling this assignment -
|
||||
*/
|
||||
var len =
|
||||
|
||||
try
|
||||
{
|
||||
var len =
|
||||
|
||||
(((((((((((((((((((((((((((((((((((((((((((((((((((
|
||||
(((((((((((((
|
||||
|
||||
@ -247,3 +249,8 @@ var len =
|
||||
)))))))))))))
|
||||
|
||||
;
|
||||
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
|
@ -61,7 +61,18 @@ var N = 10000;
|
||||
var left = repeat_str('(1&', N);
|
||||
var right = repeat_str(')', N);
|
||||
var str = 'actual = '.concat(left, '1', right, ';');
|
||||
eval(str);
|
||||
try
|
||||
{
|
||||
eval(str);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
/*
|
||||
* An exception during this eval is OK, as the runtime can throw one
|
||||
* in response to too deep recursion. We haven't crashed; good!
|
||||
*/
|
||||
actual = 1;
|
||||
}
|
||||
expect = 1;
|
||||
addThis();
|
||||
|
||||
|
@ -57,8 +57,16 @@ var expectedvalues = [];
|
||||
* Set both |actual| and |expect| to a dummy value.
|
||||
*/
|
||||
status = inSection(1);
|
||||
var N = 100;
|
||||
var str = make_deep_nest(N);
|
||||
var N = 1000;
|
||||
try
|
||||
{
|
||||
make_deep_nest(N);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// An exception is OK, as the runtime can throw one in response to too deep
|
||||
// recursion. We haven't crashed; good! Continue on to set the dummy values -
|
||||
}
|
||||
actual = 1;
|
||||
expect = 1;
|
||||
addThis();
|
||||
|
Loading…
Reference in New Issue
Block a user