mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 17:27:34 +00:00
LibJS: Use ClassFieldInitializerStatement for class fields
This is necessary as we might have to perform named evaluation with the field name. Ideally we would also skip some setup parts of the function like function_declaration_instantiation however this would require bigger changes to ECMAScriptFunctionObject.
This commit is contained in:
parent
7e8724db71
commit
4c8090a45d
4 changed files with 48 additions and 5 deletions
|
@ -1085,10 +1085,11 @@ private:
|
|||
|
||||
class ClassField final : public ClassElement {
|
||||
public:
|
||||
ClassField(SourceRange source_range, NonnullRefPtr<Expression> key, RefPtr<Expression> init, bool is_static)
|
||||
ClassField(SourceRange source_range, NonnullRefPtr<Expression> key, RefPtr<Expression> init, bool contains_direct_call_to_eval, bool is_static)
|
||||
: ClassElement(source_range, is_static)
|
||||
, m_key(move(key))
|
||||
, m_initializer(move(init))
|
||||
, m_contains_direct_call_to_eval(contains_direct_call_to_eval)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -1105,6 +1106,7 @@ public:
|
|||
private:
|
||||
NonnullRefPtr<Expression> m_key;
|
||||
RefPtr<Expression> m_initializer;
|
||||
bool m_contains_direct_call_to_eval { false };
|
||||
};
|
||||
|
||||
class StaticInitializer final : public ClassElement {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue