From a715b953cb0e4e0b0f9aa2697d7f09507b0aa87e Mon Sep 17 00:00:00 2001 From: Keivan Beigi Date: Tue, 17 Sep 2013 10:34:39 -0700 Subject: [PATCH] moved console polyfills to polyfills.js --- UI/Instrumentation/ErrorHandler.js | 9 --------- UI/app.js | 3 +-- UI/index.html | 1 + UI/polyfills.js | 11 ++++++++++- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/UI/Instrumentation/ErrorHandler.js b/UI/Instrumentation/ErrorHandler.js index 7909dc5fb..475edc68f 100644 --- a/UI/Instrumentation/ErrorHandler.js +++ b/UI/Instrumentation/ErrorHandler.js @@ -1,14 +1,5 @@ 'use strict'; (function () { - - window.console = window.console || {}; - window.console.log = window.console.log || function(){}; - window.console.group = window.console.group || function(){}; - window.console.groupEnd = window.console.groupEnd || function(){}; - window.console.debug = window.console.debug || function(){}; - window.console.warn = window.console.warn || function(){}; - window.console.assert = window.console.assert || function(){}; - window.alert = function (message) { window.Messenger().post(message); }; diff --git a/UI/app.js b/UI/app.js index 280a16d39..73d8be5e5 100644 --- a/UI/app.js +++ b/UI/app.js @@ -36,8 +36,7 @@ require.config({ init: function () { require( [ - 'jQuery/ToTheTop', - 'Instrumentation/ErrorHandler' + 'jQuery/ToTheTop' ]); } diff --git a/UI/index.html b/UI/index.html index 5ffff693e..178c5beb2 100644 --- a/UI/index.html +++ b/UI/index.html @@ -63,6 +63,7 @@ + diff --git a/UI/polyfills.js b/UI/polyfills.js index 3e6797bf8..5bce992df 100644 --- a/UI/polyfills.js +++ b/UI/polyfills.js @@ -1,3 +1,12 @@ +window.console = window.console || {}; +window.console.log = window.console.log || function(){}; +window.console.group = window.console.group || function(){}; +window.console.groupEnd = window.console.groupEnd || function(){}; +window.console.debug = window.console.debug || function(){}; +window.console.warn = window.console.warn || function(){}; +window.console.assert = window.console.assert || function(){}; + + if (!String.prototype.startsWith) { Object.defineProperty(String.prototype, 'startsWith', { enumerable: false, @@ -29,4 +38,4 @@ if(!('contains' in String.prototype)) String.prototype.contains = function(str, startIndex) { return -1 !== String.prototype.indexOf.call(this, str, startIndex); }; -} \ No newline at end of file +}