Skip to content

2.1 compile error: "Unexpected token , fo #12412

Closed

Description

@unional
function (m: string) {
    [1, 2, 3].map(i => {
        return true? { [m]: i } : false
    })
}

produces:

function (m) {
    [1, 2, 3].map(function (i) {
        return true ? _a = {}, _a[m] = i, _a : false;   // <-- unexpected token ,
        var _a;
    });
}

instead of:

function (m) {
    [1, 2, 3].map(function (i) {
        return true ? (_a = {}, _a[m] = i, _a) : false;
        var _a;
    });
}

Activity

  1. locked and limited conversation to collaborators on Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions