From 2b14abf0da29892e033ca63482ffcfc24ad6a4d8 Mon Sep 17 00:00:00 2001 From: Bob Clary Date: Fri, 20 Feb 2009 16:57:02 -0800 Subject: [PATCH] bug 372331 - modify test to handle uncaught exception. --- js/tests/js1_7/regress/regress-372331.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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);