summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp')
-rw-r--r--JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp b/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
index 5b6369a..5da5194 100644
--- a/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
+++ b/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
@@ -241,6 +241,7 @@ static double parseInt(const UString& s, int radix)
}
if (number >= mantissaOverflowLowerBound) {
+ // FIXME: It is incorrect to use UString::ascii() here because it's not thread-safe.
if (radix == 10)
number = WTF::strtod(s.substr(firstDigitPosition, p - firstDigitPosition).ascii(), 0);
else if (radix == 2 || radix == 4 || radix == 8 || radix == 16 || radix == 32)
@@ -269,6 +270,8 @@ static double parseFloat(const UString& s)
if (length - p >= 2 && data[p] == '0' && (data[p + 1] == 'x' || data[p + 1] == 'X'))
return 0;
+ // FIXME: UString::toDouble will ignore leading ASCII spaces, but we need to ignore
+ // other StrWhiteSpaceChar values as well.
return s.toDouble(true /*tolerant*/, false /* NaN for empty string */);
}