Bug 352044 - Issues with Unicode escape sequences in JavaScript source code; Unicode escapes not part of identifiers were being treated as their equivalent CVs, and non-identifier Unicode escapes within identifiers were being treated as their CVs (simultaneously starting a new token). acid3++ r=mrbkap, a=damons

This commit is contained in:
jwalden@mit.edu 2008-03-07 15:28:55 -08:00
Родитель 464088c511
Коммит 57b29cd9c0
1 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -1211,16 +1211,19 @@ retry:
hadUnicodeEscape = JS_FALSE;
if (JS_ISIDSTART(c) ||
(c == '\\' &&
(c = GetUnicodeEscape(ts),
hadUnicodeEscape = JS_ISIDSTART(c)))) {
(qc = GetUnicodeEscape(ts),
hadUnicodeEscape = JS_ISIDSTART(qc)))) {
if (hadUnicodeEscape)
c = qc;
INIT_TOKENBUF();
for (;;) {
ADD_TO_TOKENBUF(c);
c = GetChar(ts);
if (c == '\\') {
c = GetUnicodeEscape(ts);
if (!JS_ISIDENT(c))
qc = GetUnicodeEscape(ts);
if (!JS_ISIDENT(qc))
break;
c = qc;
hadUnicodeEscape = JS_TRUE;
} else {
if (!JS_ISIDENT(c))