mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 18:19:03 +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
Notes:
sideshowbarker
2024-07-19 08:01:00 +09:00
Author: https://github.com/awesomekling
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