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