Skip to content

Incorrectly parsed object destructuring assignment with short-hand properties #5035

@zhuravlikjb

Description

@zhuravlikjb
function drawES5Chart(options) {
    options = options === undefined ? {} : options;
    var size: any,
        radius: any;
    let cords: any;
    ({size = "big", cords = { x: 0, y: 0 }, radius = 25} = options); // here
    console.log(size, cords, radius);
}

As far as I see in spec, that's allowed for object destructuring assignment, in form of:

AssignmentProperty[Yield] :
    IdentifierReference[?Yield] Initializer[In,?Yield]opt

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions