function Promise.prototype.awaitStatus(g)g._unhandledRejection=false if g._status==Promise.Status.Started then local E=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")g:finally(function()E:Fire()end)E.Event:Wait()E:Destroy()end if g._status==Promise.Status.Resolved then return g._status,unpack(g._values,1,g._valuesLength)elseif g._status==Promise.Status.Rejected then return g._status,unpack(g._values,1,g._valuesLength)end return g._status end local function g(g,...)return g==Promise.Status.Resolved,...end

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

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