archives

« Bugzilla Issues Index

#58 — S7.8.4_A6.4_T1/T2 & S7.8.4_A7.4_T1/T2 are invalid according to ES5.


The only valid hex/unicode escapes permitted by ES5 are lowercase x/u respectively, as documented by the HexEscapeSequence and UnicodeEscapeSequence rules in 7.8.4. "\X" and "\U" should match the NonEscapeCharacter rule, and thus has the semantics:

* The CV of NonEscapeCharacter :: SourceCharacter but not EscapeCharacter or LineTerminator is the SourceCharacter character itself.
(i.e. '\Xff' === 'Xff')

Treating this as a hex/unicode escape does not match the spec.


You're absolutely correct. "\X01" parses down to:
StringLiteral:: // "\X01"
" DoubleStringCharactersopt " // \X01
DoubleStringCharacter DoubleStringCharactersopt // \X01
\ EscapeSequence // X01
CharacterEscapeSequence // X01
NonEscapeCharacter // X01

=> ", \X, 0, 1, "
=> ", X, 0, 1, "
=> "X01"

I'll disable the tests shortly.


The change has been checked into Hg.


Awesome, thanks Dave!


Fixed at http://hg.ecmascript.org/tests/test262/rev/d32911f87548