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:
parent
0b58748156
commit
8f5bdce8e7
4 changed files with 74 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue