WPT webrtc/RTCIceCandidate-constructor.html is wrong about why {candidate: null} throws TypeError
Categories
(Core :: WebRTC: Signaling, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox126 | --- | fixed |
People
(Reporter: bwc, Assigned: jib)
Details
Attachments
(1 file)
See this fiddle: https://jsfiddle.net/as6hex5y/1/
I think the relevant part of the spec is here: https://heycam.github.io/webidl/#es-dictionary
Note that using undefined instead of null elicits the expected TypeError
| Reporter | ||
Comment 1•7 years ago
•
|
||
Maybe this is just a wrinkle caused by the fact that null can be converted to a DOMString?
| Assignee | ||
Comment 2•7 years ago
|
||
I think the relevant part of the spec is here: https://heycam.github.io/webidl/#es-dictionary
I don't see it saying this should throw. This constructor takes an optional RTCIceCandidateInit dictionary, whose optional candidate member has a default value of "".
- If Type(esDict) is NOT Undefined, Null or Object, then throw a TypeError.
Type of {candidate: null} (that is: the outer {}) is object, so proceed:
- ...(skipping additional irrelevant checks on esDict)...
- If esMemberValue is not undefined, then:
- Let idlMemberValue be the result of converting esMemberValue to an IDL value whose type is the type member is declared to be of.
Where converting for DOMString takes us to toString which says: Return "null".
So it appears to me https://github.com/web-platform-tests/wpt/blob/master/webrtc/RTCIceCandidate-constructor.html#L59 is wrong.
Updated•7 years ago
|
| Reporter | ||
Comment 3•7 years ago
|
||
It looks like this is the source of our problem:
Which is necessitated by this:
https://searchfox.org/mozilla-central/source/dom/webidl/PeerConnectionImpl.webidl#95
| Reporter | ||
Updated•7 years ago
|
Updated•3 years ago
|
| Assignee | ||
Comment 4•2 years ago
|
||
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
Comment 7•2 years ago
|
||
| bugherder | ||
Description
•