mirror of
https://github.com/RGBCube/serenity
synced 2025-05-18 19:55:07 +00:00

We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
36 lines
861 B
C++
36 lines
861 B
C++
/*
|
|
* Copyright (c) 2022, Andrew Kaster <akaster@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <AK/DeprecatedString.h>
|
|
#include <AK/HashMap.h>
|
|
#include <LibJS/Forward.h>
|
|
#include <LibJS/Runtime/NativeFunction.h>
|
|
#include <LibJS/Runtime/Object.h>
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
|
|
|
namespace Web::Bindings {
|
|
|
|
JS::Object& Intrinsics::cached_web_prototype(DeprecatedString const& class_name)
|
|
{
|
|
auto it = m_prototypes.find(class_name);
|
|
if (it == m_prototypes.end()) {
|
|
dbgln("Missing prototype: {}", class_name);
|
|
}
|
|
VERIFY(it != m_prototypes.end());
|
|
return *it->value;
|
|
}
|
|
|
|
void Intrinsics::visit_edges(JS::Cell::Visitor& visitor)
|
|
{
|
|
Base::visit_edges(visitor);
|
|
|
|
for (auto& it : m_prototypes)
|
|
visitor.visit(it.value);
|
|
for (auto& it : m_constructors)
|
|
visitor.visit(it.value);
|
|
}
|
|
|
|
}
|