Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHimself65 <himself65@outlook.com>2022-04-25 01:33:00 +0300
committerHimself65 <himself65@outlook.com>2022-05-01 22:47:24 +0300
commit3d0fc13ba374d539cfb9a70e44310877cb6f7ceb (patch)
treee4fca102dca4fcc31d03d4207436b53bf0e12e60 /test
parentd268cf5a22e8fe4b631a2ce6a484e8d99991fa24 (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.js8
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 () => {