Skip to content

NodeJS: Support named arrow function #663

@NimrodAvni78

Description

@NimrodAvni78

when trying to profile code with named arrow functions, the name of the function is anonymous

some code examples:

function cpuIntensiveTask(n) {
    if (n <= 1) return n;
    return cpuIntensiveTask(n - 1) + cpuIntensiveTask(n - 2);
}

const cpuIntensiveArrowTask = (n) => {
    if (n <= 1) return n;
    return cpuIntensiveArrowTask(n - 1) + cpuIntensiveArrowTask(n - 2);
}

const result = cpuIntensiveTask(41);
const resultArrow = cpuIntensiveArrowTask(41);

in the resulting profiles i am seeing the cpuIntensiveTask function, but for the other half of profiles im seeing <anonymous>

is this something that is supported?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions