mirror of
https://github.com/TheBinaryNinja/tvapp2.git
synced 2026-06-05 10:45:41 -04:00
build(deps): bump playwright from 1.49.1 to 1.50.1
This commit is contained in:
90
node_modules/playwright-core/lib/client/channelOwner.js
generated
vendored
90
node_modules/playwright-core/lib/client/channelOwner.js
generated
vendored
@@ -126,30 +126,21 @@ class ChannelOwner extends _eventEmitter.EventEmitter {
|
||||
if (validator) {
|
||||
return async params => {
|
||||
return await this._wrapApiCall(async apiZone => {
|
||||
const {
|
||||
apiName,
|
||||
frames,
|
||||
csi,
|
||||
callCookie,
|
||||
stepId
|
||||
} = apiZone.reported ? {
|
||||
apiName: undefined,
|
||||
csi: undefined,
|
||||
callCookie: undefined,
|
||||
frames: [],
|
||||
stepId: undefined
|
||||
} : apiZone;
|
||||
apiZone.reported = true;
|
||||
let currentStepId = stepId;
|
||||
if (csi && apiName) {
|
||||
const out = {};
|
||||
csi.onApiCallBegin(apiName, params, frames, callCookie, out);
|
||||
currentStepId = out.stepId;
|
||||
}
|
||||
return await this._connection.sendMessageToServer(this, prop, validator(params, '', {
|
||||
const validatedParams = validator(params, '', {
|
||||
tChannelImpl: tChannelImplToWire,
|
||||
binary: this._connection.rawBuffers() ? 'buffer' : 'toBase64'
|
||||
}), apiName, frames, currentStepId);
|
||||
});
|
||||
if (!apiZone.isInternal && !apiZone.reported) {
|
||||
// Reporting/tracing/logging this api call for the first time.
|
||||
apiZone.params = params;
|
||||
apiZone.reported = true;
|
||||
this._instrumentation.onApiCallBegin(apiZone);
|
||||
logApiCall(this._logger, `=> ${apiZone.apiName} started`);
|
||||
return await this._connection.sendMessageToServer(this, prop, validatedParams, apiZone.apiName, apiZone.frames, apiZone.stepId);
|
||||
}
|
||||
// Since this api call is either internal, or has already been reported/traced once,
|
||||
// passing undefined apiName will avoid an extra unneeded tracing entry.
|
||||
return await this._connection.sendMessageToServer(this, prop, validatedParams, undefined, [], undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
@@ -162,45 +153,35 @@ class ChannelOwner extends _eventEmitter.EventEmitter {
|
||||
}
|
||||
async _wrapApiCall(func, isInternal) {
|
||||
const logger = this._logger;
|
||||
const apiZone = _zones.zones.zoneData('apiZone');
|
||||
if (apiZone) return await func(apiZone);
|
||||
const stackTrace = (0, _stackTrace.captureLibraryStackTrace)();
|
||||
let apiName = stackTrace.apiName;
|
||||
const frames = stackTrace.frames;
|
||||
const existingApiZone = _zones.zones.zoneData('apiZone');
|
||||
if (existingApiZone) return await func(existingApiZone);
|
||||
if (isInternal === undefined) isInternal = this._isInternalType;
|
||||
if (isInternal) apiName = undefined;
|
||||
|
||||
// Enclosing zone could have provided the apiName and wallTime.
|
||||
const expectZone = _zones.zones.zoneData('expectZone');
|
||||
const stepId = expectZone === null || expectZone === void 0 ? void 0 : expectZone.stepId;
|
||||
if (!isInternal && expectZone) apiName = expectZone.title;
|
||||
|
||||
// If we are coming from the expectZone, there is no need to generate a new
|
||||
// step for the API call, since it will be generated by the expect itself.
|
||||
const csi = isInternal || expectZone ? undefined : this._instrumentation;
|
||||
const callCookie = {};
|
||||
const stackTrace = (0, _stackTrace.captureLibraryStackTrace)();
|
||||
const apiZone = {
|
||||
apiName: stackTrace.apiName,
|
||||
frames: stackTrace.frames,
|
||||
isInternal,
|
||||
reported: false,
|
||||
userData: undefined,
|
||||
stepId: undefined
|
||||
};
|
||||
try {
|
||||
logApiCall(logger, `=> ${apiName} started`, isInternal);
|
||||
const apiZone = {
|
||||
apiName,
|
||||
frames,
|
||||
isInternal,
|
||||
reported: false,
|
||||
csi,
|
||||
callCookie,
|
||||
stepId
|
||||
};
|
||||
const result = await _zones.zones.run('apiZone', apiZone, async () => await func(apiZone));
|
||||
csi === null || csi === void 0 || csi.onApiCallEnd(callCookie);
|
||||
logApiCall(logger, `<= ${apiName} succeeded`, isInternal);
|
||||
if (!isInternal) {
|
||||
logApiCall(logger, `<= ${apiZone.apiName} succeeded`);
|
||||
this._instrumentation.onApiCallEnd(apiZone);
|
||||
}
|
||||
return result;
|
||||
} catch (e) {
|
||||
const innerError = (process.env.PWDEBUGIMPL || (0, _utils.isUnderTest)()) && e.stack ? '\n<inner error>\n' + e.stack : '';
|
||||
if (apiName && !apiName.includes('<anonymous>')) e.message = apiName + ': ' + e.message;
|
||||
if (apiZone.apiName && !apiZone.apiName.includes('<anonymous>')) e.message = apiZone.apiName + ': ' + e.message;
|
||||
const stackFrames = '\n' + (0, _stackTrace.stringifyStackFrames)(stackTrace.frames).join('\n') + innerError;
|
||||
if (stackFrames.trim()) e.stack = e.message + stackFrames;else e.stack = '';
|
||||
csi === null || csi === void 0 || csi.onApiCallEnd(callCookie, e);
|
||||
logApiCall(logger, `<= ${apiName} failed`, isInternal);
|
||||
if (!isInternal) {
|
||||
apiZone.error = e;
|
||||
logApiCall(logger, `<= ${apiZone.apiName} failed`);
|
||||
this._instrumentation.onApiCallEnd(apiZone);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@@ -220,8 +201,7 @@ class ChannelOwner extends _eventEmitter.EventEmitter {
|
||||
}
|
||||
}
|
||||
exports.ChannelOwner = ChannelOwner;
|
||||
function logApiCall(logger, message, isNested) {
|
||||
if (isNested) return;
|
||||
function logApiCall(logger, message) {
|
||||
if (logger && logger.isEnabled('api', 'info')) logger.log('api', 'info', message, [], {
|
||||
color: 'cyan'
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user