Skip to content

Commit 3bf3b4e

Browse files
committed
* host field & call
1 parent d0ece88 commit 3bf3b4e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/test/clojure/cljs/analyzer/spec_tests.clj

+16
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,22 @@
9696
(is (= :defrecord (-> body :statements first :ret :op)))
9797
(is (s/valid? ::a/node node))))
9898

99+
(deftest test-host-call
100+
(let [node (analyze ns-env '(.substring "foo" 0 1))]
101+
(is (= :host-call (:op node)))
102+
(is (s/valid? ::a/node node)))
103+
(let [node (analyze ns-env '(. "foo" (substring 0 1)))]
104+
(is (= :host-call (:op node)))
105+
(is (s/valid? ::a/node node))))
106+
107+
(deftest test-host-field
108+
(let [node (analyze ns-env '(.-length "foo"))]
109+
(is (= :host-field (:op node)))
110+
(is (s/valid? ::a/node node)))
111+
(let [node (analyze ns-env '(. "foo" -length))]
112+
(is (= :host-field (:op node)))
113+
(is (s/valid? ::a/node node))))
114+
99115
; TODO: #js
100116
;(deftest test-js-object
101117
; )

0 commit comments

Comments
 (0)