[pypy-svn] r34127 - pypy/dist/pypy/lang/js
santagada at codespeak.net
santagada at codespeak.net
Fri Nov 3 17:15:00 CET 2006
Author: santagada
Date: Fri Nov 3 17:14:57 2006
New Revision: 34127
Modified:
pypy/dist/pypy/lang/js/interpreter.py
Log:
(stephan, santagada, richard) Try block working
Modified: pypy/dist/pypy/lang/js/interpreter.py
==============================================================================
--- pypy/dist/pypy/lang/js/interpreter.py (original)
+++ pypy/dist/pypy/lang/js/interpreter.py Fri Nov 3 17:14:57 2006
@@ -14,6 +14,7 @@
class ThrowException(Exception):
def __init__(self, exception):
self.exception = exception
+ self.args = self.exception
class __extend__(Array):
@@ -180,22 +181,18 @@
e = None
try:
tryresult = self.tryblock.call(context)
- except ThrowException, e:
- e = e
+ except ThrowException, excpt:
+ e = excpt
ncontext = ExecutionContext(context)
- print "tried to catch it :)"
ncontext.assign(self.catchparam, e.exception)
if self.catchblock is not None:
tryresult = self.catchblock.call(ncontext)
- print self.finallyblock
if self.finallyblock is not None:
- print "asdasd"
tryresult = self.finallyblock.call(context)
- print "saddsa"
- print a
+
#if there is no catchblock reraise the exception
- if (e is not None) and (self.catchblock is not None):
+ if (e is not None) and (self.catchblock is None):
raise e
return tryresult
More information about the Pypy-commit
mailing list