From ba59bf6569f3543c2f4f82fe9760ea181cd56179 Mon Sep 17 00:00:00 2001 From: Hendrik Liebau Date: Tue, 12 Nov 2024 17:51:58 +0100 Subject: [PATCH] Clarify `restArgs` bit in comments --- .../router-reducer/reducers/server-reference-info.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/next/src/client/components/router-reducer/reducers/server-reference-info.ts b/packages/next/src/client/components/router-reducer/reducers/server-reference-info.ts index c1cc4390e0aad9..894c87d7184bf8 100644 --- a/packages/next/src/client/components/router-reducer/reducers/server-reference-info.ts +++ b/packages/next/src/client/components/router-reducer/reducers/server-reference-info.ts @@ -19,7 +19,8 @@ export interface ServerReferenceInfo { * The `argMask` encodes whether the function uses the argument at the * respective position. * - * The `restArgs` bit indicates whether the function uses a rest parameter. + * The `restArgs` bit indicates whether the function uses a rest parameter. It's + * also set to 1 if the function has more than 6 args. * * @param id hex-encoded server reference ID */ @@ -65,6 +66,8 @@ export function omitUnusedArgs( for (let index = 0; index < args.length; index++) { if ( (index < 6 && info.usedArgs[index]) || + // This assumes that the server reference info byte has the restArgs bit + // set to 1 if there are more than 6 args. (index >= 6 && info.hasRestArgs) ) { filteredArgs[index] = args[index]