docs(packages/codegen): complete @param lists in partly documented JSDoc comments (#27600)

Comments-only change.

Where a JSDoc comment documented some of a function's parameters but not all, add the missing `@param`s, in parameter order.
This commit is contained in:
overlookmotel committed 2026-10-12 17:10:52 +00:00
1 parent 4bb972213c
commit 5ee0fc9758
5 files changed
+12

No files matched your search

@@ -83,6 +83,8 @@ import type * as ESTree from "../../../../npm/oxc-types/types.d.ts";
* Parens are not preserved from the input - every printer re-derives its own from `precedence`,
* so a `ParenthesizedExpression` mostly prints straight through.
*
* @param node - Expression
* @param state - Printer state
* @param precedence - Precedence of the position this expression sits in.
* A printer compares its own precedence against it and parenthesizes itself when it would otherwise bind too loosely.
* @param ctx - `CTX_FORBID_IN` / `CTX_FORBID_CALL` flags describing the enclosing position, so that an `in` operator
@@ -648,6 +650,9 @@ function printArrayExpression(node: ESTree.ArrayExpression, state: State): void
* Wraps from `PREC_ASSIGN` upwards. An object destructuring target forces parens as well at the start of
* a statement or a concise arrow body, where the leading `{` would be read as a block.
*
* @param node - Assignment expression
* @param state - Printer state
* @param precedence - Precedence of the position this expression sits in
* @param ctx - Handed to the right operand unchanged, so a `for` head's `CTX_FORBID_IN`
* still reaches an `in` operator there.
*/
+1
View File
@@ -26,6 +26,7 @@ import type * as ESTree from "../../../../npm/oxc-types/types.d.ts";
*
* The result is an object so that further outputs (a source map) can be added without a breaking change.
*
* @param node - AST node to print, a `Program` or a single statement
* @param state - Created by the entry point, so that all 4 builds share one class and so one object shape
* @param options - The same options `state` was created from, for the parts only this build acts on
* @returns Object holding the generated code
+2
View File
@@ -189,6 +189,8 @@ function printExponent(state: State, formatted: string, exponentIndex: number):
* `BigInt` rather than `value.toString(16)`, whose result the specification leaves implementation-approximated
* for every radix but 10, where the output here has to be exact.
*
* @param state - Printer state
* @param value - Number to print
* @param length - Length of the shortest text found for `value` so far
*/
function printHexIfShorter(state: State, value: number, length: number): boolean {
+2
View File
@@ -80,6 +80,7 @@ if (DEBUG) {
* An operator category in `last` proves that operator was the immediately preceding token,
* because every write replaces `last`, so no position has to be recorded alongside it.
*
* @param state - Printer state
* @param next - Category of the operator about to be written
*/
export function printSpaceBeforeOperator(state: State, next: Category): void {
@@ -106,6 +107,7 @@ export function printSpaceBeforeOperator(state: State, next: Category): void {
* asymmetry is the Rust original's, where it is live in minified mode - unpadded `(x++)+y` must
* print `x+++y` with no space, while unary `+ +y` must keep one.)
*
* @param state - Printer state
* @param prev - Category of the operator written last
* @param next - Category of the operator about to be written
*/
@@ -354,6 +354,8 @@ function printExpressionStatement(node: ESTree.ExpressionStatement, state: State
* Shared by the standalone declaration and the `for` and `for-in` heads, which is why it writes no
* indent and no terminator - the caller supplies both.
*
* @param node - Variable declaration
* @param state - Printer state
* @param ctx - Passed to every initializer, so a `for` head can hand down `CTX_FORBID_IN` and stop an
* `in` operator there being read as the head's own.
*/