From 559db43e5f47bb8691859cd0427a138caba71de2 Mon Sep 17 00:00:00 2001 From: Daniel Brain Date: Wed, 20 Jul 2016 14:19:25 -0700 Subject: [PATCH] Patch window.console for IE9 --- src/lib/log.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/log.js b/src/lib/log.js index 52574ec0..38beaac6 100644 --- a/src/lib/log.js +++ b/src/lib/log.js @@ -4,6 +4,12 @@ import { CONFIG } from '../conf'; const LOG_LEVELS = ['debug', 'info', 'warn', 'error']; +if (Function.prototype.bind && window.console && typeof console.log === 'object') { + [ 'log', 'info', 'warn', 'error' ].forEach(function(method) { + console[method] = this.bind(console[method], console); + }, Function.prototype.call); +} + export let log = { clearLogs() {