Jelajahi Sumber

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

Estevão Soares dos Santos 10 tahun lalu
induk
melakukan
678348d060
1 mengubah file dengan 16 tambahan dan 0 penghapusan
  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);
+    }
+  };
+}