mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-20 08:18:55 +00:00
LibJS: Implement a nearly empty Intl.Collator object
This adds plumbing for the Intl.Collator object, constructor, and prototype.
This commit is contained in:
parent
4d43aeae30
commit
4a3e142d55
Notes:
sideshowbarker
2024-07-17 20:01:33 +09:00
Author: https://github.com/trflynn89
Commit: 4a3e142d55
Pull-request: https://github.com/SerenityOS/serenity/pull/12200
Reviewed-by: https://github.com/linusg
12 changed files with 328 additions and 0 deletions
28
Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.h
Normal file
28
Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Tim Flynn <trflynn89@pm.me>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Runtime/NativeFunction.h>
|
||||
|
||||
namespace JS::Intl {
|
||||
|
||||
class CollatorConstructor final : public NativeFunction {
|
||||
JS_OBJECT(CollatorConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit CollatorConstructor(GlobalObject&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~CollatorConstructor() override = default;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue