Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Patch lisp_simple_error to print stack.

  • Loading branch information...
commit e3489da0557494e94dcbd214d9bf3c470ec8bd45 1 parent 92c182c
@manuel authored
Showing with 8 additions and 3 deletions.
  1. +0 −2  browser.virtua
  2. +0 −1  repl.virtua
  3. +8 −0 standard.virtua
View
2  browser.virtua
@@ -1,5 +1,3 @@
-(set-setter! js-global (lambda (val name) (set-js-global! name val))) ;; doubleplusungood
-
(def alert (js-global "alert"))
(def *window* (js-global "window")) ;; eww
View
1  repl.virtua
@@ -64,7 +64,6 @@
(lambda (exc) #t)
(lambda (exc)
(print (make-repl-error exc))
- (print-stack-trace (stack-frame))
(return-from exit #f))
(lambda ()
(def input (get-slot (getElementById *document* "lisp_line") "value"))
View
8 standard.virtua
@@ -148,6 +148,7 @@
(defun setter (obj) (get-slot obj "setter"))
(defun set-setter! (obj setter) (set-slot! obj "setter" setter))
+(set-setter! js-global (lambda (val name) (set-js-global! name val))) ; erm
(defun define-js-method (name)
(def js-method (lambda (rcv . args)
@@ -293,6 +294,8 @@
(strcat (to-string kar) " . " (to-string kdr)))))
(strcat "(" (pair-to-string p) ")"))
+;;;; Debugging
+
(defmethod to-string ((frm Stack-Frame))
(strcat (to-string (get-slot frm "cmb")) " "
(to-string (get-slot frm "otree"))))
@@ -422,6 +425,11 @@
)
+(set! (js-global "lisp_simple_error")
+ (js-function (lambda (msg)
+ (print-stack-trace (stack-frame))
+ (js-throw msg))))
+
;; Permission is hereby granted, free of charge, to any person
;; obtaining a copy of this software and associated documentation
;; files (the "Software"), to deal in the Software without
Please sign in to comment.
Something went wrong with that request. Please try again.