# HG changeset patch # User Atul Varma # Date 1249882005 25200 # Node ID 0b2970e8cd6745706eab5570564b9d2e6768bb87 # Parent 345d4c0e3dd3d42fe484962b82d18bd0117bf1f8 Added a test. diff -r 345d4c0e3dd3 -r 0b2970e8cd67 test_pymonkey.py --- a/test_pymonkey.py Sun Aug 09 16:17:25 2009 -0700 +++ b/test_pymonkey.py Sun Aug 09 22:26:45 2009 -0700 @@ -455,6 +455,15 @@ '', 1) self.assertTrue(isinstance(obj, pymonkey.Function)) + def testJsExceptionStateIsClearedAfterExceptionIsCaught(self): + cx = pymonkey.Runtime().new_context() + obj = cx.new_object() + self.assertRaises(pymonkey.error, + cx.evaluate_script, + obj, 'blah()', '', 1) + self.assertEqual(cx.evaluate_script(obj, '5+3', '', 1), + 8) + def testCallFunctionRaisesErrorOnBadFuncArgs(self): cx = pymonkey.Runtime().new_context() obj = cx.new_object()