mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:37:45 +00:00
LibJS: Reorganize computing of |this| for CallExpressions
This avoids executing the LHS of the object expression twice when doing a call on the result of an object expression.
This commit is contained in:
parent
021d78f8f7
commit
cd9379dca9
2 changed files with 29 additions and 11 deletions
|
@ -484,6 +484,12 @@ public:
|
|||
private:
|
||||
virtual const char* class_name() const override { return "CallExpression"; }
|
||||
|
||||
struct ThisAndCallee {
|
||||
Value this_value;
|
||||
Value callee;
|
||||
};
|
||||
ThisAndCallee compute_this_and_callee(Interpreter&) const;
|
||||
|
||||
NonnullRefPtr<Expression> m_callee;
|
||||
const NonnullRefPtrVector<Expression> m_arguments;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue