function Component.__validateProps(U,s)if not config.propValidation then return end local p=U[InternalData].componentClass.validateProps if p==nil then return end if typeof(p)~="\102\117\110\099\116\105\111\110"then error(("\118\097\108\105\100\097\116\101\080\114\111\112\115 \109\117\115\116 \098\101 \097 \102\117\110\099\116\105\111\110\044 \098\117\116 \105\116 \105\115 \097 \037\115\046\n\067\104\101\099\107 \116\104\101 \100\101\102\105\110\105\116\105\111\110 \111\102 \116\104\101 \099\111\109\112\111\110\101\110\116 \037\113\046"):format(typeof(p),U.__componentName))end local c,B=p(s)if not c then B=B or"\060\086\097\108\105\100\097\116\111\114 \102\117\110\099\116\105\111\110 \100\105\100 \110\111\116 \115\117\112\112\108\121 \097 \109\101\115\115\097\103\101\062"error(("\080\114\111\112\101\114\116\121 \118\097\108\105\100\097\116\105\111\110 \102\097\105\108\101\100 \105\110 \037\115\058 \037\115\n\n\037\115"):format(U.__componentName,tostring(B),U:getElementTraceback()or"\060\101\110\097\098\108\101 \101\108\101\109\101\110\116 \116\114\097\099\101\098\097\099\107\115\062"),0)end end
--[[
	Performs property validation if the static method validateProps is declared.
	validateProps should follow assert's expected arguments:
	(false, message: string) | true. The function may return a message in the
	true case; it will be ignored. If this fails, the function will throw the
	error.
]]
function Component:__validateProps(props)
	if not config.propValidation then
		return
	end

	local validator = self[InternalData].componentClass.validateProps

	if validator == nil then
		return
	end

	if typeof(validator) ~= "function" then
		error(
			("validateProps must be a function, but it is a %s.\nCheck the definition of the component %q."):format(
				typeof(validator),
				self.__componentName
			)
		)
	end

	local success, failureReason = validator(props)

	if not success then
		failureReason = failureReason or "<Validator function did not supply a message>"
		error(
			("Property validation failed in %s: %s\n\n%s"):format(
				self.__componentName,
				tostring(failureReason),
				self:getElementTraceback() or "<enable element tracebacks>"
			),
			0
		)
	end
end
