mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:47:44 +00:00
LibJS: Make ExecutionContext::function_name a GCPtr<PrimitiveString>
This required setting things up so that all function objects can plop a PrimitiveString there instead of an AK string. This is a step towards making ExecutionContext easier to allocate.
This commit is contained in:
parent
eda2a6d9f7
commit
845da3901d
9 changed files with 34 additions and 16 deletions
|
@ -48,16 +48,14 @@ protected:
|
|||
NativeFunction(DeprecatedFlyString name, JS::GCPtr<JS::HeapFunction<ThrowCompletionOr<Value>(VM&)>>, Object& prototype);
|
||||
explicit NativeFunction(Object& prototype);
|
||||
|
||||
virtual void visit_edges(Cell::Visitor& visitor) override
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_native_function);
|
||||
}
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor& visitor) override;
|
||||
|
||||
private:
|
||||
virtual bool is_native_function() const final { return true; }
|
||||
|
||||
DeprecatedFlyString m_name;
|
||||
GCPtr<PrimitiveString> m_name_string;
|
||||
Optional<DeprecatedFlyString> m_initial_name; // [[InitialName]]
|
||||
JS::GCPtr<JS::HeapFunction<ThrowCompletionOr<Value>(VM&)>> m_native_function;
|
||||
GCPtr<Realm> m_realm;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue