function Promise.prototype.awaitStatus(z)z._unhandledRejection=false if z._status==Promise.Status.Started then local h=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")z:finally(function()h:Fire()end)h.Event:Wait()h:Destroy()end if z._status==Promise.Status.Resolved then return z._status,unpack(z._values,1,z._valuesLength)elseif z._status==Promise.Status.Rejected then return z._status,unpack(z._values,1,z._valuesLength)end return z._status end Promise.prototype.AwaitStatus=Promise.prototype.awaitStatus local function z(z,...)return z==Promise.Status.Resolved,...end
--[[
	Yield until the promise is completed.

	This matches the execution model of normal Roblox functions.
]]
function Promise.prototype:awaitStatus()
	self._unhandledRejection = false

	if self._status == Promise.Status.Started then
		local bindable = Instance.new("BindableEvent")

		self:finally(function()
			bindable:Fire()
		end)

		bindable.Event:Wait()
		bindable:Destroy()
	end

	if self._status == Promise.Status.Resolved then
		return self._status, unpack(self._values, 1, self._valuesLength)
	elseif self._status == Promise.Status.Rejected then
		return self._status, unpack(self._values, 1, self._valuesLength)
	end

	return self._status
end
Promise.prototype.AwaitStatus = Promise.prototype.awaitStatus

local function awaitHelper(status, ...)
	return status == Promise.Status.Resolved, ...
end
