Skip to content

Commit 0f19c3e

Browse files
committed
Test
1 parent 8ecf8b2 commit 0f19c3e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/sci/interop_test.cljc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,9 @@
380380
(is (= 1 (sci/eval-string "(def x #js {:foo_bar (fn [] 1)}) (.foo-bar x)" {:classes {:allow :all}})))
381381
(is (= {:foo_bar 1} (sci/eval-string "(js->clj (doto #js {} (set! -foo-bar 1)) :keywordize-keys true)" {:classes {:allow :all}})))))
382382

383-
(deftest issue-987-deftype-munged-fields-test
384-
(is (= 1 (sci/eval-string "(deftype Foo [foo-bar]) (.-foo-bar (->Foo 1))" {:classes {:allow :all}})))
385-
(is (= 1 (sci/eval-string "(deftype Foo [foo-bar]) (.-foo_bar (->Foo 1))" {:classes {:allow :all}}))))
383+
#?(:clj
384+
(deftest issue-987-deftype-munged-fields-test
385+
;; these cases don't work in CLJS yet because {:classes {:allow :all}} takes the fast path
386+
;; perhaps we can fix this by exposing the deftype as an Object in CLJS with mutated fields
387+
(is (= 1 (sci/eval-string "(deftype Foo [foo-bar]) (.-foo-bar (->Foo 1))" {:classes {:allow :all}})))
388+
(is (= 1 (sci/eval-string "(deftype Foo [foo-bar]) (.-foo_bar (->Foo 1))" {:classes {:allow :all}})))))

0 commit comments

Comments
 (0)