The same optimization as in Object::hasProperty()