Browse Source

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 8 years ago
parent
commit
466a2eba94
1 changed files with 1 additions and 1 deletions
  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);
 };
 
 /**