From b1a7c15eade0c0467a29744745b2431720e0ac6f Mon Sep 17 00:00:00 2001 From: Adam Gastineau Date: Tue, 4 Feb 2025 05:19:41 -0800 Subject: [PATCH] Prevent insertion of duplicate instances --- utils/doclint/api_parser.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/utils/doclint/api_parser.js b/utils/doclint/api_parser.js index cdc413de20..2a730b67c2 100644 --- a/utils/doclint/api_parser.js +++ b/utils/doclint/api_parser.js @@ -173,11 +173,12 @@ class ApiParser { if (!name) throw new Error('Invalid member name ' + spec.text); if (match[1] === 'param') { - const arg = this.parseProperty(spec, match[2]); - if (!arg) - return; - arg.name = name; for (const method of methods) { + // Purposefully create separate instances of the same option for each method + const arg = this.parseProperty(spec, match[2]); + if (!arg) + continue; + arg.name = name; const existingArg = method.argsArray.find(m => m.name === arg.name); if (existingArg && isTypeOverride(existingArg, arg)) { if (!arg.langs || !arg.langs.only) @@ -193,9 +194,10 @@ class ApiParser { } else { // match[1] === 'option' for (const method of methods) { + // Purposefully create separate instances of the same option for each method const p = this.parseProperty(spec, match[2]); if (!p) - return; + continue; let options = method.argsArray.find(o => o.name === 'options'); if (!options) { const type = new docs.Type('Object', []);