1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:37:45 +00:00

LibJS: Add a constructor to create an Intl.Locale object from a LocaleID

This commit is contained in:
Timothy Flynn 2021-09-02 18:23:39 -04:00 committed by Linus Groh
parent 3abfe7f7db
commit 03d7f01e0c
2 changed files with 46 additions and 0 deletions

View file

@ -10,6 +10,7 @@
#include <AK/String.h>
#include <LibJS/Runtime/Object.h>
#include <LibJS/Runtime/Value.h>
#include <LibUnicode/Forward.h>
namespace JS::Intl {
@ -17,7 +18,10 @@ class Locale final : public Object {
JS_OBJECT(Locale, Object);
public:
static Locale* create(GlobalObject&, Unicode::LocaleID const&);
Locale(Object& prototype);
Locale(Unicode::LocaleID const&, Object& prototype);
virtual ~Locale() override = default;
String const& locale() const { return m_locale; }