@@ -2176,47 +2176,49 @@ namespace ts {
2176
2176
locked ?: boolean ;
2177
2177
}
2178
2178
2179
- export interface AfterFinallyFlow extends FlowNode , FlowLock {
2179
+ export interface AfterFinallyFlow extends FlowNodeBase , FlowLock {
2180
2180
antecedent : FlowNode ;
2181
2181
}
2182
2182
2183
- export interface PreFinallyFlow extends FlowNode {
2183
+ export interface PreFinallyFlow extends FlowNodeBase {
2184
2184
antecedent : FlowNode ;
2185
2185
lock : FlowLock ;
2186
2186
}
2187
2187
2188
- export interface FlowNode {
2188
+ export type FlowNode =
2189
+ | AfterFinallyFlow | PreFinallyFlow | FlowStart | FlowLabel | FlowAssignment | FlowCondition | FlowSwitchClause | FlowArrayMutation ;
2190
+ export interface FlowNodeBase {
2189
2191
flags : FlowFlags ;
2190
2192
id ?: number ; // Node id used by flow type cache in checker
2191
2193
}
2192
2194
2193
2195
// FlowStart represents the start of a control flow. For a function expression or arrow
2194
2196
// function, the container property references the function (which in turn has a flowNode
2195
2197
// property for the containing control flow).
2196
- export interface FlowStart extends FlowNode {
2198
+ export interface FlowStart extends FlowNodeBase {
2197
2199
container ?: FunctionExpression | ArrowFunction | MethodDeclaration ;
2198
2200
}
2199
2201
2200
2202
// FlowLabel represents a junction with multiple possible preceding control flows.
2201
- export interface FlowLabel extends FlowNode {
2203
+ export interface FlowLabel extends FlowNodeBase {
2202
2204
antecedents : FlowNode [ ] ;
2203
2205
}
2204
2206
2205
2207
// FlowAssignment represents a node that assigns a value to a narrowable reference,
2206
2208
// i.e. an identifier or a dotted name that starts with an identifier or 'this'.
2207
- export interface FlowAssignment extends FlowNode {
2209
+ export interface FlowAssignment extends FlowNodeBase {
2208
2210
node : Expression | VariableDeclaration | BindingElement ;
2209
2211
antecedent : FlowNode ;
2210
2212
}
2211
2213
2212
2214
// FlowCondition represents a condition that is known to be true or false at the
2213
2215
// node's location in the control flow.
2214
- export interface FlowCondition extends FlowNode {
2216
+ export interface FlowCondition extends FlowNodeBase {
2215
2217
expression : Expression ;
2216
2218
antecedent : FlowNode ;
2217
2219
}
2218
2220
2219
- export interface FlowSwitchClause extends FlowNode {
2221
+ export interface FlowSwitchClause extends FlowNodeBase {
2220
2222
switchStatement : SwitchStatement ;
2221
2223
clauseStart : number ; // Start index of case/default clause range
2222
2224
clauseEnd : number ; // End index of case/default clause range
@@ -2225,7 +2227,7 @@ namespace ts {
2225
2227
2226
2228
// FlowArrayMutation represents a node potentially mutates an array, i.e. an
2227
2229
// operation of the form 'x.push(value)', 'x.unshift(value)' or 'x[n] = value'.
2228
- export interface FlowArrayMutation extends FlowNode {
2230
+ export interface FlowArrayMutation extends FlowNodeBase {
2229
2231
node : CallExpression | BinaryExpression ;
2230
2232
antecedent : FlowNode ;
2231
2233
}
0 commit comments