W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2015

[Bug 28875] [EnforceRange] accepts an odd set of input values

From: <bugzilla@jessica.w3.org>
Date: Wed, 01 Jul 2015 21:08:59 +0000
To: public-script-coord@w3.org
Message-ID: <bug-28875-3890-7PVRdg0qbJ@http.www.w3.org/Bugs/Public/>

Jeffrey Yasskin <jyasskin@gmail.com> changed:

           What    |Removed                     |Added
                 CC|                            |sleevi@google.com

--- Comment #2 from Jeffrey Yasskin <jyasskin@gmail.com> ---
Thanks for finding the extra uses.

We're excluding some non-integral arguments, but not a consistent set. (That's
similar to a lot of Javascript, so maybe it's ok; I'm just checking that it's

If we want to exclude "strange" input values without breaking "123", I think
the appropriate algorithm is something like:

1. Initialize p to ToPrimitive(V, hint Number).
2. If p is "" or null, throw a TypeError.  // Excludes empty arrays.
3. Initialize x to ToNumber(p).
4. If x is NaN, +∞, or −∞, then throw a TypeError.
5. Set x to sign(x) * floor(abs(x)).
6. If x < 0 or x > 2^32 − 1, then throw a TypeError.
7. Return the IDL unsigned long value that represents the same numeric value as

You are receiving this mail because:
You are on the CC list for the bug.
Received on Wednesday, 1 July 2015 21:09:07 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:24 UTC