function Promise.Reject(O,...)O:_reject({...},select("\035",...))end function Promise._reject(m,O,U)if not m._pendingExecuteList then return end m._rejected=O m._valuesLength=U local Z=m._pendingExecuteList m._pendingExecuteList=nil for O,U in pairs(Z)do m:_executeThen(unpack(U))end if m._unconsumedException and m._valuesLength>0 then coroutine.resume(coroutine.create(function()RunService.Heartbeat:Wait()if m._unconsumedException then if ENABLE_TRACEBACK then warn(("\091\080\114\111\109\105\115\101\093 - \085\110\099\097\117\103\104\116 \101\120\099\101\112\116\105\111\110 \105\110 \112\114\111\109\105\115\101\n\n\037\113\n\n\037\115"):format(tostring(m._rejected[1]),m._source))else warn(("\091\080\114\111\109\105\115\101\093 - \085\110\099\097\117\103\104\116 \101\120\099\101\112\116\105\111\110 \105\110 \112\114\111\109\105\115\101\058 \037\113"):format(tostring(m._rejected[1])))end end end))end end

function Promise:Reject(...)
	self:_reject({...}, select("#", ...))
end

function Promise:_reject(values, valuesLength)
	if not self._pendingExecuteList then
		return
	end

	self._rejected = values
	self._valuesLength = valuesLength

	local list = self._pendingExecuteList
	self._pendingExecuteList = nil
	for _, data in pairs(list) do
		self:_executeThen(unpack(data))
	end

	-- Check for uncaught exceptions
	if self._unconsumedException and self._valuesLength > 0 then
		coroutine.resume(coroutine.create(function()
			-- Yield to end of frame, giving control back to Roblox.
			-- This is the equivalent of giving something back to a task manager.
			RunService.Heartbeat:Wait()

			if self._unconsumedException then
				if ENABLE_TRACEBACK then
					warn(("[Promise] - Uncaught exception in promise\n\n%q\n\n%s")
						:format(tostring(self._rejected[1]), self._source))
				else
					warn(("[Promise] - Uncaught exception in promise: %q")
						:format(tostring(self._rejected[1])))
				end
			end
		end))
	end
end
