From 6da519637cf34f0b5adb4dd9560a168a794f496e Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Fri, 25 Aug 2017 14:02:42 -0700 Subject: [PATCH] Replace a.constructor === Array with Array.isArray(a) Reason being a.constructor === Array is always falsey when you run showdown within Node's VM API. Related to https://github.com/nodejs/node/issues/7351 --- src/helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers.js b/src/helpers.js index d0cdae0d..c72be004 100644 --- a/src/helpers.js +++ b/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); }; /**