This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-10
Channels
- # arachne (2)
- # beginners (5)
- # boot (6)
- # cider (3)
- # cljsrn (2)
- # clojure (34)
- # clojure-brasil (1)
- # clojure-poland (1)
- # clojure-spec (52)
- # clojure-sweden (1)
- # clojurescript (17)
- # datomic (14)
- # leiningen (3)
- # luminus (2)
- # om (85)
- # proton (89)
- # protorepl (1)
- # re-frame (1)
- # reagent (8)
- # ring-swagger (1)
- # spacemacs (2)
- # yada (6)
Is anyone here doing any work with cljs on node.js i.e. lein cljsbuild compiler option :target :nodejs
and have any suggestions to get same devtools/debug experience as in browser. add (js-debugger) and just breakpoint, source mapping etc
I have data structures like {0 0.0, 1 0.1, 2 0.2, 3 0.3, 4 0.4, 5 1.0}
(maps of integers from 0 to 5, where one of the values must be 1.0 and all of the values must be within [0,1])
I can generate these things with this function:
(defn generate-random-map
"Return a random structured map"
[]
(let [values (sort (repeatedly 6 rand))
pivot-value (last values)]
(into {} (map-indexed vector (map #(/ % pivot-value) values)))))
i think i've found a cljs.test bug, can anyone confirm?
(def ^:dynamic *foo* nil)
(deftest async-binding-before
(async done
(binding [*foo* {}]
(is (some? *foo*))
(done))))
(deftest async-binding-after
(async done
(is (nil? *foo*))
(done)))
Result:
FAIL in (async-binding-after) (:)
expected: (nil? *foo*)
actual: (not (nil? {}))
it reproduced against master as well, so i filed a ticket http://dev.clojure.org/jira/browse/CLJS-1705
https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/test.cljs#L116
in my test where i discovered the issue, it was. i provided the minimal repro case
okay that is odd. so i originally encountered it in a test that depends on core async. the binding was inside a go
block, and never unbound.
i then tried to isolate the bug with a minimal test case, which i did write synchronously and seemingly it was reproduced.
but when i wrap the done call in a js/setTimeout
it no longer reproduces.
so i may've found two bugs in one.
I also have found similar situation in go blocks (some time ago) that binding are corrupted
well there is certainly a bug somewhere. in no case should binding
corrupt vars
the issue has deeper roots I guess, http://dev.clojure.org/jira/browse/CLJS-1634