Changeset 110657 in webkit for trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
- Timestamp:
- Mar 13, 2012, 7:12:25 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
r110033 r110657 298 298 if (number >= mantissaOverflowLowerBound) { 299 299 if (radix == 10) 300 number = WTF::strtod<WTF::AllowTrailingJunk >(s.substringSharingImpl(firstDigitPosition, p - firstDigitPosition).utf8().data(), 0);300 number = WTF::strtod<WTF::AllowTrailingJunk, WTF::DisallowTrailingSpaces>(s.substringSharingImpl(firstDigitPosition, p - firstDigitPosition).utf8().data(), 0); 301 301 else if (radix == 2 || radix == 4 || radix == 8 || radix == 16 || radix == 32) 302 302 number = parseIntOverflow(s.substringSharingImpl(firstDigitPosition, p - firstDigitPosition).utf8().data(), p - firstDigitPosition, radix); … … 357 357 358 358 // See ecma-262 9.3.1 359 template < typename CharType>359 template <WTF::AllowTrailingJunkTag allowTrailingJunk, typename CharType> 360 360 static double jsStrDecimalLiteral(const CharType*& data, const CharType* end) 361 361 { … … 370 370 byteBuffer.append(0); 371 371 char* endOfNumber; 372 double number = WTF::strtod< WTF::AllowTrailingJunk>(byteBuffer.data(), &endOfNumber);372 double number = WTF::strtod<allowTrailingJunk, WTF::AllowTrailingSpaces>(byteBuffer.data(), &endOfNumber); 373 373 374 374 // Check if strtod found a number; if so return it. … … 426 426 number = jsHexIntegerLiteral(characters, endCharacters); 427 427 else 428 number = jsStrDecimalLiteral (characters, endCharacters);428 number = jsStrDecimalLiteral<WTF::DisallowTrailingJunk>(characters, endCharacters); 429 429 430 430 // Allow trailing white space. … … 483 483 return std::numeric_limits<double>::quiet_NaN(); 484 484 485 return jsStrDecimalLiteral (data, end);485 return jsStrDecimalLiteral<WTF::AllowTrailingJunk>(data, end); 486 486 } 487 487 … … 499 499 return std::numeric_limits<double>::quiet_NaN(); 500 500 501 return jsStrDecimalLiteral (data, end);501 return jsStrDecimalLiteral<WTF::AllowTrailingJunk>(data, end); 502 502 } 503 503
Note:
See TracChangeset
for help on using the changeset viewer.