mirror of https://github.com/status-im/reagent.git
Fix infer externs problem in with-let macro, fixes #420
This commit is contained in:
parent
d4038cb911
commit
ddd7f9a070
|
@ -54,7 +54,8 @@
|
||||||
:output-to "target/cljsbuild/client/public/js/main.js"
|
:output-to "target/cljsbuild/client/public/js/main.js"
|
||||||
:npm-deps false
|
:npm-deps false
|
||||||
:asset-path "js/out"
|
:asset-path "js/out"
|
||||||
:checked-arrays :warn}}
|
:checked-arrays :warn
|
||||||
|
:infer-externs true}}
|
||||||
|
|
||||||
{:id "client-npm"
|
{:id "client-npm"
|
||||||
:source-paths ["demo"]
|
:source-paths ["demo"]
|
||||||
|
@ -79,7 +80,8 @@
|
||||||
:output-to "target/cljsbuild/test/main.js"
|
:output-to "target/cljsbuild/test/main.js"
|
||||||
:npm-deps false
|
:npm-deps false
|
||||||
:aot-cache true
|
:aot-cache true
|
||||||
:checked-arrays :warn}}
|
:checked-arrays :warn
|
||||||
|
:infer-externs true}}
|
||||||
|
|
||||||
{:id "test-npm"
|
{:id "test-npm"
|
||||||
:source-paths ["test"]
|
:source-paths ["test"]
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
asserting (if *assert* true false)]
|
asserting (if *assert* true false)]
|
||||||
`(let [~v (reagent.ratom/with-let-values ~k)]
|
`(let [~v (reagent.ratom/with-let-values ~k)]
|
||||||
(when ~asserting
|
(when ~asserting
|
||||||
(when-some [c# reagent.ratom/*ratom-context*]
|
(when-some [^clj c# reagent.ratom/*ratom-context*]
|
||||||
(when (== (.-generation ~v) (.-ratomGeneration c#))
|
(when (== (.-generation ~v) (.-ratomGeneration c#))
|
||||||
(d/error "Warning: The same with-let is being used more "
|
(d/error "Warning: The same with-let is being used more "
|
||||||
"than once in the same reactive context."))
|
"than once in the same reactive context."))
|
||||||
|
|
|
@ -6,6 +6,10 @@
|
||||||
:refer [flush track track! dispose!] :refer-macros [with-let]]
|
:refer [flush track track! dispose!] :refer-macros [with-let]]
|
||||||
[clojure.walk :as w]))
|
[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]
|
(defn fixture [f]
|
||||||
(set! rv/debug true)
|
(set! rv/debug true)
|
||||||
(f)
|
(f)
|
||||||
|
|
Loading…
Reference in New Issue