throw exception if `name` argument to document.register contains no dash (+test)