aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-03-22 23:15:04 +0100
committerKim Alvefur <zash@zash.se>2018-03-22 23:15:04 +0100
commit1ca1c9bb323f9c30f287fa358b7cdcf7bafcc092 (patch)
tree9a30c28220b04fe92a824a88bbc76f050ff40591
parentc0912560a42d1ea8615a9806d3e92d743aed6bfb (diff)
downloadprosody-1ca1c9bb323f9c30f287fa358b7cdcf7bafcc092.tar.gz
prosody-1ca1c9bb323f9c30f287fa358b7cdcf7bafcc092.zip
util.async: Use wrapper for once runner (thanks luacheck)
-rw-r--r--spec/util_async_spec.lua1
-rw-r--r--util/async.lua2
2 files changed, 2 insertions, 1 deletions
diff --git a/spec/util_async_spec.lua b/spec/util_async_spec.lua
index 7c1696b5..959ad65b 100644
--- a/spec/util_async_spec.lua
+++ b/spec/util_async_spec.lua
@@ -601,6 +601,7 @@ describe("util.async", function()
end);
async.once(f);
assert.spy(f).was.called();
+ assert.spy(f).was.called_with();
end);
it("should propagate errors", function ()
local function should_error()
diff --git a/util/async.lua b/util/async.lua
index e8469e51..f042b177 100644
--- a/util/async.lua
+++ b/util/async.lua
@@ -231,7 +231,7 @@ do
};
local function once_runner(func) func(); end
function once(func)
- local r = runner(func, once_watchers);
+ local r = runner(once_runner, once_watchers);
return r:run(func);
end
end