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

send(sequence<short> data) should just be send(any data) #15

Open
jussi-kalliokoski opened this issue Dec 25, 2012 · 0 comments
Open

send(sequence<short> data) should just be send(any data) #15

jussi-kalliokoski opened this issue Dec 25, 2012 · 0 comments

Comments

@jussi-kalliokoski
Copy link
Owner

@jussi-kalliokoski jussi-kalliokoski commented Dec 25, 2012

Originally reported on W3C Bugzilla ISSUE-20510 Mon, 24 Dec 2012 08:23:52 GMT
Reported by Marcos Caceres
Assigned to This bug has no owner yet - up for the taking

If the first argument of send() is going to be coerced in to a Uint8Array, then send should just take any as a type. That avoids a whole bunch of unnecessary checks that will be performed when whatever value if thrown into new Uint8Array().

For example:

send({}) === []
send(function(){}) === []
send(Node) === []

send("") === [0]
send([" "]) === []

send([undefined,null,Node,Array, [1,23,432]]) === [0, 0, 0, 0, 0]

This one is important:
send(["100", "200", "300"]) === [100, 200, 44]

And so on…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.