- From: Jan-Ivar Bruaroey via GitHub <sysbot+gh@w3.org>
- Date: Thu, 02 Mar 2023 21:15:16 +0000
- To: public-webrtc-logs@w3.org
> "4.2 Guidelines for implementing stats objects" already says to use undefined if "a feature is not applicable"
It doesn't say that. It says: _"When a feature is not applicable to an instance of an object (for example [audioLevel](https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-audiolevel) on a video stream), **omit** the dictionary member. Do NOT report a count of zero, -1 or "empty string"."_
It says to _"omit"_ the member, which is different from a value of `undefined`. [audioLevel](https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-audiolevel): _"Only [exists](https://infra.spec.whatwg.org/#map-exists) for audio."_
E.g. here `audioLevel` [exists](https://infra.spec.whatwg.org/#map-exists):
```js
{audioLevel: undefined}
```
...and here it is omitted:
```js
{}
```
AFAIK WebIDL bindings coerce the former into the latter on _input_ (e.g. dictionaries as arguments to a method), but not output.
--
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/webrtc-stats/issues/736#issuecomment-1452556494 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 2 March 2023 21:15:18 UTC