mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:38:11 +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
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