mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:48:11 +00:00
LibJS: Don't hoist functions under certain circumstances
When a lexical declaration with the same name as a function exists, the function is not hoisted (annex B).
This commit is contained in:
parent
e0d26fff8c
commit
37c4fbb6ca
4 changed files with 50 additions and 9 deletions
|
@ -2377,9 +2377,9 @@ void ScopeNode::add_functions(NonnullRefPtrVector<FunctionDeclaration> functions
|
|||
m_functions.extend(move(functions));
|
||||
}
|
||||
|
||||
void ScopeNode::add_hoisted_functions(NonnullRefPtrVector<FunctionDeclaration> hoisted_functions)
|
||||
void ScopeNode::add_hoisted_function(NonnullRefPtr<FunctionDeclaration> hoisted_function)
|
||||
{
|
||||
m_hoisted_functions.extend(move(hoisted_functions));
|
||||
m_hoisted_functions.append(hoisted_function);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue