Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
content: anyToDiagnostic(e),
});
let result;
if (handleId != null) {
try {
let fn = nullthrows(this.handles.get(handleId)).fn;
result = responseFromContent(fn(...args));
} catch (e) {
result = errorResponseFromError(e);
}
} else if (method === 'childInit') {
try {
let [moduleName, childOptions] = args;
if (childOptions.patchConsole) {
patchConsole();
}
result = responseFromContent(this.childInit(moduleName, child));
} catch (e) {
result = errorResponseFromError(e);
}
} else if (method === 'startProfile') {
this.profiler = new Profiler();
try {
result = responseFromContent(await this.profiler.startProfiling());
} catch (e) {
result = errorResponseFromError(e);
}
} else if (method === 'endProfile') {
try {
let res = this.profiler ? await this.profiler.stopProfiling() : null;
if (event.bundle == null) {
this.report(event);
} else {
this.report({
...event,
bundle: new NamedBundle(
event.bundle,
event.bundleGraph,
this.options,
),
});
}
});
if (this.options.patchConsole) {
patchConsole();
}
}