mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:57:44 +00:00
LibJS: Start implementing Temporal.Instant
Just like the initial Temporal.TimeZone commit, this patch adds the Instant object itself, its constructor and prototype (currently empty), and two required abstract operations.
This commit is contained in:
parent
d9cff591b6
commit
47fb4286c7
11 changed files with 255 additions and 1 deletions
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Linus Groh <linusg@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Runtime/NativeFunction.h>
|
||||
|
||||
namespace JS::Temporal {
|
||||
|
||||
class InstantConstructor final : public NativeFunction {
|
||||
JS_OBJECT(InstantConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit InstantConstructor(GlobalObject&);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~InstantConstructor() override = default;
|
||||
|
||||
virtual Value call() override;
|
||||
virtual Value 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