This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
https://encoding.spec.whatwg.org/#interface-textencoder [[ throws a TypeError. ]] In general RangeErrors are better used when only an enumeration should be allowed and you want to throw when outside that range. See e.g. http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.normalize
String.prototype.normalize was defined after IDL enumerations which use TypeError...
Hmm yeah this conversation is starting to feel familiar... I will try to PR WebIDL to use RangeError and see where that discussion goes.
http://lists.w3.org/Archives/Public/www-international/2014OctDec/0091.html
https://github.com/whatwg/encoding/commit/811cf733af9aba3bcccc3d82d68298d375caac48