mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 20:17:44 +00:00
LibJS: Store and maintain an "execution generation" counter
This counter is increased each time a synchronous execution sequence completes, and will allow us to emulate the abstract operations AddToKeptObjects & ClearKeptObjects efficiently.
This commit is contained in:
parent
8a739f986a
commit
6913f06b6f
4 changed files with 11 additions and 0 deletions
|
@ -166,6 +166,9 @@ public:
|
|||
bool underscore_is_last_value() const { return m_underscore_is_last_value; }
|
||||
void set_underscore_is_last_value(bool b) { m_underscore_is_last_value = b; }
|
||||
|
||||
u32 execution_generation() const { return m_execution_generation; }
|
||||
void finish_execution_generation() { ++m_execution_generation; }
|
||||
|
||||
void unwind(ScopeType type, FlyString label = {})
|
||||
{
|
||||
m_unwind_until = type;
|
||||
|
@ -279,6 +282,8 @@ private:
|
|||
Shape* m_scope_object_shape { nullptr };
|
||||
|
||||
bool m_underscore_is_last_value { false };
|
||||
|
||||
u32 m_execution_generation { 0 };
|
||||
};
|
||||
|
||||
template<>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue