blob: ea204a02bb83ae45466bcedbc8209e3f0548beee (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/*
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibJS/Runtime/Object.h>
namespace JS {
class Array : public Object {
JS_OBJECT(Array, Object);
public:
static Array* create(GlobalObject&, size_t length = 0);
static Array* create_from(GlobalObject&, const Vector<Value>&);
explicit Array(Object& prototype);
virtual void initialize(GlobalObject&) override;
virtual ~Array() override;
static Array* typed_this(VM&, GlobalObject&);
private:
virtual bool is_array() const override { return true; }
JS_DECLARE_NATIVE_GETTER(length_getter);
JS_DECLARE_NATIVE_SETTER(length_setter);
};
}
|