`ExponentPart` after `HexIntegerLiteral`

Mathias Bynens mathias at qiwi.be
Sat Feb 25 05:40:42 PST 2012


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?


More information about the es-discuss mailing list