Re: Exception usage

On 02/11/2014 07:11 PM, Anne van Kesteren wrote:
> On Tue, Feb 11, 2014 at 4:54 PM, Matt Brubeck <mbrubeck@mozilla.com> wrote:
>> On 2/3/2014 6:05 AM, Anne van Kesteren wrote:
>>> Over in DOM/IDL land we are still unsure around DOMException and
>>> especially new names for it.
>>
>> Could you give us a pointer to the latest documentation or discussion on
>> this?  Is there any consensus emerging around an alternative?
>
> There's http://esdiscuss.org/topic/error-objects-in-w3c-apis and
> there's a couple of bugs filed on IDL to import everything from DOM
> regarding errors.
>
>
>>> Given that the semantics of your exception perfectly match JavaScript's
>>> built-in RangeError exception I strongly recommend using that over minting
>>> something new.
>>
>> We're open to changing this, though we might want to double-check that there
>> isn't too much existing content depending on the shipping implementation in
>> IE11.  (We expect there is not.)
>>
>> However, we're not sure that RangeError is really a perfect match. Active
>> pointerIds do not necessarily form a contiguous range.  For example, 5 and 7
>> might be valid arguments to setPointerCapture, while 6 is invalid.  It seems
>> surprising for setPointerCapture(6) to throw a RangeError in that case.  Is
>> there any other existing DOM or ECMAScript error that is a better fit?
>
> RangeError would still be correct in that case I think. See
> http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.normalize
> for precedent.
>
>


http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.normalize is still quite different.
There you have a predefined set of values, and if something else is passed, it is RangeError.

pointerId can be any random number. RangeError gives a wrong hint that there would be some sort of
continuous range, and that is explicitly what we don't want.

Received on Wednesday, 12 February 2014 01:21:23 UTC