Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

performance.timerify(fn) behave inconsistently for arrow functions #42936

Closed
Himself65 opened this issue May 2, 2022 · 1 comment
Closed

performance.timerify(fn) behave inconsistently for arrow functions #42936

Himself65 opened this issue May 2, 2022 · 1 comment
Labels
perf_hooks performance

Comments

@Himself65
Copy link

@Himself65 Himself65 commented May 2, 2022

Version

master branch, v18

Platform

all

Subsystem

pref_hooks

What steps will reproduce the bug?

import { performance } from 'perf_hooks'

function f1 () {
  return 1
}

const f2 = () => 2

const g1 = performance.timerify(f1)
const g2 = performance.timerify(f2)

console.log(g1(), f1())
console.log(g2(), f2())

What is the expected behavior?

/Users/himself65/.nvm/versions/node/v18.0.0/bin/node /Users/himself65/Code/test/index.mjs
1 1
2 2

What do you see instead?

/Users/himself65/.nvm/versions/node/v18.0.0/bin/node /Users/himself65/Code/test/index.mjs
f1 {} 1
2 2
@Himself65 Himself65 added performance perf_hooks confirmed-bug labels May 2, 2022
@Himself65 Himself65 closed this May 2, 2022
@Himself65 Himself65 removed the confirmed-bug label May 2, 2022
@Himself65
Copy link
Author

@Himself65 Himself65 commented May 2, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf_hooks performance
Projects
None yet
Development

No branches or pull requests

1 participant