DEV: Add production-mode shim for `Em` deprecation (#25109)
This commit is contained in:
parent
451581d50a
commit
6e7356e7c3
|
@ -37,13 +37,14 @@ define("discourse/lib/deprecate-shim", ["exports"], function (exports) {
|
||||||
const deprecate = require("@ember/debug").deprecate;
|
const deprecate = require("@ember/debug").deprecate;
|
||||||
|
|
||||||
// Patch ember-global deprecation
|
// Patch ember-global deprecation
|
||||||
if (window.hasOwnProperty("Ember")) {
|
["Ember", "Em"].forEach((key) => {
|
||||||
Object.defineProperty(window, "Ember", {
|
if (window.hasOwnProperty(key)) {
|
||||||
|
Object.defineProperty(window, key, {
|
||||||
enumerable: true,
|
enumerable: true,
|
||||||
configurable: true,
|
configurable: true,
|
||||||
get() {
|
get() {
|
||||||
deprecate(
|
deprecate(
|
||||||
"Usage of the Ember Global is deprecated. You should import the Ember module or the specific API instead.",
|
`Usage of the ${key} Global is deprecated. You should import the Ember module or the specific API instead.`,
|
||||||
false,
|
false,
|
||||||
{
|
{
|
||||||
id: "ember-global",
|
id: "ember-global",
|
||||||
|
@ -60,6 +61,7 @@ define("discourse/lib/deprecate-shim", ["exports"], function (exports) {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Patch run.blah deprecations
|
// Patch run.blah deprecations
|
||||||
// https://github.com/emberjs/ember.js/blob/007fc9eba1/packages/%40ember/runloop/index.js#L748-L808
|
// https://github.com/emberjs/ember.js/blob/007fc9eba1/packages/%40ember/runloop/index.js#L748-L808
|
||||||
|
|
Loading…
Reference in New Issue