[BUG #7704] extracted side effects from effect-free code

- handleJSDocSee is now effect-free
- createError is effect-free
- addPotentialError encapsulates the side effect of mutating the parent node