Re: [WebIDL] Dictionary with attribute set to 'undefined' counts as set?

On 6/14/14, 1:45 PM, Dirk Schulze wrote:
> If I have a dictionary like this
>
> 	var dic = {x: 1, y: undefined, z: 1, w: 1};
>
> and pass it as argument to DOMPoint:
>
> 	new DOMPoint(dic);
>
> How should the attribute value of DOMPoint.y look like?

 From <http://heycam.github.io/webidl/#es-dictionary> step 5.1.4:

   Otherwise, if value is undefined but the dictionary member has
   a default value, then:

     Let idlValue be the dictionary member’s default value.
     Set the dictionary member on dict with key name key to the value
     idlValue. This dictionary member is considered to be present.

where "value" came from doing a [[Get]] on the object.

So in your case you'd get 0.

-Boris

Received on Sunday, 15 June 2014 02:49:37 UTC