Skip to content

Commit 291fe66

Browse files
committed
down to one failure
1 parent 626b383 commit 291fe66

File tree

4 files changed

+18
-67
lines changed

4 files changed

+18
-67
lines changed

examples/src/Examples.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ module Examples where
142142
liftEff $ trace "Testing Par (<|>) - kill two"
143143
test_parRaceKill2
144144

145-
-- liftEff $ trace "Testing cancel of Par (<|>)"
146-
-- test_cancelPar
145+
liftEff $ trace "Testing cancel of Par (<|>)"
146+
test_cancelPar
147147

148148
liftEff $ trace "Done testing"

output/examples.js

Lines changed: 8 additions & 59 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Control/Monad/Aff.purs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,15 +318,17 @@ module Control.Monad.Aff
318318
var onCanceler = function(){};
319319
320320
canceler1 = aff(function(v) {
321-
if (!requestCancel) {
321+
if (requestCancel) {
322+
isCanceled = true;
323+
324+
return alwaysCanceler;
325+
} else {
322326
canceler2 = f(v)(success, error);
323327
324328
onCanceler(canceler2);
325-
} else {
326-
isCanceled = true;
327-
}
328329
329-
return canceler;
330+
return canceler2;
331+
}
330332
}, error);
331333
332334
return function(e) {

src/Control/Monad/Aff/Par.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module Control.Monad.Aff.Par
5656
ve <- makeVar' 0 -- the error count (starts at 0)
5757
c1 <- forkAff $ attempt a1 >>= either (maybeKill va ve) (putVar va)
5858
c2 <- forkAff $ attempt a2 >>= either (maybeKill va ve) (putVar va)
59-
(takeVar va) `cancelWith` (c1 <> c2)
59+
(takeVar va) -- `cancelWith` (c1 <> c2)
6060

6161
instance plusPar :: Plus (Par e) where
6262
empty = Par empty

0 commit comments

Comments
 (0)