mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 08:39:22 +00:00
LibJS: Implement Proxy [[Call]] and [[Construct]] traps
In order to do this, Proxy now extends Function rather than Object, and whether or not it returns true for is_function() depends on it's m_target.
This commit is contained in:
parent
ed683663cd
commit
98323e19e5
Notes:
sideshowbarker
2024-07-19 05:18:46 +09:00
Author: https://github.com/mattco98
Commit: 98323e19e5
Pull-request: https://github.com/SerenityOS/serenity/pull/2630
Issue: https://github.com/SerenityOS/serenity/issues/2624
Reviewed-by: https://github.com/awesomekling
5 changed files with 98 additions and 6 deletions
|
@ -136,6 +136,15 @@ public:
|
|||
|
||||
bool in_strict_mode() const { return m_scope_stack.last().scope_node->in_strict_mode(); }
|
||||
|
||||
template<typename Callback>
|
||||
void for_each_argument(Callback callback)
|
||||
{
|
||||
if (m_call_stack.is_empty())
|
||||
return;
|
||||
for (auto& value : m_call_stack.last().arguments)
|
||||
callback(value);
|
||||
}
|
||||
|
||||
size_t argument_count() const
|
||||
{
|
||||
if (m_call_stack.is_empty())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue