mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-08 02:26:10 +00:00
LibJS: Implement the Temporal.PlainTime constructor
And the simple Temporal.PlainTime.prototype getters, so that the constructed Temporal.PlainTime may actually be validated.
This commit is contained in:
parent
971f794127
commit
66365fef57
Notes:
github-actions[bot]
2024-11-24 00:38:03 +00:00
Author: https://github.com/trflynn89
Commit: 66365fef57
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2535
22 changed files with 693 additions and 1 deletions
34
Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.h
Normal file
34
Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.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 PlainTimeConstructor final : public NativeFunction {
|
||||
JS_OBJECT(PlainTimeConstructor, NativeFunction);
|
||||
GC_DECLARE_ALLOCATOR(PlainTimeConstructor);
|
||||
|
||||
public:
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~PlainTimeConstructor() override = default;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
virtual ThrowCompletionOr<GC::Ref<Object>> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit PlainTimeConstructor(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