Skip to content

Emit named functions in DEV mode for easier profiling #2129

Open
@gampleman

Description

@gampleman

Quick Summary: (anonymous) functions are hard to work with in the browsers Dev tools when profiling code. Having something like user$module$function would be much easier to understand.

Elm functions are currently defined something like this in JS:

var user$project$module$function = F2(function(arg1, arg2) {
   ...
});

However, the F2 call means that the JS engine doesn't infer that the name of the function is actually user$project$module$function, but considers it (anonymous). However, if we had the following output:

var user$project$module$function = F2(function user$project$module$function(arg1, arg2) {
   ...
});

then the dev tools could print much nicer stack frames.

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