add proper error message for QML Lisp.call() when function is undefined

This commit is contained in:
pls.153 2023-05-25 12:35:47 +02:00
parent dd316078d0
commit 69ddceb104

View file

@ -19,11 +19,16 @@
;; Every 'Lisp.call()' or 'Lisp.apply()' function call in QML will call this
;: function. The variable *CALLER* will be bound to the calling QQuickItem,
;; if passed with 'this' as first argument to 'Lisp.call()' / 'Lisp.apply()'.
(let ((*caller* (if (zerop caller)
(let ((fun (string-to-symbol function))
(*caller* (if (zerop caller)
*caller*
(qt-object caller))))
(apply (string-to-symbol function)
arguments)))
(if (fboundp fun)
(apply fun arguments)
(let ((msg (format nil "[LQML:error] Lisp.call(): function ~S is undefined." function)))
(when *break-on-errors*
(break msg)
(format *error-output* "~%~A~%" msg))))))
;;; utils