1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:28:11 +00:00

LibWeb: Add HTML::Window::cached_web_prototype()

This is a simpler version of ensure_web_prototype<T>(). This new version
assumes that we already have a cached instance of the prototype.
This commit is contained in:
Andreas Kling 2022-09-03 18:38:47 +02:00
parent 6f433c8656
commit 8341f142ea
2 changed files with 12 additions and 0 deletions

View file

@ -169,6 +169,8 @@ public:
JS::Object* web_prototype(String const& class_name) { return m_prototypes.get(class_name).value_or(nullptr); }
JS::NativeFunction* web_constructor(String const& class_name) { return m_constructors.get(class_name).value_or(nullptr); }
JS::Object& cached_web_prototype(String const& class_name);
template<typename T>
JS::Object& ensure_web_prototype(String const& class_name)
{