In the first example, viewport appears to be a custom variable inside camera. That’s why it is not documented. You can check the source code of Camera, PerspectiveCamera and StereoCamera. Neither of them defines property viewport.
By example I mean the piece of code posted in your message.
Otherwise, yes, I got confused because there are two distinct viewports in the second example → the value viewport and the method viewport. Initially I thought you are referring to the method.
In any case, if viewport is used outside the class, it is better to be documented, because someone else might need to restore the viewport and will have no clue that it is already stored in the camera.