Added printer test for 'new (f().x)'.

This commit is contained in:
Daniel Rosenwasser
2017-09-14 14:00:12 -07:00
parent 166af8caf2
commit aa634ba7c0

View File

@@ -110,6 +110,19 @@ namespace ts {
createSourceFile("source.ts", "", ScriptTarget.ES2015)
));
printsCorrectly("newExpressionWithPropertyAccessOnCallExpression", {}, printer => printer.printNode(
EmitHint.Unspecified,
createNew(
createPropertyAccess(
createCall(
createIdentifier("f"), /*typeArguments*/ undefined, /*argumentsArray*/ undefined),
"x"),
/*typeArguments*/ undefined,
/*argumentsArray*/ undefined
),
createSourceFile("source.ts", "", ScriptTarget.ESNext))
);
// https://github.com/Microsoft/TypeScript/issues/15971
printsCorrectly("classWithOptionalMethodAndProperty", {}, printer => printer.printNode(
EmitHint.Unspecified,