LibJS: Add the Number.{MAX, MIN}_VALUE constants

This commit is contained in:
Idan Horowitz 2021-06-05 00:56:43 +03:00 committed by Linus Groh
parent 3dab9d0b5c
commit 0f8ed6183b
Notes: sideshowbarker 2024-07-18 16:52:16 +09:00
2 changed files with 4 additions and 0 deletions

View file

@ -24,7 +24,9 @@ namespace JS {
P(LOG10E) \
P(LOG2E) \
P(MAX_SAFE_INTEGER) \
P(MAX_VALUE) \
P(MIN_SAFE_INTEGER) \
P(MIN_VALUE) \
P(Math) \
P(NEGATIVE_INFINITY) \
P(NaN) \

View file

@ -40,6 +40,8 @@ void NumberConstructor::initialize(GlobalObject& global_object)
define_property(vm.names.prototype, global_object.number_prototype(), 0);
define_property(vm.names.length, Value(1), Attribute::Configurable);
define_property(vm.names.EPSILON, Value(EPSILON_VALUE), 0);
define_property(vm.names.MAX_VALUE, Value(NumericLimits<double>::max()), 0);
define_property(vm.names.MIN_VALUE, Value(NumericLimits<double>::min()), 0);
define_property(vm.names.MAX_SAFE_INTEGER, Value(MAX_SAFE_INTEGER_VALUE), 0);
define_property(vm.names.MIN_SAFE_INTEGER, Value(MIN_SAFE_INTEGER_VALUE), 0);
define_property(vm.names.NEGATIVE_INFINITY, js_negative_infinity(), 0);