Переглянути джерело

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);
+    }
+  };
+}