From 4292b609abeacfc4c3716052dd5d53e48ffe5e4b Mon Sep 17 00:00:00 2001 From: Will Eastcott Date: Sat, 30 May 2026 17:15:10 +0100 Subject: [PATCH] docs: fix @param names/types that contradict the function signatures Four JSDoc `@param` blocks documented names (and in two cases types) that did not match the actual parameters, surfaced by enabling jsdoc/check-param-names (currently off in the shared config): - `Morph._createTexture` documented `levels` before `arrayLength`, but the signature is `(name, format, arrayLength, levels)` - so the emitted types were swapped (`arrayLength` as `{Array}`, `levels` as `{number}`). Reordered to match. - `XrViews.update` documented `xrView` (`{XRView}`); the parameter is `xrViews` and is iterated as an array, so corrected to `{XRView[]} xrViews`. - `WebgpuXrBridge.getFramebufferSize` / `getViewport` documented `frame`; the parameter is the intentionally-unused `_frame`. Matched the docs to it. Verified: jsdoc/check-param-names reports 0 mismatches, lint clean, build:types/test:types pass. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/framework/xr/xr-views.js | 2 +- src/platform/graphics/webgpu/webgpu-xr-bridge.js | 4 ++-- src/scene/morph.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/framework/xr/xr-views.js b/src/framework/xr/xr-views.js index 011590fd4b1..c0aa299e805 100644 --- a/src/framework/xr/xr-views.js +++ b/src/framework/xr/xr-views.js @@ -212,7 +212,7 @@ class XrViews extends EventHandler { /** * @param {XRFrame} frame - XRFrame from requestAnimationFrame callback. - * @param {XRView} xrView - XRView from WebXR API. + * @param {XRView[]} xrViews - XRViews from the WebXR API. * @ignore */ update(frame, xrViews) { diff --git a/src/platform/graphics/webgpu/webgpu-xr-bridge.js b/src/platform/graphics/webgpu/webgpu-xr-bridge.js index 69bf47943fc..5d171020b26 100644 --- a/src/platform/graphics/webgpu/webgpu-xr-bridge.js +++ b/src/platform/graphics/webgpu/webgpu-xr-bridge.js @@ -139,7 +139,7 @@ class WebgpuXrBridge { } /** - * @param {XRFrame} frame - Current XR frame. + * @param {XRFrame} _frame - Current XR frame. * @param {Vec2} out - Width in {@link Vec2#x}, height in {@link Vec2#y}. */ getFramebufferSize(_frame, out) { @@ -160,7 +160,7 @@ class WebgpuXrBridge { } /** - * @param {XRFrame} frame - Current XR frame. + * @param {XRFrame} _frame - Current XR frame. * @param {XRView} xrView - WebXR view. * @returns {XRViewport} Viewport for this view, or zeros if unavailable. */ diff --git a/src/scene/morph.js b/src/scene/morph.js index 804ccd7b4ee..ba41e56f5e8 100644 --- a/src/scene/morph.js +++ b/src/scene/morph.js @@ -283,8 +283,8 @@ class Morph extends RefCountedObject { * * @param {string} name - The name of the texture. * @param {number} format - The format of the texture. - * @param {Array} [levels] - The levels of the texture. * @param {number} [arrayLength] - The length of the texture array. + * @param {Array} [levels] - The levels of the texture. * @returns {Texture} The created texture. * @private */