parseInt and implicit octal constants

Douglas Crockford douglas at crockford.com
Fri Feb 20 15:56:25 PST 2009


>On Feb 20, 2009, at 3:26 PM, Mark S. Miller wrote:
>
>> 2009/2/20 Allen Wirfs-Brock <Allen.Wirfs-Brock at microsoft.com>:
>>> The cop-out is to just leave it as it is.
>>>
>>> The safe decision is to mandate the current  de facto standard.
>>>
>>> The brave (ie, risky) decision for a better long term language is to
>>> disallow octal.
>>
>> Given that Opera has survived the decision not to use octal, doesn't
>> this establish that this decision is adequately compatible with the
>> web? Opera folk, do you have any data (anecdotal would be fine) of how
>> much breakage you encounter because of this decision?
>>
>> If the Opera experience says the risk is acceptably low, I vote to
>> disallow octal.
>
>I wouldn't assume that an Opera-only behavior is safe for the Web;  
>there are a number of Opera-specific behaviors that for instance  
>Firefox or Safari would not accept as meeting our threshold of Web  
>compatibility. I would be interested in hearing what, if any, bugs  
>they have run into.
>
>I think the wise thing to do here is specify a requirement for octal  
>support. The potential improvement in overall usability of the  
>language seems small and not worth taking a compatibility risk.

I agree. The octal thing is problematic, but I don't think Opera's example is compelling. If we didn't have the radix parameter, which nicely corrects the problem, then I would be willing to accept the breakage that fixing this would cause. But we do, so we should play it safe.

The smart kids are using the radix parameter. The other kids have already written code which may be depending on the bad behavior.


More information about the Es-discuss mailing list