Early error on '0' followed by '8' or '9' in numeric literals does not seem to be web-compatible

Bill Frantz frantz at pwpconsult.com
Wed Aug 6 17:46:35 PDT 2014

On 8/5/14 at 8:05 AM, erights at google.com (Mark S. Miller) wrote:

>Because of compatibility constraints, JS history can generally proceed only
>in an additive manner, which means a steady degradation of quality along
>the "simplicity" dimension. An opt-in mode switch is the only way to escape
>that dynamic. Strict mode is the only one we've got, and the only one we're
>likely to have in the foreseeable future. Strict mode should not accept
>octal literals. Regarding sloppy mode, it continues to exist only for the
>sake of legacy compat, so adding more crap to it for better web compat is
>the right tradeoff -- as long as the crap stays quarantined within sloppy
>On Tue, Aug 5, 2014 at 7:56 AM, Mathias Bynens <mathias at qiwi.be> wrote:
>>In section 11.8.3 (Numeric Literals), the definition for
>>`DecimalIntegerLiteral` should somehow be tweaked to match that of
>>`DecimalDigits`, with the exception that if the first digit is `0` and all
>>other digits are octal digits (0-7) it must be treated as a legacy octal

So this horrible footgun, changing the value of a constant 
changes its radix, is only lurking in sloppy mode.

Cheers - Bill

Bill Frantz        | Concurrency is hard. 12 out  | Periwinkle
(408)356-8506      | 10 programmers get it wrong. | 16345 
Englewood Ave
www.pwpconsult.com |                - Jeff Frantz | Los Gatos, 
CA 95032

More information about the es-discuss mailing list