Skip to content

performance.timerify doesn't return wrapped function's return value #40623

Description

@acchou

Version

v16.13.0

Platform

Darwin AC-MacBook-Pro.hsd1.ca.comcast.net 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64 i386 MacBookPro16,1 Darwin

Subsystem

performance

What steps will reproduce the bug?

const perf = performance.timerify(function foo() {
    let sum = 0;
    for (let i = 0; i < 1000000; i++) {
        sum += i;
    }
    return sum;
});

const result = perf();
console.log(result);

How often does it reproduce? Is there a required condition?

This reproduces deterministically.

What is the expected behavior?

A number should be printed

What do you see instead?

foo {}

Additional information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues and PRs for confirmed bugs.perf_hooksIssues and PRs related to the perf_hooks module and performance measurement APIs.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions