1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:47:35 +00:00

LibJS: Add initial support for creating PrimitiveStrings with AK::String

This will temporarily bloat the size of PrimitiveString as LibJS is
transitioned to use String throughout, but will make doing so piecemeal
much easier.
This commit is contained in:
Timothy Flynn 2023-01-13 12:24:02 -05:00 committed by Linus Groh
parent 0b58748156
commit 8f5bdce8e7
4 changed files with 74 additions and 4 deletions

View file

@ -73,11 +73,18 @@ public:
JS_ENUMERATE_WELL_KNOWN_SYMBOLS
#undef __JS_ENUMERATE
HashMap<String, PrimitiveString*>& string_cache()
{
return m_string_cache;
}
HashMap<DeprecatedString, PrimitiveString*>& deprecated_string_cache()
{
return m_deprecated_string_cache;
}
PrimitiveString& empty_string() { return *m_empty_string; }
PrimitiveString& single_ascii_character_string(u8 character)
{
VERIFY(character < 0x80);
@ -257,6 +264,7 @@ private:
void import_module_dynamically(ScriptOrModule referencing_script_or_module, ModuleRequest module_request, PromiseCapability const& promise_capability);
void finish_dynamic_import(ScriptOrModule referencing_script_or_module, ModuleRequest module_request, PromiseCapability const& promise_capability, Promise* inner_promise);
HashMap<String, PrimitiveString*> m_string_cache;
HashMap<DeprecatedString, PrimitiveString*> m_deprecated_string_cache;
Heap m_heap;