(iterable)
| 93 | return signal.self; |
| 94 | } |
| 95 | static any(iterable) { |
| 96 | const signal = new AbortSignal(AbortSignalBrand.token); |
| 97 | const sources = []; |
| 98 | for (let self of iterable) { |
| 99 | const source = AbortSignalBrand.get(self); |
| 100 | if (sources.indexOf(source) < 0) |
| 101 | source.push(source); |
| 102 | } |
| 103 | for (let source of sources) { |
| 104 | if (source.aborted) { |
| 105 | triggerAbortSignal(signal, source.reason); |
| 106 | return signal.self; |
| 107 | } |
| 108 | } |
| 109 | for (let source of sources) { |
| 110 | if (source.dependents) |
| 111 | source.dependents.push(signal); |
| 112 | else |
| 113 | source.dependents = [ signal ]; |
| 114 | } |
| 115 | return signal.self; |
| 116 | } |
| 117 | static timeout(duration) { |
| 118 | const signal = new AbortSignal(AbortSignalBrand.token); |
| 119 | setTimeout(() => { |
nothing calls this directly
no test coverage detected