diff --git a/CHANGELOG.md b/CHANGELOG.md index c7fba1c2..fda31494 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,10 @@ A preview of the next release can be installed from [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)) + +- [#1785](https://github.com/babashka/babashka/issues/1785): Allow subclasses of `Throwable` to have instance methods invoked ([@bobisageek](https://github.com/bobisageek)) +- [#1791](https://github.com/babashka/babashka/issues/1791): interop problem on Jsoup form element + ## 1.12.196 (2024-12-24) diff --git a/src/babashka/impl/classes.clj b/src/babashka/impl/classes.clj index 1f3d39dd..5124b4e3 100644 --- a/src/babashka/impl/classes.clj +++ b/src/babashka/impl/classes.clj @@ -804,6 +804,8 @@ java.util.Collection (instance? java.lang.Throwable v) java.lang.Throwable + (instance? org.jsoup.nodes.Element v) + org.jsoup.nodes.Element ;; keep commas for merge friendliness )] ;; (prn :res res) diff --git a/test/babashka/interop_test.clj b/test/babashka/interop_test.clj index 2aaddab5..de43acb6 100644 --- a/test/babashka/interop_test.clj +++ b/test/babashka/interop_test.clj @@ -224,7 +224,7 @@ ^"[Ljava.nio.file.LinkOption;" (into-array LinkOption [])))))))) -;; exercise a sampling of the superclass resolutions from the :public-class fn in +;; 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" @@ -236,4 +236,6 @@ ; 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 ")"))))))) + (bb nil (str "(.getMessage " return-throwable ")")))))) + (testing "jsoup Element" + (is (= "form" (bb nil "(.tagName (first (.getElementsByTag (org.jsoup.Jsoup/parseBodyFragment \"
\") \"form\")))")))))