1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:37:36 +00:00

LibJS: Implement get Intl.Collator.prototype.compare

This commit is contained in:
Idan Horowitz 2022-02-20 21:00:37 +02:00 committed by Tim Flynn
parent 0bdb293262
commit 6558f4ae6b
5 changed files with 84 additions and 7 deletions

View file

@ -9,6 +9,7 @@
#include <AK/Array.h>
#include <AK/String.h>
#include <AK/StringView.h>
#include <LibJS/Runtime/Intl/CollatorCompareFunction.h>
#include <LibJS/Runtime/Object.h>
namespace JS::Intl {
@ -69,14 +70,20 @@ public:
bool numeric() const { return m_numeric; }
void set_numeric(bool numeric) { m_numeric = numeric; }
CollatorCompareFunction* bound_compare() const { return m_bound_compare; }
void set_bound_compare(CollatorCompareFunction* bound_compare) { m_bound_compare = bound_compare; }
private:
String m_locale; // [[Locale]]
Usage m_usage { Usage::Sort }; // [[Usage]]
Sensitivity m_sensitivity { Sensitivity::Variant }; // [[Sensitivity]]
CaseFirst m_case_first { CaseFirst::False }; // [[CaseFirst]]
String m_collation; // [[Collation]]
bool m_ignore_punctuation { false }; // [[IgnorePunctuation]]
bool m_numeric { false }; // [[Numeric]]
virtual void visit_edges(Visitor&) override;
String m_locale; // [[Locale]]
Usage m_usage { Usage::Sort }; // [[Usage]]
Sensitivity m_sensitivity { Sensitivity::Variant }; // [[Sensitivity]]
CaseFirst m_case_first { CaseFirst::False }; // [[CaseFirst]]
String m_collation; // [[Collation]]
bool m_ignore_punctuation { false }; // [[IgnorePunctuation]]
bool m_numeric { false }; // [[Numeric]]
CollatorCompareFunction* m_bound_compare { nullptr }; // [[BoundCompare]]
};
}