Skip to content

Commit

Permalink
Refactor check for IE9 console.
Browse files Browse the repository at this point in the history
That way the additional IE9 checking code
will be stripped out in production.
  • Loading branch information
AlexKVal committed May 1, 2015
1 parent 615ef25 commit 274c9cb
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/utils/deprecationWarning.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
function warn(message) {
if (window.console && (typeof console.warn === 'function')) {
console.warn(message);
}
}

export default function deprecationWarning(oldname, newname, link) {
if (process.env.NODE_ENV !== 'production') {
if (!window.console && (typeof console.warn !== 'function')) {
return;
}

let message = `${oldname} is deprecated. Use ${newname} instead.`;
warn(message);
console.warn(message);

if (link) {
warn(`You can read more about it here ${link}`);
console.warn(`You can read more about it here ${link}`);
}
}
}

0 comments on commit 274c9cb

Please sign in to comment.