浏览代码

chore(helpers.js): add console polyfill so we can trigger warnings reliably

Estevão Soares dos Santos 10 年之前
父节点
当前提交
678348d060
共有 1 个文件被更改,包括 16 次插入0 次删除
  1. 16 0
      src/helpers.js

+ 16 - 0
src/helpers.js

@@ -105,3 +105,19 @@ showdown.helper.escapeCharacters = function escapeCharacters(text, charsToEscape
 
   return text;
 };
+
+/**
+ * POLYFILLS
+ */
+if (showdown.helper.isUndefined(console)) {
+  console = {
+    warn: function (msg) {
+      'use strict';
+      alert(msg);
+    },
+    log: function (msg) {
+      'use strict';
+      alert(msg);
+    }
+  };
+}