Skip to content

Commit

Permalink
* host field & call
Browse files Browse the repository at this point in the history
  • Loading branch information
swannodette committed Nov 1, 2024
1 parent d0ece88 commit 3bf3b4e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/test/clojure/cljs/analyzer/spec_tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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
; )
Expand Down

0 comments on commit 3bf3b4e

Please sign in to comment.