From 57b29cd9c023835340338ddf4ed0e3135c76820e Mon Sep 17 00:00:00 2001 From: "jwalden@mit.edu" Date: Fri, 7 Mar 2008 15:28:55 -0800 Subject: [PATCH] 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 --- js/src/jsscan.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/js/src/jsscan.c b/js/src/jsscan.c index b1b693bbcf46..93eb56b13aa6 100644 --- a/js/src/jsscan.c +++ b/js/src/jsscan.c @@ -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))