chore: resolve Object langAliases in function argument types (#1908)

This commit is contained in:
Yury Semikhatsky 2026-04-09 13:50:18 -07:00 committed by GitHub
parent 7dbd6cac3b
commit b01bf64e64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 5 deletions

View File

@ -10,7 +10,7 @@
<name>Playwright Client Examples</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<playwright.version>1.58.0</playwright.version>
<playwright.version>1.59.0</playwright.version>
</properties>
<dependencies>
<dependency>

View File

@ -1 +1 @@
1.59.1-beta-1775752988000
1.59.1-beta-1775762078000

View File

@ -506,6 +506,12 @@ class TypeRef extends Element {
if (customType != null) {
return customType;
}
// Inner Objects (e.g. function arguments) are not visited by createClassesAndEnums,
// so resolve their Java type name from langAliases here.
String alias = javaAlias(jsonType);
if (alias != null) {
return alias;
}
return "Map<" + convertTemplateParams(jsonType) + ">";
}
if ("Map".equals(name)) {
@ -525,9 +531,6 @@ class TypeRef extends Element {
if ("WebSocketRoute.onClose.handler".equals(jsonPath)) {
return "BiConsumer<Integer, String>";
}
if ("Screencast.start.options.onFrame".equals(jsonPath)) {
return "Consumer<ScreencastFrame>";
}
if (jsonType.getAsJsonArray("args").size() == 1) {
String paramType = convertBuiltinType(jsonType.getAsJsonArray("args").get(0).getAsJsonObject());
if (!jsonType.has("returnType") || jsonType.get("returnType").isJsonNull()) {