From 5174d9250a918896a8505fcd18f9960a3ea634ec Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Sun, 23 Jun 2013 16:35:03 +0200 Subject: [PATCH] TRY-CATCH-FINALLY support in codegen --- src/compiler-codegen.lisp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/compiler-codegen.lisp b/src/compiler-codegen.lisp index 51027fd..61aeac2 100644 --- a/src/compiler-codegen.lisp +++ b/src/compiler-codegen.lisp @@ -440,6 +440,20 @@ (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 ") -- 1.7.10.4