Skip to content
Permalink
Browse files
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.
  • Loading branch information
timneutkens committed Aug 12, 2019
1 parent ba56f7e commit 069c33a033da2a934e98c7eee6b93bbd1b43cd2a
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/debug/ProfilingPlugin.js
@@ -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,

0 comments on commit 069c33a

Please sign in to comment.