exports.rethrowCaughtError=function()if hasRethrowError then local y=rethrowError hasRethrowError=false rethrowError=nil error(y)end end exports.hasCaughtError=function()return hasError end clearCaughtError=function()if hasError then local y=caughtError hasError=false caughtError=nil return y else invariant(false,"\099\108\101\097\114\067\097\117\103\104\116\069\114\114\111\114 \119\097\115 \099\097\108\108\101\100 \098\117\116 \110\111 \101\114\114\111\114 \119\097\115 \099\097\112\116\117\114\101\100\046 \084\104\105\115 \101\114\114\111\114 \105\115 \108\105\107\101\108\121 \099\097\117\115\101\100 \098\121 \097 \098\117\103 \105\110 \082\101\097\099\116\046 \080\108\101\097\115\101 \102\105\108\101 \097\110 \105\115\115\117\101\046")return nil end end exports.clearCaughtError=clearCaughtError return exports

exports.rethrowCaughtError = function()
	if hasRethrowError then
		local err = rethrowError
		hasRethrowError = false
		rethrowError = nil
		error(err)
	end
end

exports.hasCaughtError = function()
	return hasError
end

clearCaughtError = function()
	if hasError then
		local err = caughtError
		hasError = false
		caughtError = nil
		return err
	else
		invariant(
			false,
			"clearCaughtError was called but no error was captured. This error "
				.. "is likely caused by a bug in React. Please file an issue."
		)
		-- deviation: luau doesn't know that invariant throws, so we return nil
		return nil
	end
end
exports.clearCaughtError = clearCaughtError

return exports
