mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:27:35 +00:00
LibJS: Always synthesize "arguments" object when there's a callee
Instead of counting the number of call frames on the VM stack, we now always fake the "arguments" object when the current call frame has a callee value. This fixes an issue with DOM event handlers in LibWeb not being able to access "arguments" since they were called without an outer frame.
This commit is contained in:
parent
3217e6237c
commit
9e6d0dd879
1 changed files with 1 additions and 1 deletions
|
@ -164,7 +164,7 @@ void VM::set_variable(const FlyString& name, Value value, GlobalObject& global_o
|
|||
Value VM::get_variable(const FlyString& name, GlobalObject& global_object)
|
||||
{
|
||||
if (!m_call_stack.is_empty()) {
|
||||
if (name == names.arguments && m_call_stack.size() > 1) {
|
||||
if (name == names.arguments && !call_frame().callee.is_empty()) {
|
||||
// HACK: Special handling for the name "arguments":
|
||||
// If the name "arguments" is defined in the current scope, for example via
|
||||
// a function parameter, or by a local var declaration, we use that.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue