Re: WebIDL question (was: DOMPoint dictionary problem)

On 9/24/13 2:46 PM, Rik Cabanier wrote:
>     Making DOMPoint a dictionary, as currently proposed, is a problem
>     since it means other objects (such as the proposed DOMQuad) can't
>     have DOMPoints as attributes. I'm assuming the WebIDL restriction
>     that attributes can't be dictionaries is not easily removed.
>
>
> Why can't interfaces have dictionary attributes in IDL?

Because dictionaries are passed by value.

So if your interface had a dictionary attribute, obj.attr would be a new 
object every time.  In addition to being terrible for performance, it 
would make obj.attr == obj.attr test false, which is clearly not desirable.

-Boris

Received on Tuesday, 24 September 2013 19:06:50 UTC