This commit is contained in:
parent
d8521888cc
commit
3cddc33334
3 changed files with 19 additions and 0 deletions
|
|
@ -7,6 +7,9 @@ A preview of the next release can be installed from
|
||||||
|
|
||||||
[Babashka](https://github.com/babashka/babashka): Native, fast starting Clojure interpreter for scripting
|
[Babashka](https://github.com/babashka/babashka): Native, fast starting Clojure interpreter for scripting
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
- [#1785](https://github.com/babashka/babashka/issues/1785): Allow subclasses of `Throwable` to have instance methods invoked ([@bobisageek](https://github.com/bobisageek))
|
||||||
|
|
||||||
## 1.12.196 (2024-12-24)
|
## 1.12.196 (2024-12-24)
|
||||||
|
|
||||||
- [#1771](https://github.com/babashka/babashka/issues/1771): `*e*` in REPL should contain exception thrown by user, not a wrapped one
|
- [#1771](https://github.com/babashka/babashka/issues/1771): `*e*` in REPL should contain exception thrown by user, not a wrapped one
|
||||||
|
|
|
||||||
|
|
@ -802,6 +802,8 @@
|
||||||
java.io.Closeable
|
java.io.Closeable
|
||||||
(instance? java.util.Collection v)
|
(instance? java.util.Collection v)
|
||||||
java.util.Collection
|
java.util.Collection
|
||||||
|
(instance? java.lang.Throwable v)
|
||||||
|
java.lang.Throwable
|
||||||
;; keep commas for merge friendliness
|
;; keep commas for merge friendliness
|
||||||
)]
|
)]
|
||||||
;; (prn :res res)
|
;; (prn :res res)
|
||||||
|
|
|
||||||
|
|
@ -223,3 +223,17 @@
|
||||||
UserDefinedFileAttributeView
|
UserDefinedFileAttributeView
|
||||||
^"[Ljava.nio.file.LinkOption;"
|
^"[Ljava.nio.file.LinkOption;"
|
||||||
(into-array LinkOption []))))))))
|
(into-array LinkOption []))))))))
|
||||||
|
|
||||||
|
;; exercise a sampling of the superclass resolutions from the :public-class fn in
|
||||||
|
;; babashka.impl.classes/gen-class-map
|
||||||
|
(deftest public-class-resolutions
|
||||||
|
(testing "Charset"
|
||||||
|
(is (= "UTF-8" (bb nil "(.displayName (java.nio.charset.Charset/forName \"UTF-8\"))"))))
|
||||||
|
(testing "InputStream"
|
||||||
|
(is (zero? (bb nil "(with-open [is (java.io.InputStream/nullInputStream)]
|
||||||
|
(.available is))"))))
|
||||||
|
(testing "Throwable"
|
||||||
|
; compare output from ex-message to calling .getMessage
|
||||||
|
(let [return-throwable "(try (yaml/parse-string \"abc: def: ghi\") (catch Exception e e))"]
|
||||||
|
(is (= (bb nil (str "(ex-message " return-throwable ")"))
|
||||||
|
(bb nil (str "(.getMessage " return-throwable ")")))))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue