Skip to content

[Transforms] computed property names in enums, capturing of value to temp not emited #7870

@mhegazy

Description

@mhegazy

Expected:

//// [parserES5ComputedPropertyName6.ts]
enum E {
  [e] = 1
}

//// [parserES5ComputedPropertyName6.js]
var E;
(function (E) {
    E[E[e] = 1] = e;
})(E || (E = {}));

Actual:

//// [parserES5ComputedPropertyName6.ts]
enum E {
  [e] = 1
}

//// [parserES5ComputedPropertyName6.js]
var E;
(function (E) {
    E[E[_a] = 1] = _a;
})(E || (E = {}));

Failed tests:

  • tests\cases\conformance\parser\ecmascript5\ComputedPropertyNames\parserES5ComputedPropertyName6.ts
  • tests/cases/compiler/literalsInComputedProperties1.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: TransformsRelates to the public transform APIFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions