Replace DOMException TYPE_MISMATCH_ERR with TypeError