Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTCDataChannel.send(null) #1835

Closed
lgrahl opened this issue Apr 11, 2018 · 6 comments
Closed

RTCDataChannel.send(null) #1835

lgrahl opened this issue Apr 11, 2018 · 6 comments
Assignees

Comments

@lgrahl
Copy link
Contributor

lgrahl commented Apr 11, 2018

I'm unsure what's supposed to happen when calling dataChannel.send(null). Step 3 of the send method states:

Execute the sub step that corresponds to the type of the methods argument:
...

But what if none of the types match? Raise TypeError?

@alvestrand
Copy link
Contributor

TypeError seems right to me for arguments that have no substep defined.
For the particular case of null, returning without action might be equally appropriate.

@lgrahl
Copy link
Contributor Author

lgrahl commented Apr 12, 2018

Then, I would come back and ask the same question for undefined. :)
But TypeError sounds good to me. Should we explicitly mention that in the spec as a catch all step?

@adam-be
Copy link
Member

adam-be commented Apr 19, 2018

I think this is already covered by WebIDL since none of the send method overloads have a nullable argument. The result will be TypeError.

@lgrahl
Copy link
Contributor Author

lgrahl commented Apr 19, 2018

Yes but since all implementations currently get it wrong, I think it's worth spending an extra step to provide clarity.

@adam-be
Copy link
Member

adam-be commented Apr 19, 2018

Would a note be sufficient?

@aboba
Copy link
Contributor

aboba commented Apr 19, 2018

@lgrahl Can you submit a PR?

@aboba aboba added the Needs PR Discussion has converged - Pull Request needed label Apr 19, 2018
@aboba aboba added PR exists and removed Needs PR Discussion has converged - Pull Request needed labels Apr 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants