mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-28 21:26:22 +00:00
LibJS: Implement the Temporal.PlainYearMonth constructor
And the simple Temporal.PlainYearMonth.prototype getters, so that the constructed Temporal.PlainYearMonth may actually be validated.
This commit is contained in:
parent
1c733993e0
commit
b68d67693e
Notes:
github-actions[bot]
2024-11-22 18:56:56 +00:00
Author: https://github.com/trflynn89
Commit: b68d67693e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2496
27 changed files with 926 additions and 3 deletions
34
Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.h
Normal file
34
Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org>
|
||||
* Copyright (c) 2024, Tim Flynn <trflynn89@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Runtime/NativeFunction.h>
|
||||
|
||||
namespace JS::Temporal {
|
||||
|
||||
class PlainYearMonthConstructor final : public NativeFunction {
|
||||
JS_OBJECT(PlainYearMonthConstructor, NativeFunction);
|
||||
GC_DECLARE_ALLOCATOR(PlainYearMonthConstructor);
|
||||
|
||||
public:
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~PlainYearMonthConstructor() override = default;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
virtual ThrowCompletionOr<GC::Ref<Object>> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit PlainYearMonthConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(from);
|
||||
JS_DECLARE_NATIVE_FUNCTION(compare);
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue