mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
20 lines
559 B
JavaScript
20 lines
559 B
JavaScript
|
|
// Test that functions can be wrapped multiple times and verify length and name
|
||
|
|
// properties are preserved correctly.
|
||
|
|
|
||
|
|
'use strict';
|
||
|
|
|
||
|
|
require('../common');
|
||
|
|
const assert = require('assert');
|
||
|
|
const { timerify } = require('perf_hooks');
|
||
|
|
|
||
|
|
const m = (a, b = 1) => {};
|
||
|
|
const n = timerify(m);
|
||
|
|
const o = timerify(m);
|
||
|
|
const p = timerify(n);
|
||
|
|
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');
|