Skip to content

Allow Object Literal to be Explicit with String Names #1103

@sebmarkbage

Description

@sebmarkbage
var foo = {
  'bar': 123
};
window.bar = function() {
  console.log(foo['bar']);
}

Turns into:

var foo = {
  bar: 123
};
window.bar = function() {
  console.log(foo['bar']);
}

Note that the object literal lost its explicit string encoding. This breaks Google Closure Compiler's advanced mode heuristic/convention around property name mangling. Uglify has this mode too.

Maybe an explicit mode would be good for this? Or should it be default?

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.status:has prIssues with an accompanying pull request. These issues will probably be fixed soon!

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions