diff --git a/benchmark/async_hooks/promises.js b/benchmark/async_hooks/promises.js index 5632a6901d611b..bbf51608d04aea 100644 --- a/benchmark/async_hooks/promises.js +++ b/benchmark/async_hooks/promises.js @@ -31,10 +31,11 @@ const bench = common.createBenchmark(main, { ] }); +const err = new Error('foobar'); async function run(n) { for (let i = 0; i < n; i++) { await new Promise((resolve) => resolve()) - .then(() => { throw new Error('foobar'); }) + .then(() => { throw err; }) .catch((e) => e); } }