The current WebIDL scripts / bindings dont' support any means to throw a JavaScript TypeError. We'll probably need to (taking a cue from Mozilla) have a special error code.
Whoops, didn't notice we had an existing bug for this. Patch and tests in the other one, so marking this as the dupe. *** This bug has been marked as a duplicate of bug 91679 ***