The constructor attribute defines a named constructor for JS, and a corresponding static Constructor method in the implementation; in this case, you are able to use code like |new DeviceLightEvent("whatever", {value: 5})|. A dictionary is an object with a given list of properties; in JS, that's a regular object, in C++, it's a struct containing those members.

Cheers,
Josh

On 10/23/2013 04:10 AM, [email protected] wrote:
Hi,

in DeviceLightEvent.webidl,

The first line of the code
[Constructor(DOMString type, optional DeviceLightEventInit eventInitDict)]

Can anyone explain this please?

Second, what does dictionary type mean?

dictionary DeviceLightEventInit : EventInit
{
   unrestricted double value = Infinity;
};

I went through the WebIDL bindings page but still dont get the point.

Thanks in advance.


_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to