Skip to content

Commit 70fb827

Browse files
committed
1 parent 1d17459 commit 70fb827

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ For a list of breaking changes, check [here](#breaking-changes).
44

55
[Nbb](https://github.com/babashka/nbb): Scripting in Clojure on Node.js using [SCI](https://github.com/babashka/sci)
66

7+
## Unreleased
8+
9+
- [#408](https://github.com/babashka/nbb/issues/408): support `IFn` on `defrecord` and `reify`
10+
711
## 1.4.206 (2026-02-07)
812

913
- Support async/await. See [docs](https://github.com/babashka/sci/blob/master/doc/async-await.md) for syntax.

deps.edn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#_{:local/root "../babashka/sci"}
1717
#_{:mvn/version "0.12.51"}
1818
{:git/url "https://github.com/babashka/sci"
19-
:git/sha "ab0953fc9a8407456c5708bae57bf745c63fe27d"}
19+
:git/sha "9bc5ee7371ddd24a6715066e47573f80addc98e7"}
2020
org.clojure/tools.cli {:mvn/version "1.0.214"}
2121
com.cognitect/transit-cljs {:mvn/version "0.8.280"}
2222
#_#_prismatic/schema {:mvn/version "1.3.0"}

test/nbb/main_test.cljs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,18 @@ result")
350350
(fn [val]
351351
(is (= [2 2] val))))))
352352

353+
(deftest-async defrecord-ifn-test
354+
(-> (nbb/load-string "(defrecord Dude [] IFn (-invoke [_] 1))")
355+
(.then (fn [_]
356+
(nbb/load-string "((->Dude))")))
357+
(.then (fn [val]
358+
(is (= 1 val))))))
359+
360+
(deftest-async reify-ifn-test
361+
(-> (nbb/load-string "((reify IFn (-invoke [_] 1)))")
362+
(.then (fn [val]
363+
(is (= 1 val))))))
364+
353365
(defn init []
354366
(t/run-tests 'nbb.main-test 'nbb.test-test))
355367

0 commit comments

Comments
 (0)