chore: prepare to language ports roll (#36211)

This commit is contained in:
Dmitry Gozman 2025-06-05 14:49:05 +01:00 committed by GitHub
parent e313b8b1e8
commit 3ab097b54e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 4 deletions

View File

@ -346,9 +346,7 @@ export class Route extends ChannelOwner<channels.RouteChannel> implements api.Ro
async fulfill(options: { response?: api.APIResponse, status?: number, headers?: Headers, contentType?: string, body?: string | Buffer, json?: any, path?: string } = {}) {
await this._handleRoute(async () => {
await this._wrapApiCall(async () => {
await this._innerFulfill(options);
}, { internal: true });
await this._innerFulfill(options);
});
}

View File

@ -24,6 +24,7 @@ import { TargetClosedError, isTargetClosedError, serializeError } from '../error
import { SdkObject } from '../instrumentation';
import { isProtocolError } from '../protocolError';
import { compressCallLog } from '../callLog';
import { methodMetainfo } from '../../utils/isomorphic/protocolMetainfo';
import type { CallMetadata } from '../instrumentation';
import type { PlaywrightDispatcher } from './playwrightDispatcher';
@ -304,6 +305,12 @@ export class DispatcherConnection {
return;
}
if (methodMetainfo.get(dispatcher._type + '.' + method)?.internal) {
// For non-js ports, it is easier to detect internal calls here rather
// than generate protocol metainfo for each language.
validMetadata.internal = true;
}
const sdkObject = dispatcher._object instanceof SdkObject ? dispatcher._object : undefined;
const callMetadata: CallMetadata = {
id: `call@${id}`,

View File

@ -136,7 +136,7 @@ function properties(properties, indent, onlyOptional, parentName, level) {
if (name === 'android' || name === 'electron')
continue;
if (name.startsWith('$mixin')) {
visitProperties(mixins.get(value).properties, parentName + toTitleCase(name));
visitProperties(mixins.get(value).properties, parentName);
continue;
}
const inner = inlineType(value, indent, parentName + toTitleCase(name), level + 1);