According to the ECMA spec an octal escape sequence is defined as
OctalEscapeSequence ::
OctalDigit [lookahead ∉ DecimalDigit]
ZeroToThree OctalDigit [lookahead ∉ DecimalDigit]
FourToSeven OctalDigit
ZeroToThree OctalDigit OctalDigit
ZeroToThree :: one of
0 1 2 3
FourToSeven :: one of
4 5 6 7
According to this spec a string "\379" is not an octal escape \37 followed by 9. Am I reading this right? It doesn't satisfy the first rule, since 7 is a decimal digit. It doesn't satisfy the second, since 9 is a decimal digit. It doesn't satisfy the third, since three is not one of 4 5 6 7. Finally, it doesn't satisfy the fourth, since 9 is not an octal digit.
So what is the value of "\379" then? I tried a couple of JavaScript translators, they interpret it as an octal escape \37 followed by 9. Is it a bug in the interpreters?
UPDATE
I know that octal escape sequences are optional in the latest ECMA spec.
s/DecimalDigit/OctalDigit/g. :P