Ver código fonte

fix(IE8): fix for IE8 error on using isUndefined function

Using isUndefined on console object in IE8 will throw an error.
This reverts to using `typeof console === 'undefined'.

Closes #280
Estevao Soares dos Santos 8 anos atrás
pai
commit
561dc5f155
5 arquivos alterados com 4 adições e 2 exclusões
  1. 2 1
      dist/showdown.js
  2. 0 0
      dist/showdown.js.map
  3. 0 0
      dist/showdown.min.js
  4. 0 0
      dist/showdown.min.js.map
  5. 2 1
      src/helpers.js

+ 2 - 1
dist/showdown.js

@@ -716,7 +716,8 @@ showdown.helper.replaceRecursiveRegExp = function (str, replacement, left, right
 /**
  * POLYFILLS
  */
-if (showdown.helper.isUndefined(console)) {
+// use this instead of builtin is undefined for IE8 compatibility
+if (typeof(console) === 'undefined') {
   console = {
     warn: function (msg) {
       'use strict';

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
dist/showdown.js.map


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
dist/showdown.min.js


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
dist/showdown.min.js.map


+ 2 - 1
src/helpers.js

@@ -254,7 +254,8 @@ showdown.helper.replaceRecursiveRegExp = function (str, replacement, left, right
 /**
  * POLYFILLS
  */
-if (showdown.helper.isUndefined(console)) {
+// use this instead of builtin is undefined for IE8 compatibility
+if (typeof(console) === 'undefined') {
   console = {
     warn: function (msg) {
       'use strict';

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff