diff --git a/lib/output.js b/lib/output.js index cd6a12045..05d3e620b 100644 --- a/lib/output.js +++ b/lib/output.js @@ -1098,7 +1098,8 @@ function OutputStream(options) { var p = output.parent(); if (this.args.length === 0 && (p instanceof AST_PropAccess // (new Date).getTime(), (new Date)["getTime"]() - || p instanceof AST_Call && p.expression === this)) // (new foo)(bar) + || p instanceof AST_Call && p.expression === this + || p instanceof AST_PrefixedTemplateString && p.prefix === this)) // (new foo)(bar) return true; }); diff --git a/test/compress/template-string.js b/test/compress/template-string.js index a43e1668e..61e9079c1 100644 --- a/test/compress/template-string.js +++ b/test/compress/template-string.js @@ -940,3 +940,10 @@ special_chars_in_string: { var template=`foo \`;\n\`\${any} ${any} bar`; } } + +template_string_new_parens: { + input: { + new Thing()`` + } + expect_exact: "(new Thing)``;" +}