Skip to content

function definitions in object shorthand should generate named function definitions rather than anonymous functions #6757

Closed
@nojvek

Description

@nojvek

Btw brilliant work on getting object shorthand

let logger = {
   log(str){
      console.log(str)
   }
};

generates

var logger = {
    log: function (str) {
        console.log(str);
    }
};

since it becomes an anonymous function, it doesn't stand out in stack traces. Emitting this would make debugging and stack traces a lot nicer.

var logger = {
    log: function log (str) {
        console.log(str);
    }
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptES6Relates to the ES6 SpecWon't FixThe severity and priority of this issue do not warrant the time or complexity needed to fix it

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions