Re: [web-nfc] non-Mime record should have a null mediaType (#441)

What I question is why do we use nullable properties in WebIDL for `mediaType`, `encoding` and `lang`. Since they are used only with certain `recordType` values, they should be `undefined` in invalid cases, not just `null`.

If the WebIDL was with non-nullable properties for `mediaType`, `encoding` and `lang`, then in the spec `undefined` should be used in algorithms instead of `null`, and in C++ the getter should throw.

I wondered was `null` preferred because the way the bindings work, or implementation.
Based on what you say looks like because of the bindings.

Anyway, if `null` works for everyone, let's move on with that. And yes, I agree with Leon that algorithms don't need to have explicit statements for `null` initialization of nullable properties. But it adds to the clarity in this case, so we can keep them from my part.

-- 
GitHub Notification of comment by zolkis
Please view or discuss this issue at https://github.com/w3c/web-nfc/pull/441#issuecomment-552790670 using your GitHub account

Received on Tuesday, 12 November 2019 08:38:00 UTC