From 3bf3b4e9c297c912ce26acf8b0c6d0609a56b5dc Mon Sep 17 00:00:00 2001 From: davidnolen Date: Fri, 1 Nov 2024 06:58:48 -0400 Subject: [PATCH] * host field & call --- src/test/clojure/cljs/analyzer/spec_tests.clj | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/test/clojure/cljs/analyzer/spec_tests.clj b/src/test/clojure/cljs/analyzer/spec_tests.clj index 371520fbb..61459a46b 100644 --- a/src/test/clojure/cljs/analyzer/spec_tests.clj +++ b/src/test/clojure/cljs/analyzer/spec_tests.clj @@ -96,6 +96,22 @@ (is (= :defrecord (-> body :statements first :ret :op))) (is (s/valid? ::a/node node)))) +(deftest test-host-call + (let [node (analyze ns-env '(.substring "foo" 0 1))] + (is (= :host-call (:op node))) + (is (s/valid? ::a/node node))) + (let [node (analyze ns-env '(. "foo" (substring 0 1)))] + (is (= :host-call (:op node))) + (is (s/valid? ::a/node node)))) + +(deftest test-host-field + (let [node (analyze ns-env '(.-length "foo"))] + (is (= :host-field (:op node))) + (is (s/valid? ::a/node node))) + (let [node (analyze ns-env '(. "foo" -length))] + (is (= :host-field (:op node))) + (is (s/valid? ::a/node node)))) + ; TODO: #js ;(deftest test-js-object ; )