Re: WebIDL - passing undefined as optional nullable param

On 13.01.2015 09:50, Anne van Kesteren wrote:
> On Tue, Jan 13, 2015 at 9:41 AM, Janusz Majnert <j.majnert@samsung.com> wrote:
>> void doSomething(DOMString a, optional ErrorCallback? onError);
>>
>> I'm trying to find out if exceptions should be thrown in the following
>> cases:
>> 1. The optional argument is not given: doSomething("aaa");
>> 2. undefined is passed: doSomething("aaa", undefined);
>
> In neither case.
>
>
>> I tried tracing this through the WebIDL spec and came to the conclusion that
>> case 1 should work ok. For case 2, it should throw a TypeError (WebIDL
>> 4.2.23, point 1), unless there is some way that the nullability takes
>> effect.
>
> You're reading it wrong. You want:
>
>    http://heycam.github.io/webidl/#es-operations
>
> which at some point links
>
>    heycam.github.io/webidl/#es-operations

I think you pasted a wrong link here?

Regards,
-- 
Janusz Majnert
Senior Software Engineer
Samsung R&D Institute Poland
Samsung Electronics

Received on Tuesday, 13 January 2015 09:06:33 UTC