Fix infer externs problem in with-let macro, fixes #420

This commit is contained in:
Juho Teperi 2019-01-10 21:03:09 +02:00
parent d4038cb911
commit ddd7f9a070
3 changed files with 9 additions and 3 deletions

View File

@ -54,7 +54,8 @@
:output-to "target/cljsbuild/client/public/js/main.js"
:npm-deps false
:asset-path "js/out"
:checked-arrays :warn}}
:checked-arrays :warn
:infer-externs true}}
{:id "client-npm"
:source-paths ["demo"]
@ -79,7 +80,8 @@
:output-to "target/cljsbuild/test/main.js"
:npm-deps false
:aot-cache true
:checked-arrays :warn}}
:checked-arrays :warn
:infer-externs true}}
{:id "test-npm"
:source-paths ["test"]

View File

@ -63,7 +63,7 @@
asserting (if *assert* true false)]
`(let [~v (reagent.ratom/with-let-values ~k)]
(when ~asserting
(when-some [c# reagent.ratom/*ratom-context*]
(when-some [^clj c# reagent.ratom/*ratom-context*]
(when (== (.-generation ~v) (.-ratomGeneration c#))
(d/error "Warning: The same with-let is being used more "
"than once in the same reactive context."))

View File

@ -6,6 +6,10 @@
:refer [flush track track! dispose!] :refer-macros [with-let]]
[clojure.walk :as w]))
;; Test code generated from with-let macro
;; https://github.com/reagent-project/reagent/issues/420
(set! *warn-on-infer* true)
(defn fixture [f]
(set! rv/debug true)
(f)