FIX: Allow deprecation to work with Ember CLI

This commit is contained in:
Robin Ward 2020-05-20 12:05:41 -04:00
parent 8851b79472
commit 3062036f2f

View File

@ -273,12 +273,17 @@ export function addNavItem(item) {
NavItem.extraNavItemDescriptors.push(item);
}
Object.defineProperty(Discourse, "NavItem", {
get() {
deprecated("Import the NavItem class instead of using Discourse.NavItem", {
since: "2.4.0",
dropFrom: "2.5.0"
});
return NavItem;
}
});
if (typeof Discourse !== "undefined") {
Object.defineProperty(Discourse, "NavItem", {
get() {
deprecated(
"Import the NavItem class instead of using Discourse.NavItem",
{
since: "2.4.0",
dropFrom: "2.5.0"
}
);
return NavItem;
}
});
}