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

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

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

            Bug ID: 28875
           Summary: [EnforceRange] accepts an odd set of input values
           Product: WebAppsWG
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: WebIDL
          Assignee: cam@mcc.id.au
          Reporter: jyasskin@gmail.com
        QA Contact: public-webapps-bugzilla@w3.org
                CC: mike@w3.org, public-script-coord@w3.org

[EnforceRange] delegates to the ECMAScript ToNumber() operation before checking
its range, but this makes it accept a strange set of values.

unsigned long enforceRange([EnforceRange] unsigned long arg) { return arg; }

enforceRange({}) throws a TypeError, but enforceRange([]) and enforceRange("")
return 0.
enforceRange(undefined) throws a TypeError, but enforceRange(null) returns 0.

What's the "right" behavior?

Looking at uses: I see 3 existing uses in Blink, all in IndexedDB:
Web Bluetooth is also considering using [EnforceRange] for

You are receiving this mail because:
You are on the CC list for the bug.
Received on Wednesday, 1 July 2015 20:32:42 UTC

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