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

Mark S. Miller erights at google.com
Tue Aug 5 08:05:37 PDT 2014


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
mode.



On Tue, Aug 5, 2014 at 7:56 AM, Mathias Bynens <mathias at qiwi.be> wrote:

>
> On 5 Aug 2014, at 16:20, Allen Wirfs-Brock <allen at wirfs-brock.com> wrote:
>
> > We're only talking about Annex B, non-strict.  Right?
>
> All engines are going to implement this anyway, so why make it Annex B
> only? I wouldn’t restrict it to non-strict mode either, as this decision
> seems to be purely based on the Firefox/SpiderMonkey bug that was discussed
> earlier.
>
> > It would be great is somebody wanted to proposal the actual annex B
> language that is need to correctly describe the web reality semantics.
>
> 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
> literal.
>
> > Regarding, leading 0 constants in strict mode. The long term plan is to
> eventually make them legal decimal constants. The only reason not to do
> that now is because it might screw up people who are migrating non-strict
> web reality code containing octal constants into strict mode.
>
> Firefox is the only browser that throws on `(function() { 'use strict';
> return 08; }())` and the only reason it does that is because of a bug (see
> my earlier email). In general, strict mode does not matter here.
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>



-- 
    Cheers,
    --MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140805/2f9cdae5/attachment-0001.html>


More information about the es-discuss mailing list