Add type assertion to onCancel

This commit is contained in:
Eryn Lynn 2018-10-24 03:10:20 -04:00
parent dbcad4ab4b
commit 4f5ed034e0

View file

@ -168,6 +168,8 @@ function Promise.new(callback, parent)
end
local function onCancel(cancellationHook)
assert(type(cancellationHook) == "function", "onCancel must be called with a function as its first argument.")
self._cancellationHook = cancellationHook
end