Explorar o código

fix(helper.isArray): replace a.constructor === Array with Array.isArray

a.constructor === Array is always falsey when you run showdown within Node's VM API.

Related to https://github.com/nodejs/node/issues/7351

Closes #425
Jason Mitchell %!s(int64=8) %!d(string=hai) anos
pai
achega
466a2eba94
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/helpers.js

+ 1 - 1
src/helpers.js

@@ -37,7 +37,7 @@ showdown.helper.isFunction = function (a) {
  */
 showdown.helper.isArray = function (a) {
   'use strict';
-  return a.constructor === Array;
+  return Array.isArray(a);
 };
 
 /**