A function object's realm is not necessarily non-null (like when called via the Reflect API), so we can't blindly dereference it. Instead use the object's own GlobalObject.