Skip to content

Commit

Permalink
Clarify restArgs bit in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
unstubbable committed Nov 12, 2024
1 parent bdfa45d commit ba59bf6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit ba59bf6

Please sign in to comment.