Well, the reason for the change is this:

line #266 calls(ed): getDocument() - which always returns a document instance. Therefore, how can the "instanceof" ever be false ?