FIX: Add replaceAll to browser-detect (#16248)

We're using replaceAll in a few places. If it's not supported, we should fall back to the basic-html view.
This commit is contained in:
David Taylor 2022-03-22 11:45:03 +00:00 committed by GitHub
parent 4e6f7a1a6e
commit cf6deb439a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -1,4 +1,9 @@
if (!window.WeakMap || !window.Promise || typeof globalThis === "undefined") {
if (
!window.WeakMap ||
!window.Promise ||
typeof globalThis === "undefined" ||
!String.prototype.replaceAll
) {
window.unsupportedBrowser = true;
} else {
// Some implementations of `WeakMap.prototype.has` do not accept false