(CLJS) cljs alts! not non-deterministic

Description

In cljs, clojure.core.async/random-array's shuffle was incorrect, leading it to always return [1 0] for arg n=2. This breaks the promise that alts! is non-deterministic w.r.t. op selection by always trying the second element first. Additionally, the first op is never chosen first for alts! of any size N>1.

Use goog.array.shuffle to do the shuffle instead. (This API is also used by cljs.core/shuffle)

New implementation passes tests and behaves better:

Environment

None

Activity

Show:
Mike Fikes
June 11, 2019, 12:59 PM

ASYNC-227.patch LGTM

Ghadi Shayban
June 11, 2019, 3:43 PM

fixed in 14bed8383516ab119c3fc51c2882112000eb5664 , 0.4.500

Alex Miller
January 9, 2020, 5:30 PM

Closing, wasn't closed on release by accident

Completed

Assignee

Ghadi Shayban

Reporter

Ghadi Shayban

Labels

None

Approval

None

Patch

Code

Priority

Critical