`ExponentPart` after `HexIntegerLiteral`
Yusuke Suzuki
utatane.tea at gmail.com
Sat Feb 25 05:46:17 PST 2012
Hello,
0xFFe2 is valid HexIntegerLiteral, because 'e' and '2' is one of the hex
digit.
So I think it is OK.
0xFFe2 // 65506
0xFFe3 // 65507
Thanks.
On Sat, Feb 25, 2012 at 10:40 PM, Mathias Bynens <mathias at qiwi.be> wrote:
> The spec grammar for `HexIntegerLiteral` is as follows:
> http://es5.github.com/x7.html#x7.8.3
>
> HexIntegerLiteral ::
> 0x HexDigit
> 0X HexDigit
> HexIntegerLiteral HexDigit
>
> HexDigit :: one of
> 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F
>
> Note that no `ExponentPart` seems to be allowed here.
>
> However, a lot of engines seem to support exponents after hex integer
> literals:
>
> 255; // 255
> 0xFF; // 255
> 255e2; // 25500
> 0xFFe2; // 65506
>
> I couldn’t find this in the spec though. Is this defined anywhere? Is
> this expected behavior or not?
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120225/87095304/attachment-0001.html>
More information about the es-discuss
mailing list