/src/serenity/Userland/Libraries/LibJS/Runtime/NumberObject.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #pragma once |
8 | | |
9 | | #include <LibJS/Runtime/Object.h> |
10 | | |
11 | | namespace JS { |
12 | | |
13 | | class NumberObject : public Object { |
14 | | JS_OBJECT(NumberObject, Object); |
15 | | JS_DECLARE_ALLOCATOR(NumberObject); |
16 | | |
17 | | public: |
18 | | static NonnullGCPtr<NumberObject> create(Realm&, double); |
19 | | |
20 | | virtual ~NumberObject() override = default; |
21 | | |
22 | 0 | double number() const { return m_value; } |
23 | | |
24 | | protected: |
25 | | NumberObject(double, Object& prototype); |
26 | | |
27 | | private: |
28 | | double m_value { 0 }; |
29 | | }; |
30 | | |
31 | | } |