Skip to content

Downlevel destructuring for parameter properties emits incorrectly #1540

Closed

Description

class C {
    constructor(public [x, y, z]: string[]) {
    }
}

Emitted code:

var C = (function () {
    function C(_a) {
        var x = _a[0], y = _a[1], z = _a[2];
        this.[x, y, z] = [x, y, z];
    }
    return C;
})();

Clearly this.[x,y,z] is not legal.

Activity

  1. mhegazy commented on Jan 15, 2015

    @mhegazy
    Contributor

    Based on our offline discussion, this should not be allowed.

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

Metadata

Metadata

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions