function Promise.prototype._consumerCancelled(U,A)if U._status~=Promise.Status.Started then return end U._consumers[A]=nil if next(U._consumers)==nil then U:cancel()end end

function Promise.prototype:_consumerCancelled(consumer)
	if self._status ~= Promise.Status.Started then
		return
	end

	self._consumers[consumer] = nil

	if next(self._consumers) == nil then
		self:cancel()
	end
end
