@@ -1058,7 +1058,7 @@ namespace ts {
1058
1058
: node ;
1059
1059
}
1060
1060
1061
- export function createTaggedTemplate ( tag : Expression , template : TemplateLiteral ) : TaggedTemplateExpression ;
1061
+ /** @deprecated */ export function createTaggedTemplate ( tag : Expression , template : TemplateLiteral ) : TaggedTemplateExpression ;
1062
1062
export function createTaggedTemplate ( tag : Expression , typeArguments : ReadonlyArray < TypeNode > | undefined , template : TemplateLiteral ) : TaggedTemplateExpression ;
1063
1063
/** @internal */
1064
1064
export function createTaggedTemplate ( tag : Expression , typeArgumentsOrTemplate : ReadonlyArray < TypeNode > | TemplateLiteral | undefined , template ?: TemplateLiteral ) : TaggedTemplateExpression ;
@@ -1076,7 +1076,7 @@ namespace ts {
1076
1076
return node ;
1077
1077
}
1078
1078
1079
- export function updateTaggedTemplate ( node : TaggedTemplateExpression , tag : Expression , template : TemplateLiteral ) : TaggedTemplateExpression ;
1079
+ /** @deprecated */ export function updateTaggedTemplate ( node : TaggedTemplateExpression , tag : Expression , template : TemplateLiteral ) : TaggedTemplateExpression ;
1080
1080
export function updateTaggedTemplate ( node : TaggedTemplateExpression , tag : Expression , typeArguments : ReadonlyArray < TypeNode > | undefined , template : TemplateLiteral ) : TaggedTemplateExpression ;
1081
1081
export function updateTaggedTemplate ( node : TaggedTemplateExpression , tag : Expression , typeArgumentsOrTemplate : ReadonlyArray < TypeNode > | TemplateLiteral | undefined , template ?: TemplateLiteral ) {
1082
1082
return node . tag !== tag
@@ -1168,43 +1168,15 @@ namespace ts {
1168
1168
node . body = parenthesizeConciseBody ( body ) ;
1169
1169
return node ;
1170
1170
}
1171
-
1172
- /** @deprecated */ export function updateArrowFunction (
1173
- node : ArrowFunction ,
1174
- modifiers : ReadonlyArray < Modifier > | undefined ,
1175
- typeParameters : ReadonlyArray < TypeParameterDeclaration > | undefined ,
1176
- parameters : ReadonlyArray < ParameterDeclaration > ,
1177
- type : TypeNode | undefined ,
1178
- body : ConciseBody ) : ArrowFunction ;
1179
1171
export function updateArrowFunction (
1180
1172
node : ArrowFunction ,
1181
1173
modifiers : ReadonlyArray < Modifier > | undefined ,
1182
1174
typeParameters : ReadonlyArray < TypeParameterDeclaration > | undefined ,
1183
1175
parameters : ReadonlyArray < ParameterDeclaration > ,
1184
1176
type : TypeNode | undefined ,
1185
1177
equalsGreaterThanToken : Token < SyntaxKind . EqualsGreaterThanToken > ,
1186
- body : ConciseBody ) : ArrowFunction ;
1187
- export function updateArrowFunction (
1188
- node : ArrowFunction ,
1189
- modifiers : ReadonlyArray < Modifier > | undefined ,
1190
- typeParameters : ReadonlyArray < TypeParameterDeclaration > | undefined ,
1191
- parameters : ReadonlyArray < ParameterDeclaration > ,
1192
- type : TypeNode | undefined ,
1193
- equalsGreaterThanTokenOrBody : Token < SyntaxKind . EqualsGreaterThanToken > | ConciseBody ,
1194
- bodyOrUndefined ?: ConciseBody ,
1178
+ body : ConciseBody
1195
1179
) : ArrowFunction {
1196
- let equalsGreaterThanToken : Token < SyntaxKind . EqualsGreaterThanToken > ;
1197
- let body : ConciseBody ;
1198
- if ( bodyOrUndefined === undefined ) {
1199
- equalsGreaterThanToken = node . equalsGreaterThanToken ;
1200
- body = cast ( equalsGreaterThanTokenOrBody , isConciseBody ) ;
1201
- }
1202
- else {
1203
- equalsGreaterThanToken = cast ( equalsGreaterThanTokenOrBody , ( n ) : n is Token < SyntaxKind . EqualsGreaterThanToken > =>
1204
- n . kind === SyntaxKind . EqualsGreaterThanToken ) ;
1205
- body = bodyOrUndefined ;
1206
- }
1207
-
1208
1180
return node . modifiers !== modifiers
1209
1181
|| node . typeParameters !== typeParameters
1210
1182
|| node . parameters !== parameters
@@ -1306,7 +1278,7 @@ namespace ts {
1306
1278
: node ;
1307
1279
}
1308
1280
1309
- export function createConditional ( condition : Expression , whenTrue : Expression , whenFalse : Expression ) : ConditionalExpression ;
1281
+ /** @deprecated */ export function createConditional ( condition : Expression , whenTrue : Expression , whenFalse : Expression ) : ConditionalExpression ;
1310
1282
export function createConditional ( condition : Expression , questionToken : QuestionToken , whenTrue : Expression , colonToken : ColonToken , whenFalse : Expression ) : ConditionalExpression ;
1311
1283
export function createConditional ( condition : Expression , questionTokenOrWhenTrue : QuestionToken | Expression , whenTrueOrWhenFalse : Expression , colonToken ?: ColonToken , whenFalse ?: Expression ) {
1312
1284
const node = < ConditionalExpression > createSynthesizedNode ( SyntaxKind . ConditionalExpression ) ;
@@ -1317,26 +1289,14 @@ namespace ts {
1317
1289
node . whenFalse = parenthesizeSubexpressionOfConditionalExpression ( whenFalse ? whenFalse : whenTrueOrWhenFalse ) ;
1318
1290
return node ;
1319
1291
}
1320
-
1321
- /** @deprecated */ export function updateConditional (
1322
- node : ConditionalExpression ,
1323
- condition : Expression ,
1324
- whenTrue : Expression ,
1325
- whenFalse : Expression ) : ConditionalExpression ;
1326
1292
export function updateConditional (
1327
1293
node : ConditionalExpression ,
1328
1294
condition : Expression ,
1329
1295
questionToken : Token < SyntaxKind . QuestionToken > ,
1330
1296
whenTrue : Expression ,
1331
1297
colonToken : Token < SyntaxKind . ColonToken > ,
1332
- whenFalse : Expression ) : ConditionalExpression ;
1333
- export function updateConditional ( node : ConditionalExpression , condition : Expression , ...args : any [ ] ) {
1334
- if ( args . length === 2 ) {
1335
- const [ whenTrue , whenFalse ] = args ;
1336
- return updateConditional ( node , condition , node . questionToken , whenTrue , node . colonToken , whenFalse ) ;
1337
- }
1338
- Debug . assert ( args . length === 4 ) ;
1339
- const [ questionToken , whenTrue , colonToken , whenFalse ] = args ;
1298
+ whenFalse : Expression
1299
+ ) : ConditionalExpression {
1340
1300
return node . condition !== condition
1341
1301
|| node . questionToken !== questionToken
1342
1302
|| node . whenTrue !== whenTrue
@@ -2231,7 +2191,7 @@ namespace ts {
2231
2191
export function createJsxSelfClosingElement ( tagName : JsxTagNameExpression , typeArguments : ReadonlyArray < TypeNode > | undefined , attributes : JsxAttributes ) {
2232
2192
const node = < JsxSelfClosingElement > createSynthesizedNode ( SyntaxKind . JsxSelfClosingElement ) ;
2233
2193
node . tagName = tagName ;
2234
- node . typeArguments = typeArguments && createNodeArray ( typeArguments ) ;
2194
+ node . typeArguments = asNodeArray ( typeArguments ) ;
2235
2195
node . attributes = attributes ;
2236
2196
return node ;
2237
2197
}
@@ -2247,7 +2207,7 @@ namespace ts {
2247
2207
export function createJsxOpeningElement ( tagName : JsxTagNameExpression , typeArguments : ReadonlyArray < TypeNode > | undefined , attributes : JsxAttributes ) {
2248
2208
const node = < JsxOpeningElement > createSynthesizedNode ( SyntaxKind . JsxOpeningElement ) ;
2249
2209
node . tagName = tagName ;
2250
- node . typeArguments = typeArguments && createNodeArray ( typeArguments ) ;
2210
+ node . typeArguments = asNodeArray ( typeArguments ) ;
2251
2211
node . attributes = attributes ;
2252
2212
return node ;
2253
2213
}
0 commit comments