aboutsummaryrefslogtreecommitdiff
path: root/lux-js
diff options
context:
space:
mode:
authorEduardo Julian2022-08-11 16:50:42 -0400
committerEduardo Julian2022-08-11 16:50:42 -0400
commite5625dd840a8b8adc76987f649da254335d3d93a (patch)
treefb672669383525d90d462edf8c141f98bc953894 /lux-js
parent065e8a4d8122d4616b570496915d2c0e2c78cd6b (diff)
Improved exception-definition macro.
Diffstat (limited to 'lux-js')
-rw-r--r--lux-js/source/program.lux17
1 files changed, 10 insertions, 7 deletions
diff --git a/lux-js/source/program.lux b/lux-js/source/program.lux
index 233db1518..665b4e8aa 100644
--- a/lux-js/source/program.lux
+++ b/lux-js/source/program.lux
@@ -9,7 +9,7 @@
[control
["[0]" maybe (.use "[1]#[0]" monad)]
["[0]" try (.only Try)]
- ["[0]" exception (.only exception)]
+ ["[0]" exception (.only Exception)]
["[0]" io (.only IO io)]
["[0]" function]
[concurrency
@@ -70,7 +70,8 @@
[program
["/" compositor]])
-(exception (null_has_no_lux_representation [code (Maybe _.Expression)])
+(exception.def (null_has_no_lux_representation code)
+ (Exception (Maybe _.Expression))
(when code
{.#Some code}
(_.code code)
@@ -153,8 +154,8 @@
[StructureValue]
)
- (exception (unknown_member [member Text
- object java/lang/Object])
+ (exception.def (unknown_member [member object])
+ (Exception [Text java/lang/Object])
(exception.report
(list ["Member" member]
["Object" (debug.inspection object)])))
@@ -320,9 +321,10 @@
(as java/lang/Object)))
))))
- (exception undefined_has_no_lux_representation)
+ (exception.def undefined_has_no_lux_representation)
- (exception (unknown_kind_of_host_object [object java/lang/Object])
+ (exception.def (unknown_kind_of_host_object object)
+ (Exception java/lang/Object)
(exception.report
(list ["Class" (ffi.of_string (java/lang/Object::toString (java/lang/Object::getClass object)))]
["Object" (ffi.of_string (java/lang/Object::toString object))]
@@ -486,7 +488,8 @@
(array.has! 1 (to_js lux)))
macro))))
- (exception (cannot_apply_a_non_function [object java/lang/Object])
+ (exception.def (cannot_apply_a_non_function object)
+ (Exception java/lang/Object)
(exception.report
(list ["Object" (ffi.of_string (java/lang/Object::toString object))])))