diff options
author | Himself65 <himself65@outlook.com> | 2022-04-25 01:33:00 +0300 |
---|---|---|
committer | Himself65 <himself65@outlook.com> | 2022-05-01 22:47:24 +0300 |
commit | 3d0fc13ba374d539cfb9a70e44310877cb6f7ceb (patch) | |
tree | e4fca102dca4fcc31d03d4207436b53bf0e12e60 /test | |
parent | d268cf5a22e8fe4b631a2ce6a484e8d99991fa24 (diff) |
perf_hooks: return different functions in timerify
Fixes: https://github.com/nodejs/node/issues/42742
PR-URL: https://github.com/nodejs/node/pull/42854
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Co-authored-by: HE Shi-Jun <hax@heshijun.net>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-performance-function.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/parallel/test-performance-function.js b/test/parallel/test-performance-function.js index ea928028208..fcc3004d028 100644 --- a/test/parallel/test-performance-function.js +++ b/test/parallel/test-performance-function.js @@ -75,16 +75,18 @@ const { }); } -// Function can only be wrapped once, also check length and name +// Function can be wrapped many times, also check length and name { const m = (a, b = 1) => {}; const n = performance.timerify(m); const o = performance.timerify(m); const p = performance.timerify(n); - assert.strictEqual(n, o); - assert.strictEqual(n, p); + assert.notStrictEqual(n, o); + assert.notStrictEqual(n, p); + assert.notStrictEqual(o, p); assert.strictEqual(n.length, m.length); assert.strictEqual(n.name, 'timerified m'); + assert.strictEqual(p.name, 'timerified timerified m'); } (async () => { |