- From: Dirk Schulze <dschulze@adobe.com>
- Date: Sat, 14 Jun 2014 17:45:07 +0000
- To: "public-script-coord@w3.org" <public-script-coord@w3.org>
Hi,
I have a question to dictionaries:
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?
Should it be:
a) 0 because dic.y doesn�t count as initialized and it take the default initial value of DOMPoint.y?
b) NaN because dic.y counts as initialized and undefined is transformed to NaN since the attribute value of y is of type Number?
The relevant spec is Geometry Interfaces. The relevant IDL looks like this:
dictionary DOMPointInit {
unrestricted double x = 0;
unrestricted double y = 0;
unrestricted double z = 0;
unrestricted double w = 1;
};
[Constructor(optional DOMPointInit point)]
interface DOMPoint : DOMPointReadOnly {
inherit attribute unrestricted double x;
inherit attribute unrestricted double y;
inherit attribute unrestricted double z;
inherit attribute unrestricted double w;
}
Greetings,
Dirk
Received on Saturday, 14 June 2014 17:45:40 UTC