소스 검색

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);
 };
 
 /**