Bug 1890277: part 2) Add `require-trusted-types-for` directive to CSP parser, guarded...
[gecko.git] / mfbt / double-conversion / to-fixed-dbl-max.patch
blob9d0a5d2f2e8de494e30da70e266bc7d1fa9de02e
1 diff --git a/double-conversion/double-to-string.cc b/double-conversion/double-to-string.cc
2 --- a/double-conversion/double-to-string.cc
3 +++ b/double-conversion/double-to-string.cc
4 @@ -207,25 +207,21 @@ bool DoubleToStringConverter::ToShortest
6 return true;
10 bool DoubleToStringConverter::ToFixed(double value,
11 int requested_digits,
12 StringBuilder* result_builder) const {
13 - DOUBLE_CONVERSION_ASSERT(kMaxFixedDigitsBeforePoint == 60);
14 - const double kFirstNonFixed = 1e60;
16 if (Double(value).IsSpecial()) {
17 return HandleSpecialValues(value, result_builder);
20 if (requested_digits > kMaxFixedDigitsAfterPoint) return false;
21 - if (value >= kFirstNonFixed || value <= -kFirstNonFixed) return false;
23 // Find a sufficiently precise decimal representation of n.
24 int decimal_point;
25 bool sign;
26 // Add space for the '\0' byte.
27 const int kDecimalRepCapacity =
28 kMaxFixedDigitsBeforePoint + kMaxFixedDigitsAfterPoint + 1;
29 char decimal_rep[kDecimalRepCapacity];
30 diff --git a/double-conversion/double-to-string.h b/double-conversion/double-to-string.h
31 --- a/double-conversion/double-to-string.h
32 +++ b/double-conversion/double-to-string.h
33 @@ -33,17 +33,17 @@
35 namespace double_conversion {
37 class DoubleToStringConverter {
38 public:
39 // When calling ToFixed with a double > 10^kMaxFixedDigitsBeforePoint
40 // or a requested_digits parameter > kMaxFixedDigitsAfterPoint then the
41 // function returns false.
42 - static const int kMaxFixedDigitsBeforePoint = 60;
43 + static const int kMaxFixedDigitsBeforePoint = 308;
44 static const int kMaxFixedDigitsAfterPoint = 100;
46 // When calling ToExponential with a requested_digits
47 // parameter > kMaxExponentialDigits then the function returns false.
48 static const int kMaxExponentialDigits = 120;
50 // When calling ToPrecision with a requested_digits
51 // parameter < kMinPrecisionDigits or requested_digits > kMaxPrecisionDigits