File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export const getFlowValidation = (
2828 // We ignore this in flow validation too because we might generate code for incomplete flows.
2929
3030 let nodeId : NodeFunction [ 'id' ] | undefined ;
31- let parameterIndex : number | undefined ;
31+ let parameterIndex : number | null = null ;
3232
3333 if ( d . start !== undefined ) {
3434 const fullText = sourceFile . getFullText ( ) ;
@@ -40,7 +40,7 @@ export const getFlowValidation = (
4040 const searchText = fullText . substring ( searchStart , searchEnd ) ;
4141
4242 // Find all @pos comments in the search range
43- const posRegex = / \/ \* @ p o s ( [ ^ ] + ) ( \d + ) \* \/ / g;
43+ const posRegex = / \/ \* @ p o s ( [ ^ ] + ) ( \d + | n u l l ) \* \/ / g;
4444 let match ;
4545 let closestMatch : RegExpExecArray | null = null ;
4646 let closestCommentEnd = - 1 ;
@@ -62,8 +62,8 @@ export const getFlowValidation = (
6262 }
6363
6464 if ( closestMatch ) {
65- nodeId = closestMatch [ 1 ] === "undefined " ? undefined : closestMatch [ 1 ] as NodeFunction [ 'id' ] ;
66- parameterIndex = parseInt ( closestMatch [ 2 ] , 10 ) ;
65+ nodeId = closestMatch [ 1 ] === "null " ? null : closestMatch [ 1 ] as NodeFunction [ 'id' ] ;
66+ parameterIndex = parseInt ( closestMatch [ 2 ] , 10 ) || null ;
6767 }
6868 }
6969
You can’t perform that action at this time.
0 commit comments