Skip to content

Incorrect minification of return [...iter].length in babili 0.1.4 #609

@AshleyScirra

Description

@AshleyScirra

Minifying this in babili 0.1.4:

function foo()
{
	return [...iter].length;
}

incorrectly outputs this:

function foo() {
	return 1;
}

Babili can't tell at compile-time how many elements the iterator will return, so it's incorrect to assume it's always 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bughas PRHas an open PR that fixes this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions