projects
/
jscl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3d31d9d
)
TRY-CATCH-FINALLY support in codegen
author
David Vázquez
<davazp@gmail.com>
Sun, 23 Jun 2013 14:35:03 +0000
(16:35 +0200)
committer
David Vázquez
<davazp@gmail.com>
Sun, 23 Jun 2013 14:35:03 +0000
(16:35 +0200)
src/compiler-codegen.lisp
patch
|
blob
|
history
diff --git
a/src/compiler-codegen.lisp
b/src/compiler-codegen.lisp
index
51027fd
..
61aeac2
100644
(file)
--- a/
src/compiler-codegen.lisp
+++ b/
src/compiler-codegen.lisp
@@
-440,6
+440,20
@@
(js-expr condition)
(js-format ")")
(js-stmt `(progn ,@body))))
(js-expr condition)
(js-format ")")
(js-stmt `(progn ,@body))))
+ (try
+ (destructuring-bind (&rest body) (cdr form)
+ (js-format "try")
+ (js-stmt `(group ,@body))))
+ (catch
+ (destructuring-bind ((var) &rest body) (cdr form)
+ (js-format "catch (")
+ (js-identifier var)
+ (js-format ")")
+ (js-stmt `(group ,@body))))
+ (finally
+ (destructuring-bind (&rest body) (cdr form)
+ (js-format "finally")
+ (js-stmt `(group ,@body))))
(throw
(destructuring-bind (object) (cdr form)
(js-format "throw ")
(throw
(destructuring-bind (object) (cdr form)
(js-format "throw ")