Mercurial > pymonkey
changeset 88:0b2970e8cd67
Added a test.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Sun, 09 Aug 2009 22:26:45 -0700 |
parents | 345d4c0e3dd3 |
children | e77bc7c799e8 |
files | test_pymonkey.py |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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 @@ '<string>', 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()', '<string>', 1) + self.assertEqual(cx.evaluate_script(obj, '5+3', '<string>', 1), + 8) + def testCallFunctionRaisesErrorOnBadFuncArgs(self): cx = pymonkey.Runtime().new_context() obj = cx.new_object()