mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +00:00
LibJS: Add missing length() method for NewArray
This commit is contained in:
parent
633f604c47
commit
6a78b44c22
Notes:
sideshowbarker
2024-07-18 12:22:57 +09:00
Author: https://github.com/gunnarbeutner
Commit: 6a78b44c22
Pull-request: https://github.com/SerenityOS/serenity/pull/8015
1 changed files with 2 additions and 0 deletions
|
@ -184,6 +184,8 @@ public:
|
||||||
void execute(Bytecode::Interpreter&) const;
|
void execute(Bytecode::Interpreter&) const;
|
||||||
String to_string(Bytecode::Executable const&) const;
|
String to_string(Bytecode::Executable const&) const;
|
||||||
|
|
||||||
|
size_t length() const { return sizeof(*this) + sizeof(Register) * m_element_count; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
size_t m_element_count { 0 };
|
size_t m_element_count { 0 };
|
||||||
Register m_elements[];
|
Register m_elements[];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue