Fix asyncHook callback interceptor for ProfilingPlugin
While writing a custom profiler I ran into the issue that TerserPlugin never called it’s `end` trace. Eventually I tracked it down to the callback function. Instead of being overwritten it was being appended to the end of the function arguments. The callback has to be popped first because the added argument is a wrapper for the original callback.
This commit is contained in:
parent
ba56f7eee0
commit
069c33a033
|
@ -391,8 +391,8 @@ const makeNewProfiledTapFn = (hookName, tracer, { name, type, fn }) => {
|
|||
id,
|
||||
cat: defaultCategory
|
||||
});
|
||||
const callback = args.pop();
|
||||
fn(...args, (...r) => {
|
||||
const callback = args.pop();
|
||||
tracer.trace.end({
|
||||
name,
|
||||
id,
|
||||
|
|
Loading…
Reference in New Issue