function Promise.prototype.awaitValue(G,...)local N,t=pack(G:awaitStatus(...))local c=table.remove(t,1)assert(c==Promise.Status.Resolved,tostring(t[1]==nil and""or t[1]))return unpack(t,1,N-1)end
--[[
	Calls await and only returns if the Promise resolves.
	Throws if the Promise rejects or gets cancelled.
]]
function Promise.prototype:awaitValue(...)
	local length, result = pack(self:awaitStatus(...))
	local status = table.remove(result, 1)

	assert(status == Promise.Status.Resolved, tostring(result[1] == nil and "" or result[1]))

	return unpack(result, 1, length - 1)
end
