Re: [deviceorientation] Invalid IDL in DeviceMotionEventInit

> since both "null" and "undefined" get converted to a dictionary the same way anyway.

That's actually not the case in the IDL spec right now.  Trying to align Gecko with that spec was the reason I was looking at this IDL at all in Gecko (where the invalid `?` is not present) and trying to understand what this spec's normative requirements are.

`null` becomes empty dictionary.  `undefined` in this case becomes "member not present" in the outer dictionary.

So passing `null` is valid, and will have the same behavior as passing `{}`.  Passing `undefined` currently has the same behavior in Gecko too, because Gecko doesn't quite follow the Web IDL spec for dictionary-typed members of dictionaries.   But if we fix that, we'll run into the problem of this spec not actually defining behavior when `undefined` is used...  I hadn't gotten to filing that issue yet.

-- 
GitHub Notification of comment by bzbarsky
Please view or discuss this issue at https://github.com/w3c/deviceorientation/issues/54#issuecomment-423716257 using your GitHub account

Received on Saturday, 22 September 2018 04:41:40 UTC