Explorar el Código

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

Estevão Soares dos Santos hace 10 años
padre
commit
678348d060
Se han modificado 1 ficheros con 16 adiciones y 0 borrados
  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);
+    }
+  };
+}