Skip to content

Commit ca57179

Browse files
committed
broken example found by writing the guide
1 parent 9ad6d5d commit ca57179

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

src/test/clojure/cljs/analyzer_tests.clj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,4 +787,22 @@
787787
(map (comp :externs second)
788788
(get @test-cenv ::a/namespaces))))))
789789

790+
;; wrong
791+
(let [test-cenv (atom {::a/externs (externs/externs-map
792+
(closure/load-externs
793+
{:externs ["src/test/externs/test.js"]}))})]
794+
(binding [a/*cljs-ns* a/*cljs-ns*
795+
a/*cljs-warnings* (assoc a/*cljs-warnings* :infer-warning true)]
796+
(e/with-compiler-env test-cenv
797+
(a/analyze-form-seq
798+
'[(fn [^js/Foo.Bar x]
799+
(let [z (.baz x)]
800+
(.-wozz z)))]))
801+
(cc/emit-externs
802+
(reduce util/map-merge {}
803+
(map (comp :externs second)
804+
(get @test-cenv ::a/namespaces))))))
805+
806+
;; TODO: test (def foo (js/require "bar.js")) pattern
807+
790808
)

0 commit comments

Comments
 (0)