```javascript
this._caretPos = caretPos == null ? input.length : caretPos;
```