1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 11:18:13 +00:00

LibJS: Implement a basic Intl mathematical value

The Intl mathematical value is much like ECMA-262's mathematical value
in that it is meant to represent an arbitrarily precise number. The Intl
MV further allows positive/negative infinity, negative zero, and NaN.

This implementation is *not* arbitrarily precise. Rather, it is a
replacement for the use of Value within Intl.NumberFormat. The exact
syntax of the Intl MV is still being worked on, but abstracting this
away into its own class will allow hooking in the finalized Intl MV
more easily, and makes implementing Intl.NumberFormat.formatRange
easier.

Note the methods added here are essentially the same as the static
helpers in Intl/NumberFormat.cpp.
This commit is contained in:
Timothy Flynn 2022-07-19 12:07:00 -04:00 committed by Linus Groh
parent 99b79766cd
commit 0026e9a4c8
4 changed files with 454 additions and 0 deletions

View file

@ -225,6 +225,8 @@ namespace Intl {
JS_ENUMERATE_INTL_OBJECTS
#undef __JS_ENUMERATE
class MathematicalValue;
// Not included in JS_ENUMERATE_INTL_OBJECTS due to missing distinct constructor
class Segments;
class SegmentsPrototype;