diff options
author | Timothy Flynn <trflynn89@pm.me> | 2021-11-14 10:10:44 -0500 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-11-14 17:00:35 +0000 |
commit | b019a7fe64e4a8d3b23a10942db124d749cd6cbe (patch) | |
tree | 5d85ccf26c62d0824f01ca9b1661723076a7928a /Userland/Libraries/LibJS | |
parent | 3645f6a0fcb6eb0f89ea6593664561b309ca40ba (diff) | |
download | serenity-b019a7fe64e4a8d3b23a10942db124d749cd6cbe.zip |
LibJS: Define the "name" property on the number format function
Also add a missing spec link.
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.cpp index 8a51a4a7e9..e758aa9d9f 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.cpp @@ -10,7 +10,7 @@ namespace JS::Intl { -// 15.1.4 Number Format Functions +// 15.1.4 Number Format Functions, https://tc39.es/ecma402/#sec-number-format-functions NumberFormatFunction* NumberFormatFunction::create(GlobalObject& global_object, NumberFormat& number_format) { return global_object.heap().allocate<NumberFormatFunction>(global_object, number_format, *global_object.function_prototype()); @@ -24,8 +24,11 @@ NumberFormatFunction::NumberFormatFunction(NumberFormat& number_format, Object& void NumberFormatFunction::initialize(GlobalObject& global_object) { + auto& vm = this->vm(); + Base::initialize(global_object); - define_direct_property(vm().names.length, Value(1), Attribute::Configurable); + define_direct_property(vm.names.length, Value(1), Attribute::Configurable); + define_direct_property(vm.names.name, js_string(vm, String::empty()), Attribute::Configurable); } ThrowCompletionOr<Value> NumberFormatFunction::call() |