Skip to content

Commit f995212

Browse files
committed
[IE9] Check for console before using console.warn
1 parent 5ed7b0e commit f995212

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/utils/deprecationWarning.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
function warn(message) {
2+
if (window.console && (typeof console.warn === 'function')) {
3+
console.warn(message);
4+
}
5+
}
6+
17
export default function deprecationWarning(oldname, newname, link) {
28
if (process.env.NODE_ENV !== 'production') {
39
let message = `${oldname} is deprecated. Use ${newname} instead.`;
4-
console.warn(message);
10+
warn(message);
511

612
if (link) {
7-
console.warn(`You can read more about it here ${link}`);
13+
warn(`You can read more about it here ${link}`);
814
}
915
}
1016
}

0 commit comments

Comments
 (0)