Skip to content

Commit 8893d15

Browse files
yaacovCRbenjie
andcommitted
review feedback to avoid recursion
Co-authored-by: Benjie <[email protected]>
1 parent 5c2864c commit 8893d15

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/execution/execute.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -627,15 +627,16 @@ function handleFieldError(
627627

628628
function hasNulledPosition(
629629
errorPositions: Set<Path | undefined>,
630-
path: Path | undefined,
630+
startPath: Path | undefined,
631631
): boolean {
632-
if (errorPositions.has(path)) {
633-
return true;
634-
}
635-
if (path === undefined) {
636-
return false;
632+
let path = startPath;
633+
while (path !== undefined) {
634+
if (errorPositions.has(path)) {
635+
return true;
636+
}
637+
path = path.prev;
637638
}
638-
return hasNulledPosition(errorPositions, path.prev);
639+
return errorPositions.has(undefined);
639640
}
640641

641642
/**

0 commit comments

Comments
 (0)