diff --git a/js/tests/js1_7/regress/regress-372331.js b/js/tests/js1_7/regress/regress-372331.js index 140694e79eeb..85f96107e322 100644 --- a/js/tests/js1_7/regress/regress-372331.js +++ b/js/tests/js1_7/regress/regress-372331.js @@ -57,6 +57,7 @@ function test() var obj = { index: 1 }; expect = 'No Error'; + actual = 'No Error'; function gen() { @@ -68,13 +69,18 @@ function test() for (index in gen()); } - if ('index' in obj) - throw "for-in binds name to early"; + try + { + if ('index' in obj) + throw "for-in binds name to early"; - if (index !== 2) - throw "unexpected value of index: "+index; - - actual = 'No Error'; + if (index !== 2) + throw "unexpected value of index: "+index; + } + catch(ex) + { + actual = ex + ''; + } reportCompare(expect, actual, summary);