docs: store parent type reference in documentation.js (#32215)
This commit is contained in:
parent
faf4853259
commit
74f5ce5489
|
|
@ -353,6 +353,8 @@ class Member {
|
||||||
this.clazz = null;
|
this.clazz = null;
|
||||||
/** @type {Member=} */
|
/** @type {Member=} */
|
||||||
this.enclosingMethod = undefined;
|
this.enclosingMethod = undefined;
|
||||||
|
/** @type {Member=} */
|
||||||
|
this.parent = undefined;
|
||||||
this.async = false;
|
this.async = false;
|
||||||
this.alias = name;
|
this.alias = name;
|
||||||
this.overloadIndex = 0;
|
this.overloadIndex = 0;
|
||||||
|
|
@ -372,10 +374,11 @@ class Member {
|
||||||
this.args = new Map();
|
this.args = new Map();
|
||||||
if (this.kind === 'method')
|
if (this.kind === 'method')
|
||||||
this.enclosingMethod = this;
|
this.enclosingMethod = this;
|
||||||
const indexType = type => {
|
const indexArg = (/** @type {Member} */ arg) => {
|
||||||
type.deepProperties().forEach(p => {
|
arg.type?.deepProperties().forEach(p => {
|
||||||
p.enclosingMethod = this;
|
p.enclosingMethod = this;
|
||||||
indexType(p.type);
|
p.parent = arg;
|
||||||
|
indexArg(p);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
for (const arg of this.argsArray) {
|
for (const arg of this.argsArray) {
|
||||||
|
|
@ -385,7 +388,7 @@ class Member {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
arg.type.properties.sort((p1, p2) => p1.name.localeCompare(p2.name));
|
arg.type.properties.sort((p1, p2) => p1.name.localeCompare(p2.name));
|
||||||
}
|
}
|
||||||
indexType(arg.type);
|
indexArg(arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue