[FIX] Even IE9 only exposes console object when the debug window is opened

bzr revid: fme@openerp.com-20121114125715-wgr0wxb91dvccuag
This commit is contained in:
Fabien Meghazi 2012-11-14 13:57:15 +01:00
parent a36748ebe4
commit 3f0f60faa9
1 changed files with 7 additions and 4 deletions

View File

@ -3,10 +3,13 @@
*--------------------------------------------------------*/
var console;
if (!console) {
console = {log: function () {}};
}
if (!console.debug) {
console.debug = console.log;
// Even IE9 only exposes console object if debug window opened
console = {};
('log error debug info warn assert clear dir dirxml trace group'
+ ' groupCollapsed groupEnd time timeEnd profile profileEnd count'
+ ' exception').split(/\s+/).forEach(function(property) {
console[property] = _.identity;
});
}
openerp.web.coresetup = function(instance) {