mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
docs: fix nested union handling (#5341)
This commit is contained in:
parent
983e04374a
commit
a1b3164864
@ -734,7 +734,7 @@ to pass. This method throws when the element is detached while waiting, unless w
|
||||
If the element does not satisfy the condition for the [`option: timeout`] milliseconds, this method will throw.
|
||||
|
||||
### param: ElementHandle.waitForElementState.state
|
||||
- `state` <"visible"|"hidden"|"stable"|"enabled"|"disabled"|"editable">
|
||||
- `state` <[ElementStateEnum]<"visible"|"hidden"|"stable"|"enabled"|"disabled"|"editable">>
|
||||
|
||||
A state to wait for, see below for more details.
|
||||
|
||||
|
||||
@ -429,11 +429,14 @@ Documentation.Type = class {
|
||||
*/
|
||||
static fromParsedType(parsedType, inUnion = false) {
|
||||
if (!inUnion && parsedType.union) {
|
||||
const name = parsedType.unionName || '';
|
||||
const type = new Documentation.Type(name);
|
||||
const type = new Documentation.Type(parsedType.unionName || '');
|
||||
type.union = [];
|
||||
for (let t = parsedType; t; t = t.union)
|
||||
type.union.push(Documentation.Type.fromParsedType(t, true));
|
||||
for (let t = parsedType; t; t = t.union) {
|
||||
const nestedUnion = !!t.unionName && t !== parsedType;
|
||||
type.union.push(Documentation.Type.fromParsedType(t, !nestedUnion));
|
||||
if (nestedUnion)
|
||||
break;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user