mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 05:47:31 +08:00
a4cef67e14
* FIX: Feature detect globalThis So browsers without support will receive a warning and browse our JS-less view.
13 lines
408 B
JavaScript
13 lines
408 B
JavaScript
if (!window.WeakMap || !window.Promise || typeof globalThis === "undefined") {
|
|
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;
|
|
}
|
|
}
|