function Promise.prototype.cancel(o)if o._status~=Promise.Status.Started then return end o._status=Promise.Status.Cancelled if o._cancellationHook then o._cancellationHook()end if o._parent then o._parent:_consumerCancelled(o)end for o in pairs(o._consumers)do o:cancel()end o:_finalize()end Promise.prototype.Cancel=Promise.prototype.cancel
--[[
	Cancels the promise, disallowing it from rejecting or resolving, and calls
	the cancellation hook if provided.
]]
function Promise.prototype:cancel()
	if self._status ~= Promise.Status.Started then
		return
	end

	self._status = Promise.Status.Cancelled

	if self._cancellationHook then
		self._cancellationHook()
	end

	if self._parent then
		self._parent:_consumerCancelled(self)
	end

	for child in pairs(self._consumers) do
		child:cancel()
	end

	self:_finalize()
end
Promise.prototype.Cancel = Promise.prototype.cancel
