mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 03:58:34 +08:00
cf6deb439a
We're using replaceAll in a few places. If it's not supported, we should fall back to the basic-html view.
18 lines
450 B
JavaScript
18 lines
450 B
JavaScript
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
|
|
// values and Ember's `isClassicDecorator` sometimes does that (it only
|
|
// checks for `null` and `undefined`).
|
|
try {
|
|
new WeakMap().has(0);
|
|
} catch (err) {
|
|
window.unsupportedBrowser = true;
|
|
}
|
|
}
|