Skip to content

Commit 38e19b3

Browse files
author
dnolen
committed
document problematic cases
1 parent 8b32c51 commit 38e19b3

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

src/test/clojure/cljs/analyzer_tests.clj

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,14 +660,30 @@
660660
(a/analyze-form-seq
661661
'[(ns foo.core)
662662
(defn baz [^js/Foo a]
663-
(.wozMethod a)
664-
(.gozMethod a))
663+
(.wozMethod a))
665664
(js/console.log (.wozMethod (js/Foo.)))
666665
(js/console.log (.wozMethod (js/baz)))]))
667666
(cc/emit-externs
668667
(reduce util/map-merge {}
669668
(map (comp :externs second)
670669
(get @test-cenv ::a/namespaces))))))
671670

671+
;; the following should produce externs, but does not
672+
(let [test-cenv (atom {::a/externs (externs/externs-map
673+
(closure/load-externs
674+
{:externs ["src/test/externs/test.js"]}))})]
675+
(binding [a/*cljs-ns* a/*cljs-ns*
676+
a/*cljs-warnings* (assoc a/*cljs-warnings* :infer-warning true)]
677+
(e/with-compiler-env test-cenv
678+
(a/analyze-form-seq
679+
'[(ns foo.core)
680+
(defn baz [^js/Foo a]
681+
(.gozMethod a))
682+
(js/console.log (.gozMethod (js/baz)))]))
683+
(cc/emit-externs
684+
(reduce util/map-merge {}
685+
(map (comp :externs second)
686+
(get @test-cenv ::a/namespaces))))))
687+
672688

673689
)

0 commit comments

Comments
 (0)