summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-06-12 05:49:09 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-12 11:14:55 +0200
commit6a78b44c227b37cf3dca1d611abd720de1b2b732 (patch)
tree8662d55f6434963faa5cf682ecdacae57e6b2a7c /Userland/Libraries
parent633f604c471a958ed6210b2dc4fe609407f3e627 (diff)
downloadserenity-6a78b44c227b37cf3dca1d611abd720de1b2b732.zip
LibJS: Add missing length() method for NewArray
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibJS/Bytecode/Op.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Bytecode/Op.h b/Userland/Libraries/LibJS/Bytecode/Op.h
index 79212526ea..c3bb8eff8b 100644
--- a/Userland/Libraries/LibJS/Bytecode/Op.h
+++ b/Userland/Libraries/LibJS/Bytecode/Op.h
@@ -184,6 +184,8 @@ public:
void execute(Bytecode::Interpreter&) const;
String to_string(Bytecode::Executable const&) const;
+ size_t length() const { return sizeof(*this) + sizeof(Register) * m_element_count; }
+
private:
size_t m_element_count { 0 };
Register m_elements[];