Use TypeError for argument validation: https://www.w3.org/Bugs/Public/sh...

...ow_bug.cgi?id=23346

Addressed https://www.w3.org/Bugs/Public/show_bug.cgi?id=23346