W3C home > Mailing lists > Public > public-audio@w3.org > October to December 2012

[Bug 20510] send(sequence<short> data) should just be send(any data)

From: <bugzilla@jessica.w3.org>
Date: Tue, 25 Dec 2012 23:18:35 +0000
To: public-audio@w3.org
Message-ID: <bug-20510-5429-kytvUbyms8@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=20510

Jussi Kalliokoski <jussi.kalliokoski@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jussi.kalliokoski@gmail.com

--- Comment #1 from Jussi Kalliokoski <jussi.kalliokoski@gmail.com> ---
(In reply to comment #0)
> 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…

Sounds good to me, but I have to point out that this will make it impossible to
overload send():

send(3) = [0,0,0]

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Tuesday, 25 December 2012 23:18:36 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:50:04 UTC