mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16:37:47 +00:00
LibJS: Make FunctionExpression more spec-compliant
This commit is contained in:
parent
0da1353c80
commit
0dc4e722e6
3 changed files with 22 additions and 2 deletions
|
@ -327,16 +327,20 @@ public:
|
|||
if (m_cannot_auto_rename)
|
||||
return;
|
||||
m_cannot_auto_rename = true;
|
||||
if (name().is_empty())
|
||||
if (name().is_empty()) {
|
||||
set_name(move(new_name));
|
||||
m_is_auto_renamed = true;
|
||||
}
|
||||
}
|
||||
bool cannot_auto_rename() const { return m_cannot_auto_rename; }
|
||||
bool is_auto_renamed() const { return m_is_auto_renamed; }
|
||||
void set_cannot_auto_rename() { m_cannot_auto_rename = true; }
|
||||
|
||||
virtual void generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
private:
|
||||
bool m_cannot_auto_rename { false };
|
||||
bool m_is_auto_renamed { false };
|
||||
};
|
||||
|
||||
class ErrorExpression final : public Expression {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue