From fe4484d2e3c17ea5fa7897c01bfd97406fc2ac5a Mon Sep 17 00:00:00 2001 From: James Long Date: Sun, 8 Jan 2017 14:00:41 -0500 Subject: [PATCH] Update call/member expression chaining heuristic to account for NewExpression's --- src/printer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/printer.js b/src/printer.js index 441febd7..b3c5f506 100644 --- a/src/printer.js +++ b/src/printer.js @@ -650,7 +650,8 @@ function genericPrintNoParens(path, options, print) { const isChain = nodes.filter(n => { return n.call.arguments.length > 0 && (n.call.arguments[0].type === "FunctionExpression" || - n.call.arguments[0].type === "ArrowFunctionExpression"); + n.call.arguments[0].type === "ArrowFunctionExpression" || + n.call.arguments[0].type === "NewExpression"); }).length > 1; if(hasMultipleLookups) {