Changeset 165703 in webkit for trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
- Timestamp:
- Mar 16, 2014, 10:35:53 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
r163844 r165703 64 64 char c = *p; 65 65 if (c && strchr(doNotEscape, c)) 66 builder.append( c);66 builder.append(static_cast<LChar>(c)); 67 67 else { 68 68 char tmp[4]; … … 129 129 } 130 130 if (charLen && (u == 0 || u >= 128 || !strchr(doNotUnescape, u))) { 131 if (u < 256) 132 builder.append(static_cast<LChar>(u)); 133 else 134 builder.append(u); 131 builder.append(u); 135 132 k += charLen; 136 133 continue; … … 145 142 static JSValue decode(ExecState* exec, const char* doNotUnescape, bool strict) 146 143 { 147 JSStringBuilder builder;148 144 String str = exec->argument(0).toString(exec)->value(exec); 149 145 … … 190 186 } 191 187 192 double parseIntOverflow(const LChar* s, intlength, int radix)188 double parseIntOverflow(const LChar* s, unsigned length, int radix) 193 189 { 194 190 double number = 0.0; … … 212 208 } 213 209 214 double parseIntOverflow(const UChar* s, intlength, int radix)210 static double parseIntOverflow(const UChar* s, unsigned length, int radix) 215 211 { 216 212 double number = 0.0; … … 232 228 233 229 return number; 230 } 231 232 static double parseIntOverflow(StringView string, int radix) 233 { 234 if (string.is8Bit()) 235 return parseIntOverflow(string.characters8(), string.length(), radix); 236 return parseIntOverflow(string.characters16(), string.length(), radix); 234 237 } 235 238 … … 309 312 if (radix == 10) { 310 313 size_t parsedLength; 311 number = parseDouble( s.deprecatedCharacters() + firstDigitPosition, p - firstDigitPosition, parsedLength);314 number = parseDouble(StringView(s).substring(firstDigitPosition, p - firstDigitPosition), parsedLength); 312 315 } else if (radix == 2 || radix == 4 || radix == 8 || radix == 16 || radix == 32) 313 number = parseIntOverflow( s.substringSharingImpl(firstDigitPosition, p - firstDigitPosition).utf8().data(), p - firstDigitPosition, radix);316 number = parseIntOverflow(StringView(s).substring(firstDigitPosition, p - firstDigitPosition), radix); 314 317 } 315 318 … … 621 624 int u = c[0]; 622 625 if (u && strchr(do_not_escape, static_cast<char>(u))) 623 builder.append( c, 1);626 builder.append(*c); 624 627 else { 625 628 char tmp[4]; … … 640 643 builder.append(tmp); 641 644 } else if (u != 0 && strchr(do_not_escape, static_cast<char>(u))) 642 builder.append( c, 1);645 builder.append(*c); 643 646 else { 644 647 char tmp[4];
Note:
See TracChangeset
for help on using the changeset viewer.