mirror of
https://github.com/bjc/prosody.git
synced 2025-04-03 21:27:38 +03:00
util.promise: Switch order of parameters to join()
This saves awkward fiddlery with varargs and also echoes the signature of pcall/xpcall.
This commit is contained in:
parent
fec0d44e89
commit
d1ccd87d55
2 changed files with 4 additions and 6 deletions
|
@ -498,10 +498,10 @@ describe("util.promise", function ()
|
|||
local res1, res2;
|
||||
local p1, p2 = promise.new(function (resolve) r1 = resolve end), promise.new(function (resolve) r2 = resolve end);
|
||||
|
||||
local p = promise.join(p1, p2, function (_res1, _res2)
|
||||
local p = promise.join(function (_res1, _res2)
|
||||
res1, res2 = _res1, _res2;
|
||||
return promise.resolve("works");
|
||||
end);
|
||||
end, p1, p2);
|
||||
|
||||
local result;
|
||||
local cb = spy.new(function (v)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue