Remove duplication in log.js

This commit is contained in:
kangax 2013-11-10 15:15:31 +01:00
parent 34c42b6ffc
commit 987f165790
6 changed files with 62 additions and 70 deletions

View file

@ -144,7 +144,6 @@ var filesToInclude = [
ifSpecifiedDependencyInclude('serialization', 'json', 'lib/json2.js'),
ifSpecifiedInclude('gestures', 'lib/event.js'),
'src/log.js',
'src/mixins/observable.mixin.js',
'src/mixins/collection.mixin.js',
@ -159,6 +158,8 @@ var filesToInclude = [
'src/util/dom_misc.js',
'src/util/dom_request.js',
'src/log.js',
ifSpecifiedInclude('animation', 'src/util/animate.js'),
//'src/util/animate.js',
ifSpecifiedInclude('easing', 'src/util/anim_ease.js'),

49
dist/all.js vendored
View file

@ -1756,32 +1756,6 @@ if (!JSON) {
}
}());
/**
* Wrapper around `console.log` (when available)
* @param {Any} values Values to log
*/
fabric.log = function() { };
/**
* Wrapper around `console.warn` (when available)
* @param {Any} Values to log as a warning
*/
fabric.warn = function() { };
if (typeof console !== 'undefined') {
if (typeof console.log !== 'undefined' && console.log.apply) {
fabric.log = function() {
return console.log.apply(console, arguments);
};
}
if (typeof console.warn !== 'undefined' && console.warn.apply) {
fabric.warn = function() {
return console.warn.apply(console, arguments);
};
}
}
(function(){
/**
@ -3773,6 +3747,29 @@ fabric.util.string = {
})();
/**
* Wrapper around `console.log` (when available)
* @param {Any} values Values to log
*/
fabric.log = function() { };
/**
* Wrapper around `console.warn` (when available)
* @param {Any} Values to log as a warning
*/
fabric.warn = function() { };
if (typeof console !== 'undefined') {
['log', 'warn'].forEach(function(methodName) {
if (typeof console[methodName] !== 'undefined' && console[methodName].apply) {
fabric[methodName] = function() {
return console[methodName].apply(console, arguments);
};
}
});
}
(function() {
/**

14
dist/all.min.js vendored

File diff suppressed because one or more lines are too long

BIN
dist/all.min.js.gz vendored

Binary file not shown.

49
dist/all.require.js vendored
View file

@ -1756,32 +1756,6 @@ if (!JSON) {
}
}());
/**
* Wrapper around `console.log` (when available)
* @param {Any} values Values to log
*/
fabric.log = function() { };
/**
* Wrapper around `console.warn` (when available)
* @param {Any} Values to log as a warning
*/
fabric.warn = function() { };
if (typeof console !== 'undefined') {
if (typeof console.log !== 'undefined' && console.log.apply) {
fabric.log = function() {
return console.log.apply(console, arguments);
};
}
if (typeof console.warn !== 'undefined' && console.warn.apply) {
fabric.warn = function() {
return console.warn.apply(console, arguments);
};
}
}
(function(){
/**
@ -3773,6 +3747,29 @@ fabric.util.string = {
})();
/**
* Wrapper around `console.log` (when available)
* @param {Any} values Values to log
*/
fabric.log = function() { };
/**
* Wrapper around `console.warn` (when available)
* @param {Any} Values to log as a warning
*/
fabric.warn = function() { };
if (typeof console !== 'undefined') {
['log', 'warn'].forEach(function(methodName) {
if (typeof console[methodName] !== 'undefined' && console[methodName].apply) {
fabric[methodName] = function() {
return console[methodName].apply(console, arguments);
};
}
});
}
(function() {
/**

View file

@ -11,14 +11,11 @@ fabric.log = function() { };
fabric.warn = function() { };
if (typeof console !== 'undefined') {
if (typeof console.log !== 'undefined' && console.log.apply) {
fabric.log = function() {
return console.log.apply(console, arguments);
};
}
if (typeof console.warn !== 'undefined' && console.warn.apply) {
fabric.warn = function() {
return console.warn.apply(console, arguments);
};
}
['log', 'warn'].forEach(function(methodName) {
if (typeof console[methodName] !== 'undefined' && console[methodName].apply) {
fabric[methodName] = function() {
return console[methodName].apply(console, arguments);
};
}
});
}