mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Add a test case for conditional expressions just in case.
This commit is contained in:
@@ -123,6 +123,19 @@ namespace ts {
|
||||
createSourceFile("source.ts", "", ScriptTarget.ESNext))
|
||||
);
|
||||
|
||||
printsCorrectly("newExpressionOnConditionalExpression", {}, printer => printer.printNode(
|
||||
EmitHint.Unspecified,
|
||||
createNew(
|
||||
createConditional(
|
||||
createIdentifier("x"), createToken(SyntaxKind.QuestionToken),
|
||||
createIdentifier("y"), createToken(SyntaxKind.ColonToken),
|
||||
createIdentifier("z")),
|
||||
/*typeArguments*/ undefined,
|
||||
/*argumentsArray*/ undefined
|
||||
),
|
||||
createSourceFile("source.ts", "", ScriptTarget.ESNext))
|
||||
);
|
||||
|
||||
// https://github.com/Microsoft/TypeScript/issues/15971
|
||||
printsCorrectly("classWithOptionalMethodAndProperty", {}, printer => printer.printNode(
|
||||
EmitHint.Unspecified,
|
||||
|
||||
Reference in New Issue
Block a user