diff options
author | Timothy Flynn <trflynn89@pm.me> | 2023-01-20 07:45:02 -0500 |
---|---|---|
committer | Tim Flynn <trflynn89@pm.me> | 2023-01-20 14:24:12 -0500 |
commit | f1de4f88720cd33acc2042eee7b4f07db560d02f (patch) | |
tree | d1301a5a7e253310e913d9caeb207a8896e4eb63 /Userland/Libraries/LibJS/Runtime | |
parent | d48266a42039b801f5833e9a28634eb94eff7953 (diff) | |
download | serenity-f1de4f88720cd33acc2042eee7b4f07db560d02f.zip |
Everywhere: Convert known short-strings to the infallible String factory
For now, this is limited to strings that are 3 bytes or less. We can use
7 bytes on 64-bit platforms, but we do not yet assume 64-bit for Lagom
hosts (e.g. wasm).
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/StringPrototype.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp index 7f1a3d63cb..d5809d4350 100644 --- a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp @@ -489,7 +489,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::normalize) // 3. If form is undefined, let f be "NFC". if (auto form_value = vm.argument(0); form_value.is_undefined()) { - form = TRY_OR_THROW_OOM(vm, String::from_utf8("NFC"sv)); + form = String::from_utf8_short_string("NFC"sv); } // 4. Else, let f be ? ToString(form). else { |