mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-05 16:14:38 +00:00
LibJS: Allow unpaired surrogates in String.prototype.replace
This was resulting in a crash for the WPT test case: https://wpt.live/xhr/send-data-string-invalid-unicode.any.html
This commit is contained in:
@@ -1401,7 +1401,7 @@ ThrowCompletionOr<String> get_substitution(VM& vm, Utf16View const& matched, Utf
|
||||
}
|
||||
|
||||
// 6. Return result.
|
||||
return MUST(Utf16View { result }.to_utf8());
|
||||
return MUST(Utf16View { result }.to_utf8(Utf16View::AllowInvalidCodeUnits::Yes));
|
||||
}
|
||||
|
||||
// 2.1.2 AddDisposableResource ( disposable, V, hint [ , method ] ), https://tc39.es/proposal-explicit-resource-management/#sec-adddisposableresource-disposable-v-hint-disposemethod
|
||||
|
||||
Reference in New Issue
Block a user