From: David Vázquez Date: Sun, 23 Jun 2013 15:14:56 +0000 (+0200) Subject: Migrate UNWIND-PROTECT X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=d7198705e5945e5b13ac9df69d5d18a53e77771c;p=jscl.git Migrate UNWIND-PROTECT --- diff --git a/src/compiler.lisp b/src/compiler.lisp index 0d4bab1..d83b6b0 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -910,14 +910,13 @@ "})" ))) (define-compilation unwind-protect (form &rest clean-up) - (js!selfcall - "var ret = " (ls-compile nil) ";" - "try {" - `(code "ret = " ,(ls-compile form) ";" ) - "} finally {" - `(code ,(ls-compile-block clean-up)) - "}" - "return ret;" )) + (js!selfcall* + `(var (|ret| ,(ls-compile nil))) + `(try + (= |ret| ,(ls-compile form))) + `(finally + ,(ls-compile-block clean-up)) + `(return |ret|))) (define-compilation multiple-value-call (func-form &rest forms) (js!selfcall