Re: Encoding API exceptions

On 11/9/14, 4:45 AM, Anne van Kesteren wrote:
> Both Chromium and Gecko implement the API. There's interest in this
> API from the wider JavaScript community.

I expect that a bigger issue than the exact type of exception that's 
thrown will be things like whether the attributes are accessors or value 
props, whether they're actually readonly, what arguments are allowed 
(e.g. the USVString bit for TextEncoder),

> Unfortunately for them we use a DOMException which so far is the only dependency on "DOM things".

Well, apart from the Web IDL dependency, no?

> I was wondering if there would be interest in changing both Chromium
> and Gecko to throw TypeError where we now throw EncodingError, and
> throw RangeError where we now throw TypeError.

I think this would be fine in compat terms; I doubt anyone is depending 
on the current exception types here.

-Boris

Received on Friday, 14 November 2014 03:40:20 UTC