You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree with @jmdyck. Having CharacterEscape parsed with ~U here would mean /\z/u would be legal (NB z is not a valid escape), as derived from CharacterEscape[U] :: IdentityEscape[?U] -> IdentityEscape[U] :: [~U] SourceCharacterIdentityEscape. That definitely is not the intent, and indeed all major engines reject /\z/u.
Specifically, change:
AtomEscape[U, N] :: CharacterEscape[~U, ?N]
to:
AtomEscape[U, N] :: CharacterEscape[?U, ?N]
This fixes a bug that PR tc39#403 introduced way back in 2016.
Resolves issue tc39#1672 (which see for some discussion).
The main-body definition of AtomEscape says (in part):
but the Annex-B definition of AtomEscape says:
So if
AtomEscape
is 'invoked' with+U
, main-body usesCharacterEscape[+U]
whereas Annex-B usesCharacterEscape[~U]
.This is presumably a bug, since Annex B claims that it doesn't change any [+U] syntax.
It looks like the bug was introduced in 251dcef (for PR #403), where (using the old notation for grammatical parameters)
was changed to:
but should have been changed to:
(Compare to the same commit's parallel change to the
ClassEscape
production, whereCharacterEscape
does get the[?U]
.)@anba, please confirm.
The text was updated successfully, but these errors were encountered: