The main use of this method appears to be when parsing attributes with floating
point values in HTML. By changing from PR_strtod, this change does have some
semantic differences around edge-cases, though I've tried to keep it compliant
with the wording in the standard.
Here are some of the edge-cases I investigated:
1. We appear to build nspr with INFNAN_CHECK undefined, meaning that we did not
parse strings like "inf", "infinity" and "nan" both before and after this
change.
2. PR_strtod already ignored locale (built with USE_LOCALE undefined), so
locale behaviour shouldn't have changed.
3. Neither PR_strtod nor the spec support hex floats, so I didn't enable them
in double-conversion.
4. Leading whitespace is skipped by both PR_strtod and in the spec, so is
skipped after this change.
5. Numbers too large to fit in a double (e.g. 2E308) were previously returned
as inf or -inf by PR_strtod. The spec specifies that these values should return
an error instead, so they have been changed to produce an error with this
change.
This is a web-visible change (<progress value=2E308 max=10> is indeterminate
in Chromium and complete in Firefox before this change, it will be
indeterminate for both after the change).
6. Parsing for floats & doubles are now handled seperately due to
differences in the maximum and minimum representable values.
Differential Revision: https://phabricator.services.mozilla.com/D148305
The last remaining things requiring unified builds in this directory are the
explicit specializations. As each class' methods are now confined to a single
file, these can now be moved to the appropriate .cpp files.
Differential Revision: https://phabricator.services.mozilla.com/D148303
Due to the history of how nsString was implemented, many APIs ended up being
implemented in inappropriate files. This change moves simple definitions which
won't require any changes for each type to happen within that type's .cpp file.
This is necessary to eventually enable the directory to be built without
unified builds.
Differential Revision: https://phabricator.services.mozilla.com/D148298
The last remaining things requiring unified builds in this directory are the
explicit specializations. As each class' methods are now confined to a single
file, these can now be moved to the appropriate .cpp files.
Differential Revision: https://phabricator.services.mozilla.com/D148303
Due to the history of how nsString was implemented, many APIs ended up being
implemented in inappropriate files. This change moves simple definitions which
won't require any changes for each type to happen within that type's .cpp file.
This is necessary to eventually enable the directory to be built without
unified builds.
Differential Revision: https://phabricator.services.mozilla.com/D148298
This removes the double-include macro hackery that we use to define two
separate string types (nsAString and nsACString) in favor of a templated
solution.
Annotations for Valgrind and the JS hazard analysis are updated as well as
the rust binding generations for string code.