mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:17:44 +00:00
LibJS: Use local variables for function declarations when possible
Previously, the usage of local variables was limited for all function declarations. This change relaxes the restriction and only prohibits locals for hoistable annexB declarations.
This commit is contained in:
parent
167495b87b
commit
8b6450842e
4 changed files with 36 additions and 26 deletions
|
@ -707,6 +707,7 @@ struct FunctionParameter {
|
|||
class FunctionNode {
|
||||
public:
|
||||
StringView name() const { return m_name ? m_name->string().view() : ""sv; }
|
||||
RefPtr<Identifier const> name_identifier() const { return m_name; }
|
||||
DeprecatedString const& source_text() const { return m_source_text; }
|
||||
Statement const& body() const { return *m_body; }
|
||||
Vector<FunctionParameter> const& parameters() const { return m_parameters; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue