Changeset 102182 in webkit
- Timestamp:
- Dec 6, 2011, 2:41:56 PM (15 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
runtime/JSGlobalObjectFunctions.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r102179 r102182 1 2011-12-06 Michael Saboff <msaboff@apple.com> 2 3 r102146 from 73875 broke fast/js/encode-URI-test.html 4 https://bugs.webkit.org/show_bug.cgi?id=73950 5 6 Reviewed by Gavin Barraclough. 7 8 * runtime/JSGlobalObjectFunctions.cpp: 9 (JSC::globalFuncUnescape): Restructured to handle 10 the %uHHHH case to output the resulting character 11 and continue so that a failure in finding 4 hex 12 digits will fall through and output the '%'. 13 Due to style check, changed the temporary 14 character variable to a more descriptive name. 15 1 16 2011-12-06 Filip Pizlo <fpizlo@apple.com> 2 17 -
trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
r102146 r102182 647 647 if (str.is8Bit()) { 648 648 const LChar* characters = str.characters8(); 649 649 LChar convertedLChar; 650 650 while (k < len) { 651 651 const LChar* c = characters + k; … … 653 653 if (isASCIIHexDigit(c[2]) && isASCIIHexDigit(c[3]) && isASCIIHexDigit(c[4]) && isASCIIHexDigit(c[5])) { 654 654 builder.append(Lexer<UChar>::convertUnicode(c[2], c[3], c[4], c[5])); 655 k += 5; 655 k += 6; 656 continue; 656 657 } 657 658 } else if (c[0] == '%' && k <= len - 3 && isASCIIHexDigit(c[1]) && isASCIIHexDigit(c[2])) { 658 builder.append(Lexer<LChar>::convertHex(c[1], c[2])); 659 convertedLChar = LChar(Lexer<LChar>::convertHex(c[1], c[2])); 660 c = &convertedLChar; 659 661 k += 2; 660 } else661 builder.append(*c);662 } 663 builder.append(*c); 662 664 k++; 663 665 } … … 667 669 while (k < len) { 668 670 const UChar* c = characters + k; 669 UChar u;671 UChar convertedUChar; 670 672 if (c[0] == '%' && k <= len - 6 && c[1] == 'u') { 671 673 if (isASCIIHexDigit(c[2]) && isASCIIHexDigit(c[3]) && isASCIIHexDigit(c[4]) && isASCIIHexDigit(c[5])) { 672 u= Lexer<UChar>::convertUnicode(c[2], c[3], c[4], c[5]);673 c = & u;674 convertedUChar = Lexer<UChar>::convertUnicode(c[2], c[3], c[4], c[5]); 675 c = &convertedUChar; 674 676 k += 5; 675 677 } 676 678 } else if (c[0] == '%' && k <= len - 3 && isASCIIHexDigit(c[1]) && isASCIIHexDigit(c[2])) { 677 u= UChar(Lexer<UChar>::convertHex(c[1], c[2]));678 c = & u;679 convertedUChar = UChar(Lexer<UChar>::convertHex(c[1], c[2])); 680 c = &convertedUChar; 679 681 k += 2; 680 682 }
Note:
See TracChangeset
for help on using the changeset viewer.