This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The default behavior of numbers in WebIDL is to wrap around. For instance consider this WebCrypto parameter: unsigned long modulusLength; If you were to specify a negative number for modulusLength then the spec says it should work, but silently convert to a positive number. This seems like a bad pattern. It is likely that providing a negative number in a place which expected an unsigned number was a user error, and hence should trigger a failure. I propose marking all numeric fields as [EnforceRange] so the user agent will throw a TypeError whenever the number is outside of the expected range.
Seems reasonable to me.
Changeset dad087725336
*** Bug 23779 has been marked as a duplicate of this bug. ***