diff options
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/StringPrototype.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp b/Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp index 13d6bd5e63..20359f7998 100644 --- a/Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp @@ -450,9 +450,9 @@ JS_DEFINE_NATIVE_FUNCTION(NumberPrototype::to_string) if (number_value.is_negative_infinity()) return PrimitiveString::create(vm, "-Infinity"); if (number_value.is_nan()) - return PrimitiveString::create(vm, "NaN"); + return PrimitiveString::create(vm, String::from_utf8_short_string("NaN"sv)); if (number_value.is_positive_zero() || number_value.is_negative_zero()) - return PrimitiveString::create(vm, "0"); + return PrimitiveString::create(vm, String::from_utf8_short_string("0"sv)); double number = number_value.as_double(); bool negative = number < 0; diff --git a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp index 2a1287fa1e..446288dc64 100644 --- a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp @@ -494,7 +494,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::match_all) auto string = TRY(this_object.to_utf16_string(vm)); - auto rx = TRY(regexp_create(vm, regexp, PrimitiveString::create(vm, "g"))); + auto rx = TRY(regexp_create(vm, regexp, PrimitiveString::create(vm, String::from_utf8_short_string("g"sv)))); return TRY(Value(rx).invoke(vm, *vm.well_known_symbol_match_all(), PrimitiveString::create(vm, move(string)))); } |