Please verify the issue with SVN trunk after r310
def testExceptionMapping(self):
class TestException(Exception):
pass
class Global(JSClass):
def raiseExceptions(self):
raise TestException()
with JSContext(Global()) as ctxt:
self.assertRaises(TestException, ctxt.eval,
"this.raiseExceptions();")
The current implementation may introduce a slight memory leak, because
pyv8 must trace the Python exception in the Javascript exception, if
the JS exception was eaten by JS code, those Python exception may not
be collected. Because I can't find any way to trace the lifecycle of
Javascript object.