Document.selection treated undefined like null and cleared the selection. It now throws a TypeError for undefined, as for any value that is not a page item, a list of them, null or [], and leaves the selection as it was.