diff --git a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp index a044f25158..18843be5c6 100644 --- a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp @@ -383,7 +383,7 @@ DeprecatedString JSONObject::quote_json_string(DeprecatedString string) break; default: // b. Else if C has a numeric value less than 0x0020 (SPACE), or if C has the same numeric value as a leading surrogate or trailing surrogate, then - if (code_point < 0x20 || Utf16View::is_high_surrogate(code_point) || Utf16View::is_low_surrogate(code_point)) { + if (code_point < 0x20 || is_unicode_surrogate(code_point)) { // i. Let unit be the code unit whose numeric value is that of C. // ii. Set product to the string-concatenation of product and UnicodeEscape(unit). builder.appendff("\\u{:04x}", code_point); diff --git a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp index 174555383b..0877f3ee60 100644 --- a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp @@ -121,7 +121,7 @@ CodePoint code_point_at(Utf16View const& string, size_t position) auto code_point = static_cast(first); // 5. If first is not a leading surrogate or trailing surrogate, then - if (!Utf16View::is_high_surrogate(first) && !Utf16View::is_low_surrogate(first)) { + if (!is_unicode_surrogate(first)) { // a. Return the Record { [[CodePoint]]: cp, [[CodeUnitCount]]: 1, [[IsUnpairedSurrogate]]: false }. return { false, code_point, 1 }; }