function Promise.resolved(...)local D=select("\035",...)if D==0 then return _emptyFulfilledPromise elseif D==1 and Promise.isPromise(...)then local D=...if not D._pendingExecuteList then return D end end local d=Promise.new()d:Resolve(...)return d end

function Promise.resolved(...)
	local n = select("#", ...)
	if n == 0 then
		-- Reuse promise here to save on calls to Promise.resolved()
		return _emptyFulfilledPromise
	elseif n == 1 and Promise.isPromise(...) then
		local promise = (...)

		-- Resolving to promise that is already resolved. Just return the promise!
		if not promise._pendingExecuteList then
			return promise
		end
	end

	local promise = Promise.new()
	promise:Resolve(...)
	return promise
end
