[Pkg-javascript-commits] [sockjs-client] 329/350: added fix for old browsers such as IE7/8 were console.log does not have an apply function. using try catch we are take care that everything works. tested on IE8.
tonnerre at ancient-solutions.com
tonnerre at ancient-solutions.com
Fri Aug 5 01:04:35 UTC 2016
This is an automated email from the git hooks/post-receive script.
tonnerre-guest pushed a commit to branch upstream
in repository sockjs-client.
commit 6703a8290b6ea1f903d1fe284351ce6793b21716
Author: Liam Bilich <syberkitten at gmail.com>
Date: Wed Dec 30 14:38:11 2015 +0200
added fix for old browsers such as IE7/8 were console.log
does not have an apply function.
using try catch we are take care that everything works.
tested on IE8.
---
lib/utils/log.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lib/utils/log.js b/lib/utils/log.js
index 4e73068..6888136 100644
--- a/lib/utils/log.js
+++ b/lib/utils/log.js
@@ -2,10 +2,15 @@
var logObject = {};
['log', 'debug', 'warn'].forEach(function (level) {
- var levelExists = global.console && global.console[level] && global.console[level].apply;
+ var levelExists;
+ try {
+ levelExists = global.console && global.console[level] && global.console[level].apply;
+ } catch(e){}
+
logObject[level] = levelExists ? function () {
return global.console[level].apply(global.console, arguments);
} : (level === 'log' ? function () {} : logObject.log);
+
});
module.exports = logObject;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git
More information about the Pkg-javascript-commits
mailing list