Renamed with-timeout to do-set-timeout, added ignore errors.
authorVladimir Sedach <vsedach@gmail.com>
Thu, 21 Jun 2007 17:54:16 +0000 (17:54 +0000)
committerVladimir Sedach <vsedach@gmail.com>
Thu, 21 Jun 2007 17:54:16 +0000 (17:54 +0000)
Thanks to: John Fremlin <john@fremlin.org>

src/js-utils.lisp

index 31afd30..924840a 100644 (file)
@@ -3,7 +3,7 @@
 ;;; Handy utilities for doing common tasks found in many web browser
 ;;; JavaScript implementations
 
-(defjsmacro with-timeout ((timeout) &body body)
+(defjsmacro do-set-timeout ((timeout) &body body)
   `(set-timeout (lambda () ,@body) ,timeout))
 
 ;;; Arithmetic
@@ -29,3 +29,8 @@
     (random (&optional upto) (if upto
                                  `(floor (* ,upto (*math.random)))
                                  '(*math.random))))
+
+;;; Exception handling
+
+(defjsmacro ignore-errors (&body body)
+  `(try (progn ,@body) (:catch (e))))