Bogdan, thanks for the feedback. I'll apply your test patch.
Bogdan Bugarschi May 23, 2017 at 5:22 PM
Fix looks good as far as i can tell, but i think you should update the tests to account for this bug as well. There already is a test for that case, it's just not correct. it's "put on promise-chan fulfills all pending takers" from tests.cljs. basically the go block around the test needs to moved inside (see my 0002 patch for the tests).
promise-chan in ClojureScript does not seem to work. In Clojure on the JVM, the code below produces the expected result.
Example:
(ns hush-vendor-cljs.example
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [cljs.core.async :refer [promise-chan <! >!]]))
(def p (promise-chan))
(def go-1 (go (let [r (<! p)] (println "got value on promise-chan::" r))))
(def go-2 (go (let [r (<! p)] (println "got value on promise-chan::" r))))
(go (>! p 1))
;This prints only once in ClojureScript, should be twice. It works on JVM Clojure (prints twice).
;=> got value on promise-chan:: 1