1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:47:35 +00:00

LibJS: Teach Reference to access call frame arguments directly

This commit is contained in:
Andreas Kling 2021-06-14 10:52:15 +02:00
parent 91fbeeab72
commit 6e0e8a8242
3 changed files with 20 additions and 0 deletions

View file

@ -40,6 +40,15 @@ public:
{
}
enum CallFrameArgumentTag { CallFrameArgument };
Reference(CallFrameArgumentTag, size_t index, FlyString const& name)
: m_base(js_null())
, m_name(name)
, m_call_frame_argument_index(index)
, m_local_variable(true)
{
}
Value base() const { return m_base; }
const PropertyName& name() const { return m_name; }
bool is_strict() const { return m_strict; }
@ -74,6 +83,7 @@ private:
Value m_base;
PropertyName m_name;
Optional<size_t> m_call_frame_argument_index;
bool m_strict { false };
bool m_local_variable { false };
bool m_global_variable { false };