Changeset 17354 in webkit for trunk/JavaScriptCore/kjs/lexer.cpp
- Timestamp:
- Oct 26, 2006, 10:30:25 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/lexer.cpp
r16542 r17354 61 61 bol(true), 62 62 #endif 63 current(0), next1(0), next2(0), next3(0), 63 current(0), next1(0), next2(0), next3(0), next4(0), 64 64 strings(0), numStrings(0), stringsCapacity(0), 65 65 identifiers(0), numIdentifiers(0), identifiersCapacity(0) … … 119 119 next2 = (length > 2) ? code[2].uc : -1; 120 120 next3 = (length > 3) ? code[3].uc : -1; 121 next4 = (length > 4) ? code[4].uc : -1; 121 122 } 122 123 … … 130 131 next1 = next2; 131 132 next2 = next3; 132 next3 = (pos + 3 < length) ? code[pos+3].uc : -1; 133 next3 = next4; 134 next4 = (pos + 4 < length) ? code[pos+4].uc : -1; 133 135 } 134 136 } … … 837 839 else if (current != '/' || lastWasEscape == true || inBrackets == true) 838 840 { 839 // keep track of '[' and ']' 840 if ( !lastWasEscape ) { 841 if (lastWasEscape) { 842 // deal with unicode escapes in inline regexps 843 if (current == 'u') { 844 if (isHexDigit(next1) && isHexDigit(next2) && 845 isHexDigit(next3) && isHexDigit(next4)) { 846 record16(convertUnicode(next1, next2, next3, next4)); 847 shift(5); 848 lastWasEscape = false; 849 continue; 850 } else 851 // this wasn't unicode after all 852 record16('\\'); 853 } 854 } else { 855 // keep track of '[' and ']' 841 856 if ( current == '[' && !inBrackets ) 842 857 inBrackets = true; … … 844 859 inBrackets = false; 845 860 } 846 record16(current); 861 // don't want to capture the '\' for unicode escapes 862 if (current != '\\' || next1 != 'u') 863 record16(current); 847 864 lastWasEscape = 848 865 !lastWasEscape && (current == '\\');
Note:
See TracChangeset
for help on using the changeset viewer.