According to the ECMA-262 specification (6th edition) in strict mode in single or double quoted strings after \'\\\' it is possible to have EscapeSequence or LineTerminatorSeque
"0 [lookahead ∉ DecimalDigit]" sounds pretty unambiguous to me: no decimal digit is allowed after \0
.
Which means the fact that V8 allows "\08"
and "\09"
in strict mode is a bug. Would you please file a bug at https://bugs.chromium.org/p/v8/?
Interestingly, test262 does not seem to cover this case at all...
Somewhat related: all browsers accept "\8"
and "\9"
in strict mode, which according to the spec should throw a SyntaxError. There's a thread on esdiscuss.org indicating that this spec violation is (or at least used to be) required for web compatibility though: when existing websites depend on non-spec-compliant behavior, then browsers usually can't just update their behavior to be spec-compliant, because doing so would break such websites, and having websites work correctly is more important for users (and, hence, browser developers) than being spec-compliant.