|
|
|
|
|
by abecedarius
4824 days ago
|
|
Something else I'm unsure about: line 67, `results[i] = r`, refers from a closure back to i initialized at line 52 in a loop. If this loop pops more than one deferral, then won't each deferral's callback use the same i? Since Javascript assigns to function-level i in the loop, it doesn't bind a new one. OTOH if the loop only ever pops at most one deferral, then an if instead of a while would make this clear. |
|
Popping multiple synchronous tasks after an asynchronous one is fairly rare, but I’ll make sure the tests verify this code path.