From df8880a71a20e2d845934b2ab6e8515b3808eeb2 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 21 Jan 2015 11:52:59 -0500 Subject: [PATCH] FIX: (for IE9) if `console.log` doesn't exist, make it an noop. --- .../javascripts/discourse/initializers/ie9-hax.js.es6 | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 app/assets/javascripts/discourse/initializers/ie9-hax.js.es6 diff --git a/app/assets/javascripts/discourse/initializers/ie9-hax.js.es6 b/app/assets/javascripts/discourse/initializers/ie9-hax.js.es6 new file mode 100644 index 00000000000..4c124aac05b --- /dev/null +++ b/app/assets/javascripts/discourse/initializers/ie9-hax.js.es6 @@ -0,0 +1,10 @@ +export default { + name: 'ie9-hacks', + initialize: function() { + if (!window) { return; } + + // IE9 does not support a console object unless the developer tools are open + if (!window.console) { window.console = {}; } + if (!window.console.log) { window.console.log = Ember.K; } + } +};