Skip to content

Commit 5ea114c

Browse files
committed
lint cljs
1 parent 5282c0f commit 5ea114c

File tree

8 files changed

+36
-48
lines changed

8 files changed

+36
-48
lines changed

src/main/clojure/cljs/core/async.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@
548548
{:solos solos
549549
:mutes (pick :mute chs)
550550
:reads (conj
551-
(if (and (= mode :pause) (not (empty? solos)))
551+
(if (and (= mode :pause) (seq solos))
552552
(vec solos)
553553
(vec (remove pauses (keys chs))))
554554
change)}))

src/main/clojure/cljs/core/async/impl/channels.cljs

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -98,25 +98,24 @@
9898
(if (not ^boolean (impl/active? handler))
9999
nil
100100
(if (and (not (nil? buf)) (pos? (count buf)))
101-
(do
102-
(if-let [take-cb (impl/commit handler)]
103-
(let [val (impl/remove! buf)
104-
[done? cbs] (when (and (not (impl/full? buf)) (pos? (.-length puts)))
105-
(loop [cbs []]
106-
(let [putter (.pop puts)
107-
^not-native put-handler (.-handler putter)
108-
val (.-val putter)
109-
cb (and ^boolean (impl/active? put-handler) (impl/commit put-handler))
110-
cbs (if cb (conj cbs cb) cbs)
111-
done? (when cb (reduced? (add! buf val)))]
112-
(if (and (not done?) (not (impl/full? buf)) (pos? (.-length puts)))
113-
(recur cbs)
114-
[done? cbs]))))]
115-
(when done?
116-
(abort this))
117-
(doseq [cb cbs]
118-
(dispatch/run #(cb true)))
119-
(box val))))
101+
(if-let [take-cb (impl/commit handler)]
102+
(let [val (impl/remove! buf)
103+
[done? cbs] (when (and (not (impl/full? buf)) (pos? (.-length puts)))
104+
(loop [cbs []]
105+
(let [putter (.pop puts)
106+
^not-native put-handler (.-handler putter)
107+
val (.-val putter)
108+
cb (and ^boolean (impl/active? put-handler) (impl/commit put-handler))
109+
cbs (if cb (conj cbs cb) cbs)
110+
done? (when cb (reduced? (add! buf val)))]
111+
(if (and (not done?) (not (impl/full? buf)) (pos? (.-length puts)))
112+
(recur cbs)
113+
[done? cbs]))))]
114+
(when done?
115+
(abort this))
116+
(doseq [cb cbs]
117+
(dispatch/run #(cb true)))
118+
(box val)))
120119
(let [putter (loop []
121120
(let [putter (.pop puts)]
122121
(when putter
@@ -132,9 +131,9 @@
132131
(do
133132
(when buf (add! buf))
134133
(if (and (impl/active? handler) (impl/commit handler))
135-
(let [has-val (and buf (pos? (count buf)))]
136-
(let [val (when has-val (impl/remove! buf))]
137-
(box val)))
134+
(let [has-val (and buf (pos? (count buf)))
135+
val (when has-val (impl/remove! buf))]
136+
(box val))
138137
nil))
139138
(do
140139
(if (> dirty-takes MAX_DIRTY)

src/main/clojure/cljs/core/async/impl/ioc_macros.clj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
(:refer-clojure :exclude [all])
1414
(:require [clojure.pprint :refer [pprint]]
1515
[clojure.set :refer (intersection)]
16-
[clojure.core.async.impl.protocols :as impl]
17-
[clojure.core.async.impl.dispatch :as dispatch]
1816
[cljs.analyzer :as cljs])
1917
(:import [cljs.tagged_literals JSValue]))
2018

src/test/cljs/cljs/core/async/buffer_tests.cljs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@
77
;; You must not remove this notice, or any other, from this software.
88

99
(ns cljs.core.async.buffer-tests
10-
(:require-macros [cljs.core.async.macros :as m :refer [go]])
1110
(:require [cljs.core.async
12-
:refer [unblocking-buffer? buffer dropping-buffer sliding-buffer
13-
put! take! chan close!]]
14-
[cljs.core.async.impl.dispatch :as dispatch]
15-
[cljs.core.async.impl.buffers :as buff :refer [promise-buffer]]
11+
:refer [unblocking-buffer? buffer dropping-buffer sliding-buffer]]
12+
[cljs.core.async.impl.buffers :refer [promise-buffer]]
1613
[cljs.core.async.impl.protocols
1714
:refer [full? add! remove! close-buf!]]
1815
[cljs.core.async.test-helpers :refer-macros [throws?]]

src/test/cljs/cljs/core/async/pipeline_test.cljs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
;; You must not remove this notice, or any other, from this software.
88

99
(ns cljs.core.async.pipeline-test
10-
(:require-macros [cljs.core.async.macros :as m :refer [go go-loop]])
10+
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
1111
(:require [cljs.core.async.test-helpers :refer [latch inc!]]
12-
[cljs.core.async :as a
12+
[cljs.core.async
1313
:refer [<! >! chan close! to-chan! pipeline-async pipeline put!]]
1414
[cljs.test :refer-macros [deftest is testing async]]))
1515

@@ -79,7 +79,7 @@
7979
(let [cout (chan 1)
8080
chex (chan 1)
8181
ex-mapping (map (fn [x] (if (= x 3) (throw (ex-info "err" {:data x})) x)))
82-
ex-handler (fn [e] (do (put! chex e) :err))]
82+
ex-handler (fn [e] (put! chex e) :err)]
8383
(pipeline 5 cout ex-mapping (to-chan! [1 2 3 4]) true ex-handler)
8484
(is (= 1 (<! cout)))
8585
(is (= 2 (<! cout)))

src/test/cljs/cljs/core/async/runner_tests.cljs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@
77
;; You must not remove this notice, or any other, from this software.
88

99
(ns cljs.core.async.runner-tests
10-
(:require [cljs.core.async :refer [buffer dropping-buffer sliding-buffer put! take! chan close!]]
11-
[cljs.core.async.impl.dispatch :as dispatch]
12-
[cljs.core.async.impl.buffers :as buff]
13-
[cljs.core.async.impl.protocols :refer [full? add! remove!]]
10+
(:require [cljs.core.async.impl.protocols :refer [full? add! remove!]]
1411
[cljs.core.async.impl.ioc-helpers :as ioch])
15-
(:require-macros [cljs.core.async.test-helpers :as h :refer [is= is deftest testing runner locals-test]]
16-
[cljs.core.async.macros :as m :refer [go]]
12+
(:require-macros [cljs.core.async.test-helpers :refer [is= is deftest testing runner locals-test]]
13+
[cljs.core.async.macros :refer [go]]
1714
[cljs.core.async.impl.ioc-macros :as ioc]))
1815

1916
(defn pause [state blk val]

src/test/cljs/cljs/core/async/test_helpers.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
(defn latch [m f]
1212
(let [r (atom 0)]
1313
(add-watch r :latch
14-
(fn [_ _ o n]
14+
(fn [_ _ _o n]
1515
(when (== n m) (f))))
1616
r))
1717

src/test/cljs/cljs/core/async/tests.cljs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,14 @@
88

99
(ns cljs.core.async.tests
1010
(:require-macros
11-
[cljs.core.async.macros :as m :refer [go alt!]])
11+
[cljs.core.async.macros :refer [go alt!]])
1212
(:require
1313
[cljs.core.async :refer
14-
[buffer dropping-buffer sliding-buffer put! take! chan promise-chan
15-
close! take partition-by offer! poll! <! >! alts!] :as async]
16-
[cljs.core.async.impl.dispatch :as dispatch]
17-
[cljs.core.async.impl.buffers :as buff]
18-
[cljs.core.async.impl.timers :as timers :refer [timeout]]
19-
[cljs.core.async.impl.protocols :refer [full? add! remove!]]
14+
[put! take! chan promise-chan
15+
close! offer! poll! <! >! alts!] :as async]
16+
[cljs.core.async.impl.timers :refer [timeout]]
2017
[cljs.core.async.test-helpers :refer [latch inc!]]
21-
[cljs.test :as test :refer-macros [deftest is run-tests async testing]]
18+
[cljs.test :as test :refer-macros [deftest is async testing]]
2219
[goog.object :as gobj]))
2320

2421
(enable-console-print!)

0 commit comments

Comments
 (0)