Re: Encoding API exceptions

On Fri, Nov 14, 2014 at 4:39 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> 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),

Should we change IDL to allow data properties?

I'm not sure what you mean by "actually readonly".

USVString seems compatible enough, it's a conversion similar to ToString.


>> 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?

Yeah, though we have been closing the gap there. We should probably
file bugs on what is left.


>> 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.

Okay, I will make this change then. Baby steps towards convergence FTW.


-- 
https://annevankesteren.nl/

Received on Friday, 14 November 2014 13:14:18 UTC