From 88b91b1073939b978e36852e87d5969a44ad5bbd Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Thu, 30 Jun 2016 23:39:22 -0400 Subject: [PATCH] ospec: display brackets in errors about arrays --- ospec/ospec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ospec/ospec.js b/ospec/ospec.js index b0a61e55..f0491bbd 100644 --- a/ospec/ospec.js +++ b/ospec/ospec.js @@ -178,7 +178,7 @@ module.exports = new function init() { results.push(result) } function serialize(value) { - if (value === null || typeof value === "object" || typeof value === "number") return String(value) + if (value === null || (typeof value === "object" && !(value instanceof Array)) || typeof value === "number") return String(value) else if (typeof value === "function") return value.name || "" try {return JSON.stringify(value)} catch (e) {return String(value)} }