W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2009

[whatwg] Plus Signs in Signed Integers

From: Jonas Sicking <jonas@sicking.cc>
Date: Tue, 14 Jul 2009 00:14:42 -0700
Message-ID: <63df84f0907140014m1525c70dqdc5fc745bb5a4be3@mail.gmail.com>
On Mon, Jul 13, 2009 at 8:07 PM, Ian Hickson<ian at hixie.ch> wrote:
> On Thu, 18 Jun 2009, Smylers wrote:
>>
>> The algorithm for parsing signed integers does not allow an optional
>> plus sign before positive integers; that is, parsing "+4" will return an
>> error at step 8 of this algorithm:
>>
>> ? http://www.whatwg.org/html5#rules-for-parsing-integers
>>
>> That is inconsistent with the algorithm for non-negative integers, which
>> tolerates (and ignores) a leading plus sign (step 6):
>>
>> ? http://www.whatwg.org/html5#rules-for-parsing-non-negative-integers
>
> I've made + be tolerated by the signed parser also.

Based on what Boris said, why make this distinction?

Generally +1 is not considered a valid integer by most number parsing
libraries. And since gecko is planning on becoming more strict, why
follow (part of) it's lead here?

/ Jonas
Received on Tuesday, 14 July 2009 00:14:42 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:14 UTC