Skip to content

Commit 274c9cb

Browse files
committed
Refactor check for IE9 console.
That way the additional IE9 checking code will be stripped out in production.
1 parent 615ef25 commit 274c9cb

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/utils/deprecationWarning.js

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

1210
if (link) {
13-
warn(`You can read more about it here ${link}`);
11+
console.warn(`You can read more about it here ${link}`);
1412
}
1513
}
1614
}

0 commit comments

Comments
 (0)