mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-29 09:44:41 +00:00
Make console.log check more robust; fixes IE8
This commit is contained in:
parent
77434e6086
commit
e780b0a958
1 changed files with 5 additions and 1 deletions
|
|
@ -11,8 +11,12 @@ fabric.log = function() { };
|
|||
fabric.warn = function() { };
|
||||
|
||||
if (typeof console !== 'undefined') {
|
||||
|
||||
['log', 'warn'].forEach(function(methodName) {
|
||||
if (typeof console[methodName] !== 'undefined' && console[methodName].apply) {
|
||||
|
||||
if (typeof console[methodName] !== 'undefined' &&
|
||||
typeof console[methodName].apply === 'function') {
|
||||
|
||||
fabric[methodName] = function() {
|
||||
return console[methodName].apply(console, arguments);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue