浏览代码

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 年之前
父节点
当前提交
466a2eba94
共有 1 个文件被更改,包括 1 次插入1 次删除
  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);
 };
 
 /**