From 77c462b5718000fe07eed0ff344edfea3f2eaff8 Mon Sep 17 00:00:00 2001 From: pmurias Date: Sat, 24 Mar 2018 19:46:47 +0100 Subject: [PATCH] [js] Make .hyper and .race just return the unmodified iterator Most JS VMs lack the threading support needed for that --- src/core/Iterable.pm6 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/core/Iterable.pm6 b/src/core/Iterable.pm6 index e610610c751..e87133ee900 100644 --- a/src/core/Iterable.pm6 +++ b/src/core/Iterable.pm6 @@ -122,20 +122,30 @@ my role Iterable { method hyper(Int(Cool) :$batch = 64, Int(Cool) :$degree = 4) { self!valid-hyper-race('hyper', $batch, $degree); +#?if !js HyperSeq.new: configuration => HyperConfiguration.new(:$degree, :$batch), work-stage-head => Rakudo::Internals::HyperIteratorBatcher.new( iterator => self.iterator ) +#?endif +#?if js + self +#?endif } method race(Int(Cool) :$batch = 64, Int(Cool) :$degree = 4) { self!valid-hyper-race('race', $batch, $degree); +#?if !js RaceSeq.new: configuration => HyperConfiguration.new(:$degree, :$batch), work-stage-head => Rakudo::Internals::HyperIteratorBatcher.new( iterator => self.iterator ) +#?endif +#?if js + self +#?endif } sub MIXIFY(\iterable, \type) {