mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 13:45:36 +03:00
chore: remove stack from WaitForEventInfo (#6259)
This commit is contained in:
parent
fe4fba4a16
commit
3a93c419f8
@ -16,12 +16,11 @@
|
||||
|
||||
import { EventEmitter } from 'events';
|
||||
import * as channels from '../protocol/channels';
|
||||
import type { Connection } from './connection';
|
||||
import type { Logger } from './types';
|
||||
import { createScheme, ValidationError, Validator } from '../protocol/validator';
|
||||
import { debugLogger } from '../utils/debugLogger';
|
||||
import { rewriteErrorMessage } from '../utils/stackTrace';
|
||||
import { createScheme, Validator, ValidationError } from '../protocol/validator';
|
||||
import { StackFrame } from '../common/types';
|
||||
import type { Connection } from './connection';
|
||||
import type { Logger } from './types';
|
||||
|
||||
export abstract class ChannelOwner<T extends channels.Channel = channels.Channel, Initializer = {}> extends EventEmitter {
|
||||
private _connection: Connection;
|
||||
@ -103,8 +102,8 @@ export abstract class ChannelOwner<T extends channels.Channel = channels.Channel
|
||||
}
|
||||
}
|
||||
|
||||
_waitForEventInfoBefore(waitId: string, apiName: string, stack: StackFrame[]) {
|
||||
this._connection.sendMessageToServer(this._guid, 'waitForEventInfo', { info: { apiName, waitId, phase: 'before', stack } }, undefined).catch(() => {});
|
||||
_waitForEventInfoBefore(waitId: string, apiName: string) {
|
||||
this._connection.sendMessageToServer(this._guid, 'waitForEventInfo', { info: { apiName, waitId, phase: 'before' } }, undefined).catch(() => {});
|
||||
}
|
||||
|
||||
_waitForEventInfoAfter(waitId: string, error?: string) {
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import { EventEmitter } from 'events';
|
||||
import { captureStackTrace, rewriteErrorMessage } from '../utils/stackTrace';
|
||||
import { rewriteErrorMessage } from '../utils/stackTrace';
|
||||
import { TimeoutError } from '../utils/errors';
|
||||
import { createGuid } from '../utils/utils';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
@ -32,7 +32,7 @@ export class Waiter {
|
||||
constructor(channelOwner: ChannelOwner, apiName: string) {
|
||||
this._waitId = createGuid();
|
||||
this._channelOwner = channelOwner;
|
||||
this._channelOwner._waitForEventInfoBefore(this._waitId, apiName, captureStackTrace().frames);
|
||||
this._channelOwner._waitForEventInfoBefore(this._waitId, apiName);
|
||||
this._dispose = [
|
||||
() => this._channelOwner._waitForEventInfoAfter(this._waitId, this._error)
|
||||
];
|
||||
|
@ -220,7 +220,6 @@ export class DispatcherConnection {
|
||||
switch (info.phase) {
|
||||
case 'before':
|
||||
callMetadata.apiName = info.apiName;
|
||||
callMetadata.stack = info.stack;
|
||||
this._waitOperations.set(info.waitId, callMetadata);
|
||||
break;
|
||||
case 'log':
|
||||
|
@ -39,7 +39,6 @@ export type WaitForEventInfo = {
|
||||
waitId: string,
|
||||
phase: 'before' | 'after' | 'log',
|
||||
apiName?: string,
|
||||
stack?: StackFrame[],
|
||||
message?: string,
|
||||
error?: string,
|
||||
};
|
||||
|
@ -42,9 +42,6 @@ WaitForEventInfo:
|
||||
- after
|
||||
- log
|
||||
apiName: string?
|
||||
stack:
|
||||
type: array?
|
||||
items: StackFrame
|
||||
message: string?
|
||||
error: string?
|
||||
|
||||
|
@ -47,7 +47,6 @@ export function createScheme(tChannel: (name: string) => Validator): Scheme {
|
||||
waitId: tString,
|
||||
phase: tEnum(['before', 'after', 'log']),
|
||||
apiName: tOptional(tString),
|
||||
stack: tOptional(tArray(tType('StackFrame'))),
|
||||
message: tOptional(tString),
|
||||
error: tOptional(tString),
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user