StoreFrame has been forbidden since it was first introduced in 5.2 or so. You can use frame:IsForbidden() to check, or just pcall your function to hide the error, eg.
local ok, objectType = pcall(frame.IsObjectType, frame)
if ok then
-- proceed
else
-- probably forbidden, just ignore it
end
I understand why they are especially protected.
However, when iterating over global variables inevitabley these come up (imho they should not be global if they are forbidden) leading to errors.
Is there a way to detect whether a frame is forbidden without triggering an error?
Edit: The following works/works not