Changeset 30942 in webkit for trunk/JavaScriptCore/kjs/function.cpp
- Timestamp:
- Mar 10, 2008, 3:06:44 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/function.cpp
r30871 r30942 516 516 if (c == '%') { 517 517 int charLen = 0; 518 if (k <= len - 3 && isASCIIHexDigit(p[1] .uc) && isASCIIHexDigit(p[2].uc)) {519 const char b0 = Lexer::convertHex(p[1] .uc, p[2].uc);518 if (k <= len - 3 && isASCIIHexDigit(p[1]) && isASCIIHexDigit(p[2])) { 519 const char b0 = Lexer::convertHex(p[1], p[2]); 520 520 const int sequenceLen = UTF8SequenceLength(b0); 521 521 if (sequenceLen != 0 && k <= len - sequenceLen * 3) { … … 525 525 for (int i = 1; i < sequenceLen; ++i) { 526 526 const UChar* q = p + i * 3; 527 if (q[0] == '%' && isASCIIHexDigit(q[1] .uc) && isASCIIHexDigit(q[2].uc))528 sequence[i] = Lexer::convertHex(q[1] .uc, q[2].uc);527 if (q[0] == '%' && isASCIIHexDigit(q[1]) && isASCIIHexDigit(q[2])) 528 sequence[i] = Lexer::convertHex(q[1], q[2]); 529 529 else { 530 530 charLen = 0; … … 553 553 // For that, it's good to support the wonky "%u" syntax for compatibility with WinIE. 554 554 if (k <= len - 6 && p[1] == 'u' 555 && isASCIIHexDigit(p[2] .uc) && isASCIIHexDigit(p[3].uc)556 && isASCIIHexDigit(p[4] .uc) && isASCIIHexDigit(p[5].uc)) {555 && isASCIIHexDigit(p[2]) && isASCIIHexDigit(p[3]) 556 && isASCIIHexDigit(p[4]) && isASCIIHexDigit(p[5])) { 557 557 charLen = 6; 558 u = Lexer::convertUnicode(p[2] .uc, p[3].uc, p[4].uc, p[5].uc);558 u = Lexer::convertUnicode(p[2], p[3], p[4], p[5]); 559 559 } 560 560 } 561 if (charLen && (u .uc == 0 || u.uc >= 128 || !strchr(do_not_unescape, u.low()))) {561 if (charLen && (u == 0 || u >= 128 || !strchr(do_not_unescape, u))) { 562 562 c = u; 563 563 k += charLen - 1; … … 632 632 int p = 0; 633 633 634 while (p < length && isStrWhiteSpace(s[p] .uc)) {634 while (p < length && isStrWhiteSpace(s[p])) { 635 635 ++p; 636 636 } … … 663 663 double number = 0; 664 664 while (p < length) { 665 int digit = parseDigit(s[p] .uc, radix);665 int digit = parseDigit(s[p], radix); 666 666 if (digit == -1) 667 667 break; … … 691 691 int length = s.size(); 692 692 int p = 0; 693 while (p < length && isStrWhiteSpace(s[p] .uc)) {693 while (p < length && isStrWhiteSpace(s[p])) { 694 694 ++p; 695 695 } … … 817 817 const UChar* c = str.data(); 818 818 for (int k = 0; k < str.size(); k++, c++) { 819 int u = c ->uc;819 int u = c[0]; 820 820 if (u > 255) { 821 821 char tmp[7]; … … 842 842 const UChar* c = str.data() + k; 843 843 UChar u; 844 if ( *c == UChar('%') && k <= len - 6 && *(c + 1) == UChar('u')) {845 if (Lexer::isHexDigit( (c + 2)->uc) && Lexer::isHexDigit((c + 3)->uc) && Lexer::isHexDigit((c + 4)->uc) && Lexer::isHexDigit((c + 5)->uc)) {846 u = Lexer::convertUnicode( (c + 2)->uc, (c + 3)->uc, (c + 4)->uc, (c + 5)->uc);844 if (c[0] == '%' && k <= len - 6 && c[1] == 'u') { 845 if (Lexer::isHexDigit(c[2]) && Lexer::isHexDigit(c[3]) && Lexer::isHexDigit(c[4]) && Lexer::isHexDigit(c[5])) { 846 u = Lexer::convertUnicode(c[2], c[3], c[4], c[5]); 847 847 c = &u; 848 848 k += 5; 849 849 } 850 } else if ( *c == UChar('%') && k <= len - 3 && Lexer::isHexDigit((c + 1)->uc) && Lexer::isHexDigit((c + 2)->uc)) {851 u = UChar(Lexer::convertHex( (c+1)->uc, (c+2)->uc));850 } else if (c[0] == '%' && k <= len - 3 && Lexer::isHexDigit(c[1]) && Lexer::isHexDigit(c[2])) { 851 u = UChar(Lexer::convertHex(c[1], c[2])); 852 852 c = &u; 853 853 k += 2;
Note:
See TracChangeset
for help on using the changeset viewer.