the `next` param of `_closeDocument` is now optional.