-- ROBLOX deviation: Function annotation for func omitted

local function fnNameFor(func)
	-- Upstream code omitted for now but translated below:
	--[[
		if func.name then
			return func.name
		end
	]]

	-- ROBLOX TODO: (ADO-1258) Return more advanced function information, if
	-- possible, by using traceback
	return "[Function]"
end

local function isUndefined(obj: any)
	return obj == nil
end

local function getPrototype(obj)
	if getmetatable(obj) ~= nil then
		return getmetatable(obj).__index
	end

	return nil
end

local function hasProperty(obj: any, property: string): boolean
	if not obj then
		return false
	end

	local ok, result = pcall(function()
		return obj[property]
	end)

	if ok then
		return result ~= nil
	else
		error(result)
	end
end

return {
	equals = equals,
	isA = isA,
	fnNameFor = fnNameFor,
	isUndefined = isUndefined,
	getPrototype = getPrototype,
	hasProperty = hasProperty,
}
