Commit 75301d28 authored by JC Brand's avatar JC Brand

Bugfix. `info called on object that doesn't implement interface Console`

parent 016bca74
......@@ -120,11 +120,11 @@
if (message instanceof Error) {
message = message.stack;
}
const logger = _.assignIn({
'debug': console.log || _.noop,
'error': console.log || _.noop,
'info': console.log || _.noop,
'warn': console.log || _.noop,
const logger = _.assign({
'debug': _.get(console, 'log') ? console.log.bind(console) : _.noop,
'error': _.get(console, 'log') ? console.log.bind(console) : _.noop,
'info': _.get(console, 'log') ? console.log.bind(console) : _.noop,
'warn': _.get(console, 'log') ? console.log.bind(console) : _.noop
}, console);
if (level === Strophe.LogLevel.ERROR) {
if (_converse.debug) {
......@@ -1658,7 +1658,7 @@
this.connection.restore(this.jid, this.onConnectStatusChanged);
return true;
} catch (e) {
this.log(
_converse.log(
"Could not restore session for jid: "+
this.jid+" Error message: "+e.message);
this.clearSession(); // If there's a roster, we want to clear it (see #555)
......
......@@ -33,11 +33,11 @@
const URL_REGEX = /\b(https?:\/\/|www\.|https?:\/\/www\.)[^\s<>]{2,200}\b/g;
const logger = _.assignIn({
'debug': console.log || _.noop,
'error': console.log || _.noop,
'info': console.log || _.noop,
'warn': console.log || _.noop,
const logger = _.assign({
'debug': _.get(console, 'log') ? console.log.bind(console) : _.noop,
'error': _.get(console, 'log') ? console.log.bind(console) : _.noop,
'info': _.get(console, 'log') ? console.log.bind(console) : _.noop,
'warn': _.get(console, 'log') ? console.log.bind(console) : _.noop
}, console);
var afterAnimationEnd = function (el, callback) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment