File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ export function isAtLeastReact17(reactVersion: string): boolean {
1616 * Recurse through `error.cause` chain to set cause on an error.
1717 */
1818export function setCause ( error : Error & { cause ?: Error } , cause : Error ) : void {
19- const seenErrors = new WeakMap < Error , boolean > ( ) ;
19+ const seenErrors = new WeakSet ( ) ;
2020
2121 function recurse ( error : Error & { cause ?: Error } , cause : Error ) : void {
2222 // If we've already seen the error, there is a recursive loop somewhere in the error's
@@ -25,7 +25,7 @@ export function setCause(error: Error & { cause?: Error }, cause: Error): void {
2525 return ;
2626 }
2727 if ( error . cause ) {
28- seenErrors . set ( error , true ) ;
28+ seenErrors . add ( error ) ;
2929 return recurse ( error . cause , cause ) ;
3030 }
3131 error . cause = cause ;
You can’t perform that action at this time.
0 commit comments