function Promise.prototype._finalize(J)for p,A in ipairs(J._queuedFinally)do A(J._status)end J._parent=nil J._consumers=nil end return Promise

function Promise.prototype:_finalize()
	for _, callback in ipairs(self._queuedFinally) do
		-- Purposefully not passing values to callbacks here, as it could be the
		-- resolved values, or rejected errors. If the developer needs the values,
		-- they should use :andThen or :catch explicitly.
		callback(self._status)
	end

	-- Allow family to be buried
	self._parent = nil
	self._consumers = nil
end

return Promise
