changeset 11490 | 78d843faaffc |
parent 11489 | 7d42ed3a8a40 |
child 11951 | 073e53b72792 |
--- a/util/promise.lua Thu Mar 25 14:32:32 2021 +0000 +++ b/util/promise.lua Thu Mar 25 15:08:22 2021 +0000 @@ -146,12 +146,10 @@ end); end -local function join(...) +local function join(handler, ...) local promises, n = { ... }, select("#", ...); - local handler = promises[n]; - promises[n] = nil; return all(promises):next(function (results) - return handler(unpack(results, 1, n - 1)); + return handler(unpack(results, 1, n)); end); end