checking text object with isValid breaks reference
I have already described this issue on creative cloud forum for devs: https://forums.creativeclouddeveloper.com/t/accessing-isvalid-property-updates-object-reference/11477
but since there was no response, i still don't know if this a bug.
Basically, reference to text object updates after checking it with isValid.
Steps to reproduce:
1) get selected text in textframe with app.selection[0] and put it in the variable (selection)
2) add some text just before selected text
3) try to select selection with app.select(selection) -> text selected correctly.
4) check selection with isValid (selection.isValid)
5) try to select selection once again with app.select(selection) -> text selected incorrectly.
Indesign version: 19.2
Expected behavior: preserve link to initially selected text