throw/catch uses CatchNLX object instead of plain object
[jscl.git] / src / toplevel.lisp
index 42864e6..3c38003 100644 (file)
     (#j:jqconsole:Prompt t #'process-input)))
 
 
-;;; KLUDGE: I tried
-;;; 
-;;;   (#j:document.addEventListener "load" #'topevel nil)
-;;; 
-;;; but it is not working. So I am using this temporarily to wait
-;;; until the DOM is ready before starting the REPL.
+(defun init (&rest args)
+  (#j:jqconsole:RegisterMatching "(" ")" "parents")
+  (load-history)
+  (toplevel))
 
-(#j:setTimeout (lambda ()
-                 (#j:jqconsole:RegisterMatching "(" ")" "parents")
-                 (load-history)
-                 (toplevel))
-               0)
+(#j:window:addEventListener "load" #'init)