LibWeb: Avoid dynamic_cast in relevant_agent()

There's only ever one kind of JS::VM::CustomData in play anyway.
This commit is contained in:
Andreas Kling 2025-04-18 10:36:04 +02:00 committed by Andreas Kling
parent 57809b1100
commit ce263eaf78
Notes: github-actions[bot] 2025-04-18 12:46:58 +00:00

View file

@ -15,7 +15,7 @@ Agent& relevant_agent(JS::Object const& object)
{
// The relevant agent for a platform object platformObject is platformObject's relevant Realm's agent.
// Spec Note: This pointer is not yet defined in the JavaScript specification; see tc39/ecma262#1357.
return as<Bindings::WebEngineCustomData>(relevant_realm(object).vm().custom_data())->agent;
return static_cast<Bindings::WebEngineCustomData*>(relevant_realm(object).vm().custom_data())->agent;
}
}